http://lxr.linux.no/
is the best one to have look @ code
I am not able to compile c code
gcc is not getting path of module.h and kernel.h
#include <module.h> /* Needed by all modules */
#include <kernel.h> /* Needed for KERN_INFO */
int init_module(void)
{
printk(KERN_INFO "Hello world 1.\n");
/*
* A non 0 return means init_module failed; module can't be loaded.
*/
return 0;
}
void cleanup_module(void)
{
printk(KERN_INFO "Goodbye world 1.\n");
}
=========================
[root@linuxguru.symantec.com][ /usr/src ]gcc -o hello-1.0 hello-1.c
hello-1.c:1:54: error: module.h: No such file or directory
hello-1.c:2:53: error: kernel.h: No such file or directory
hello-1.c: In function ‘init_module’:
hello-1.c:6: error: ‘KERN_INFO’ undeclared (first use in this function)
hello-1.c:6: error: (Each undeclared identifier is reported only once
hello-1.c:6: error: for each function it appears in.)
hello-1.c:6: error: expected ‘)’ before string constant
hello-1.c: In function ‘cleanup_module’:
hello-1.c:14: error: ‘KERN_INFO’ undeclared (first use in this function)
hello-1.c:14: error: expected ‘)’ before string constant
[root@linuxguru.symantec.com][ /usr/src ]vi hello-1.c
=
plz compile @ ur end and let me know ?