LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Some prob's getting LKM's to compile right (https://www.linuxquestions.org/questions/programming-9/some-probs-getting-lkms-to-compile-right-112954/)

hadding 11-06-2003 02:50 AM

Some prob's getting LKM's to compile right
 
I'm learning about kernel modules and have written a couple of the "Hello world" variety.
when I go to install them with insmod I get an error that this mod was compiled for kernel-2.4.20 and you are running kernel-2.4.20-20.9

I have the the kernel-2.4.20-20.9 source installed and through some trial and error I've figured out that it's using the module.h installed by glibc-kernheaders. I have the newest glibc. Shouldn't kernheaders match my kernel ? Do I have some kind of version incompatability going or do I have my path misconfigured?

thanks

_h

hadding 11-06-2003 06:40 AM

Well .... first I used insmod -force , but didn't like the ugly messages so I edited /usr/include/linux/version.h and changed UTS_RELEASE "2.4.20" to 2.4.20-9" (BTW what the heck is LINUX_VERSION_CODE ?) Compiled and tried insmod again. This time it complained about tainting. Did some more research and discovered that for newer kernels I have to put " MODULE_LICENSE("GPL"); " in my source. So everything seems peachy now.

Is the above the correct way of solving this or did I just create a really ugly hack ?

In RedHat 9 what are the correct sym links for my kernel source tree and kernel headers ?
Read that /usr/src/linux is supposed to point @ /usr/include/linux ( glibc kernheaders) and god knows what @ /usr/include/asm. It's late and my head is full of too many facts and way too many cups of tea. Think I'll go down a couple of shots and go to bed.

later

_h


All times are GMT -5. The time now is 04:45 AM.