|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Building linux kernel module/Driver in C code?
I want to compile and run below code I tried lot as
# gcc -C -W -Wall -D__KERNEL__ -DMODULE -isystem /lib/modules/2.6.23.14-115.fc8/build -v /usr/include/linux/version.h -c hello.c # gcc -C -E -W -Wall -D__KERNEL__ -DMODULE -isystem /lib/modules/2.6.23.14-115.fc8/build -v /usr/include/linux/version.h -c hello.c # gcc -C -E -W -Wall -D__KERNEL__ -DMODULE -isystem /lib/modules/2.6.23.14-115.fc8/build -v /usr/include/linux/version.h -c hello.c # gcc -W -Wall -D__KERNEL__ -DMODULE -isystem /lib/modules/2.6.23.14-115.fc8/build -v /usr/include/linux/version.h -c hello.c # gcc -W -Wall -D__KERNEL__ -DMODULE -isystem /lib/modules/2.6.23.14-115.fc8/build -v /usr/include/linux/version.h -c hello.c Its not able to find linux/module.h whereas I have installed linux-source code and able to see same file in include/linux/module.h ? #include <linux/module.h> int init_module(void) { printk("<1>Hello, world\n"); return 0; } void cleanup_module(void) { printk("<1>Goodbye cruel world\n"); } I tried by Creating Makefile with contents: obj-m <tab spaces> := hello.o ===============================then fired below============ # make -C /lib/modules/`uname -r` M=/Project modules # make -C /lib/modules/`uname -r` M=/Project modules -c hello.c # make -C /lib/modules/`uname -r` M=/Project modules hello.c # make -C /lib/modules/`uname -r` M=/Project modules hello.c But all failed ...................! Need Help Is Anybody konwing how to compile Kernel C code I have docs to will send to u guys as per ur request for reference???????? My Linux Version : uname -r Linux linuxguru.symantec.com 2.6.23.14-115.fc8 #1 SMP Mon Jan 21 14:20:50 EST 2008 i686 i686 i386 GNU/Linux |
|
#2
|
|||
|
|||
|
Quote:
I got solutn |
![]() |
| Viewing: Web Development Archives > Mailing Lists > Linux > Building linux kernel module/Driver in C code? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|