Hey guys,
I am new to Linux drive programming. I am trying to learn it from a old book. The first example is to insert and remove a hello world module which is actually doing nothing.
Here is the code of the module.
Code:
#define MODULE
#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 named it hello.c
According to the book. I should be able to compile it easily by typing the command:
Code:
root# gcc -c hello.c
That is where i get "hello.c:3:26: error: linux/module.h: No such file or directory"
this is the information about my system by command
2.6.32-33-generic
Could anyone helps out? And please tell the reason.
Because i am new to this section. I have no idea how to read or write a make file. For me it is better to stick with the book. Figure out how to make the gcc works in this situation.
Thanks for attention.