Messages in this thread |  | | Date | Sat, 25 Aug 2001 23:04:09 +0400 | From | Evgeny Polyakov <> | Subject | Re: basic module bug |
| |
Hello.
On Sat, 25 Aug 2001 10:56:45 -0500 Bob McElrath <mcelrath@draal.physics.wisc.edu> wrote:
BM> Where can I find a "skeleton" kernel module for comparison?
You wrote it some strins below.
BM> Here's a simpler case more compatible with the options passed to gcc BM> when the kernel is compiled:
BM> /* test module. Compile with: gcc -c -I/usr/src/linux/include BM> * -D__KERNEL__ -DMODULE test.c */ BM> #include <linux/module.h> BM> #include <linux/kernel.h> BM> #include <asm/current.h> BM> #ifdef MODULE BM> int init_module(void) BM> #else BM> int test_init(void) BM> #endif BM> { BM> return 0; BM> } BM> #ifdef MODULE BM> void cleanup_module(void) BM> { BM> } BM> #endif
BM> (0)<mcelrath@draal:/home/mcelrath> gcc -c -I/usr/src/linux/include -D__KERNEL__ BM> -DMODULE test.c BM> In file included from test.c:5: BM> /usr/src/linux/include/asm/current.h:4: warning: call-clobbered register BM> used for global register variable
[s0mbre@Sombre /tmp]$ gcc ./test.c -c -o ./test.o -D__KERNEL__ -DMODULE -I/usr/src/linux/include [s0mbre@Sombre /tmp]$
All is OK.
BM> Yet a simpler case:
BM> #include <asm/current.h> BM> int main() {}
[s0mbre@Sombre /tmp]$ gcc ./test1.c -o ./test1 [s0mbre@Sombre /tmp]$ cat ./test1.c #include <asm/current.h> int main() {} [s0mbre@Sombre /tmp]$
BM> Generates the same warning message. Why does this message not occur BM> when compiling the kernel?
I have no problem. But if i would have this problem, i a) rewrite include dir and check symlink b) reinstall system :)
BM> Cheers, BM> -- Bob
--- WBR. //s0mbre - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
|  |