LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices

Reply
 
LinkBack Search this Thread
Old 01-17-2008, 11:54 PM   #1
p.arun
LQ Newbie
 
Registered: Jan 2007
Location: Chennai
Distribution: Red hat
Posts: 15

Rep: Reputation: 0
Problem in compiling a device driver program


Hi All,

I'm a new aspiring device driver programming learner. I have downloaded scull source code ( of Alessandro Rubini: linux device drivers third edition )
While I run make command, I get following error


[parun@tunnel scull]$ make
make -C /lib/modules/2.6.18-1.2798.fc6/build M=/home/parun/Desktop/examples/scull LDDINC=/home/parun/Desktop/examples/scull/../include modules
make[1]: Entering directory `/usr/src/kernels/2.6.18-1.2798.fc6-i586'
CC [M] /home/parun/Desktop/examples/scull/main.o
/home/parun/Desktop/examples/scull/main.c:17:26: error: linux/config.h: No such file or directory
make[2]: *** [/home/parun/Desktop/examples/scull/main.o] Error 1
make[1]: *** [_module_/home/parun/Desktop/examples/scull] Error 2
make[1]: Leaving directory `/usr/src/kernels/2.6.18-1.2798.fc6-i586'
make: *** [modules] Error 2

As per my understanding, the main.c program refers a header file linux/config.h .But there was no config.h in linux source codes header directory.Is it the mistake of the scull code??

Reply me, if you find any clues

thanks and regards,
Arun
 
Old 01-18-2008, 01:50 AM   #2
thedonkdonk
Member
 
Registered: Oct 2005
Location: San Antonio, TX
Distribution: Fedora 15, RHEL 6, CentOS 6, Debian 5, Arch, Gentoo
Posts: 136

Rep: Reputation: 16
You need to install the kernel-devel package. Run:
Code:
sudo yum -y install kernel-devel-$(uname -r)
 
Old 01-18-2008, 03:14 AM   #3
p.arun
LQ Newbie
 
Registered: Jan 2007
Location: Chennai
Distribution: Red hat
Posts: 15

Original Poster
Rep: Reputation: 0
thanks for reply

I installed the component you mentioned.But still I find the same error creeping up
 
Old 01-18-2008, 06:02 AM   #4
thedonkdonk
Member
 
Registered: Oct 2005
Location: San Antonio, TX
Distribution: Fedora 15, RHEL 6, CentOS 6, Debian 5, Arch, Gentoo
Posts: 136

Rep: Reputation: 16
Is there some place i can download the source? I can try looking at the code and see whats going on. also i assumed that when you ran ./configure it ran without errors?
 
Old 01-23-2008, 01:14 AM   #5
p.arun
LQ Newbie
 
Registered: Jan 2007
Location: Chennai
Distribution: Red hat
Posts: 15

Original Poster
Rep: Reputation: 0
thanks mate,
I just copied linux/config.h from another server to linux-2.6/include/linux/ directory and then tried again.It works now.I don't know how that file is missed earlier
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in compiling a char device driver formerly for kernel 2.4 on kernel 2.6 payretep Linux - Newbie 6 09-24-2007 05:43 AM
Compiling Device Driver in Linux i_love_linux Linux - Kernel 13 09-04-2007 09:24 AM
device driver program swamy suresh Programming 1 06-08-2007 09:39 AM
compiling raw source code of device driver bishalpoudyal Linux - Hardware 1 04-08-2006 03:09 AM
Help with converting a userspace PCI program to a Device Driver cstrask Linux - Hardware 0 10-31-2005 09:07 PM


All times are GMT -5. The time now is 12:42 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration