LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 06-04-2006, 02:36 AM   #1
shrikantpwr245
LQ Newbie
 
Registered: Apr 2006
Posts: 2

Rep: Reputation: 0
Angry How to compile device driver code for linux kernel 2.4.21


hi,
i written simple code for device driver that is their in the book of Linux Programming by Neil Mathew. It is simple code comprising of init_module and cleanup_module and it prints messege in kernel space using printk().
when i compile code using
gcc -DMODVERSION -DMODULE ...... -o code.o -c code.c
it gives error saying does not find the kernel version for which the code is complied
i tried by simply gcc -c code.c
code gets compiled and creates code.o file but
when i try to insert this module in to the kernel it shows error messege saying code is compiled for linux 2.4.20 kernel and this is kernel 2.4.21 ..
Is their any different methode of code compilation for this kernel ?
also mounting of NTFS file system is also not working in my system..
i tried that by creating entries in /etc/fstab and by creating folder in /mnt directory..
I have RED HAT LINUX ES3 with kernel 2.4.21 in my system..
please help me.
 
Old 06-04-2006, 06:51 AM   #2
avivg
LQ Newbie
 
Registered: Dec 2004
Posts: 7

Rep: Reputation: 0
Make sure you have a -I flag that points to the correct include directory where the actual kernel source/headers exist for the kernel you are trying to load to.
 
  


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
Code for a Polling Linux Device Driver Jay-Whizzle Linux - Hardware 1 03-22-2006 12:52 AM
Where can i find the device driver code on my systeM dr_zayus69 Linux - Hardware 1 10-02-2005 04:59 AM
Device driver code ar1 Programming 2 05-13-2005 08:20 AM
Oreilly's linux device driver example code... okeyla Linux - Hardware 2 04-27-2005 04:58 AM

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

All times are GMT -5. The time now is 10:57 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