I give you a little code, you need to create a Makefile like this (more info in Documentation/Kbuild/Meakefiles.txt):
obj-m := main.o
sadoo-objs := main.o
When you compile your module, do this:
$make -C (the path of your kernel source) M=$PWD modules
The path of kernel soure must be the same path of the kernel that you use in your system, don't work at all if you use a source that you downloaded. In my case I use the path like this (I have RHEL 4): /usr/src/kernels/2.6.9-5.EL-i686
|