Results 1 to 1 of 1
Thread: Basic module loading
Enjoy an ad free experience by logging in. Not a member yet? Register.
Basic module loading
wanted to write HelloWorld module. But I didn't succeeded because
it won't work for some reason [with generic kernel]. Here is code
for this basic module hello-1.c:
printk("<1>Hello world 1.\n");
* A non 0 return means init_module failed; module can't be loaded
printk(KERN_ALERT "Goodbye world 1.\n");
I have this Makefile for building modules:
obj-m += hello-1.o
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
and I checked in /lib/modules/ and I have folder /2.6.28-15-generic/
so why it does not work ?
I also tried
sudo apt-get install linux-headers-$(uname -r)
and it says
linux-headers-2.6.28-15-generic is already the newest version.
Anyway I am building new kernel 2.6.31 tonight and I think it will work
then, but I am interested to know why it does not work now ?
Any idea ?