problems with Hello World kernel2.6 module
I'm having problems to compile a simple Hello World module. I'm using the kernel 2.6 with a SUSE 10.0 distribution and gcc 4.0.2.
The problem is that the Makefile doesn't compile the module, it doesnt create .o or .ko objects. Can anyone help?
*** Here is the code:
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
MODULE_LICENSE("GPL");
static int hello_init(void)
{
printk(KERN_ALERT "Hello World\n");
return 0;
}
static void hello_cleanup(void) {
printk(KERN_ALERT "Bye!\n");
}
module_init(hello_init);
module_exit(hello_cleanup);
*** The Makefile:
obj-m := hello.o
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
*** The Output:
unit1:/home/rui/module # make
make -C /lib/modules/2.6.13-15-smp/build SUBDIRS=/home/rui/module modules
make[1]: Entering directory `/usr/src/linux-2.6.13-15-obj/i386/smp'
make -C ../../../linux-2.6.13-15 O=../linux-2.6.13-15-obj/i386/smp modules
Building modules, stage 2.
MODPOST
make[1]: Leaving directory `/usr/src/linux-2.6.13-15-obj/i386/smp'
|