LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 08-01-2004, 10:37 AM   #1
djgerbavore
Member
 
Registered: Jun 2004
Location: PA
Distribution: Fedora (latest git kernel)
Posts: 458

Rep: Reputation: 30
newbie kernel module programing question


i'm learning to kernel programing, and i was starting to make my first module. THe problem is that when i compile my program the compiler say "this module is made for kenel 2.4.22 and you are using kernel 2.4.24" does that mean i can only program in the 2.4.22 kernel or can i make modules in teh 2.4.24 kernel. Thanks!
 
Old 08-01-2004, 01:29 PM   #2
infamous41md
Member
 
Registered: Mar 2003
Posts: 804

Rep: Reputation: 30
you need to include the proper headers when building. ie, gcc -I /usr/src/linux-2.4.24 .
 
Old 08-01-2004, 03:51 PM   #3
djgerbavore
Member
 
Registered: Jun 2004
Location: PA
Distribution: Fedora (latest git kernel)
Posts: 458

Original Poster
Rep: Reputation: 30
i tried the following command :

gcc -I /usr/src/linux-2.4.24 -c hello.c
insmod hello.o
and i get the same error, i tried a couple different command similar to this one and still got the same error, do i need to add a header or something inside of hello.c? thank for your help.
 
Old 08-01-2004, 04:02 PM   #4
infamous41md
Member
 
Registered: Mar 2003
Posts: 804

Rep: Reputation: 30
hmm, i thought that was all you needed, but perhaps i've forgotten something. search this forum for similar posts and you will perhaps find something more. this is a question asked many times in here.
 
Old 08-01-2004, 04:38 PM   #5
djgerbavore
Member
 
Registered: Jun 2004
Location: PA
Distribution: Fedora (latest git kernel)
Posts: 458

Original Poster
Rep: Reputation: 30
i search the forum and i found the solution, you need this command:
gcc -I /lib/modules/'uname -r'/build/include -c hello.c

insmod hello.o worked


thanks
 
  


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
Newbie programing question matthewa Programming 4 03-20-2005 04:37 PM
A newbie is seeking for document about linux programing TruongAn Programming 4 02-21-2005 09:12 PM
C programing question israel Programming 2 11-29-2004 06:05 AM
From complete newbie to C++ programing in Linux Replicator 3.0 Programming 12 05-10-2004 02:23 PM
kernel module ignorant newbie looking for any one with kernel module knowledge cpoet Slackware 4 11-24-2003 09:37 PM

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

All times are GMT -5. The time now is 06:56 AM.

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