I am using fedora core 6(2.6.18.1).I have compiled kernel 2.6.18.2.So I wnt to do a simple device driver programe.I wrote the program below...
/* hello-1.c - The simplest kernel module.
*/
#include <linux/module.h> /* Needed by all modules */
#include <linux/kernel.h> /* Needed for KERN_ALERT */
int init_module(void)
{
printk("<1>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_ALERT "Goodbye world 1.\n");
}
I used the command gcc -c hello.c
But Im getting error message as file <linux/module.h> not found.SAme error for kernel.h also.
For kernel compilation I used the area /usr/src.
I extracted the bzip file of kernel to /usr/src.
And so I got a folder as linux-2.6.18.2
Then i followd the instructions for compilation...and it was success...no error at al.
When i tried to compile the file I am getting this error.Is there any problem with the path of include file?
I could find the .h files in /usr/src/include/linux
and in /usr/src/include/asm-x86.
pls help me to make this program to work..