LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-06-2003, 02:50 AM   #1
hadding
Member
 
Registered: Oct 2003
Distribution: Redhat 9
Posts: 40

Rep: Reputation: 15
Question 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
 
Old 11-06-2003, 06:40 AM   #2
hadding
Member
 
Registered: Oct 2003
Distribution: Redhat 9
Posts: 40

Original Poster
Rep: Reputation: 15
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Prob's with Tarball Wavz Linux - Software 6 01-22-2007 06:36 AM
New install prob's on Laptop with 10.1 sniperhf Mandriva 5 01-25-2005 09:31 AM
Do I need an /etc/modules.conf to use LKM's behmjose Linux - Newbie 0 03-08-2004 09:59 AM
X won't start; save session prob's 3l10 Linux - Newbie 6 09-29-2003 07:06 PM
Slack Distro Gives me alot of prob's Psyman014 Linux - Software 2 09-25-2003 08:42 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration