LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-11-2010, 03:20 PM   #1
e_pech
LQ Newbie
 
Registered: Jul 2007
Posts: 8

Rep: Reputation: 0
Question Compile my own driver


Hello,

I'm trying to follow a tutorial on how to write a driver in Linux (a Hello World driver) however I get errors when I'm compiling it.

Under the /usr/src/ folder I have 2 folders:

Both of them say linux-headers-2.6.... but one of them says 'generic' at the end.

I guess that's the Kernel Source. However when I compile the driver errors come up saying that the can't open the <linux/module.h> and <linux/init.h> files.

How can I fix this issue? I've read some other websites saying that I should have a 'linux' folder under /usr/src, however I don't... could that be the problem???
 
Old 02-11-2010, 03:24 PM   #2
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,298
Blog Entries: 61

Rep: Reputation: Disabled
What distro are you running?
 
Old 02-11-2010, 04:00 PM   #3
e_pech
LQ Newbie
 
Registered: Jul 2007
Posts: 8

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by brianL View Post
What distro are you running?
Ubuntu 9.04
 
Old 02-11-2010, 04:09 PM   #4
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,298
Blog Entries: 61

Rep: Reputation: Disabled
You need the source for the kernel you're running. Open Synaptic to look for it and install it. Look for module-init tools (think that's the name) as well.
 
Old 02-11-2010, 09:39 PM   #5
e_pech
LQ Newbie
 
Registered: Jul 2007
Posts: 8

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by brianL View Post
You need the source for the kernel you're running. Open Synaptic to look for it and install it. Look for module-init tools (think that's the name) as well.

I'm sorry, I figured it out.. I did have the Kernel Source installed.. the stupid mistake was that my driver source files were in a Folder that had a space in the name (Linux Docs/Drivers) something like that.. So when I typed the 'make' command it didn't work.
Stupid mistake, but now everything is OK.. thank you!!!
 
Old 02-12-2010, 04:04 AM   #6
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,298
Blog Entries: 61

Rep: Reputation: Disabled
Glad you've got it sorted out.
 
  


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
cannot compile a driver against 2.6.17.13 tramni1980 Slackware 7 10-16-2006 01:46 PM
compile a driver giraf Debian 1 12-29-2005 06:38 AM
How compile a new driver GregLille Linux - Networking 3 01-05-2005 05:42 AM
driver compile rcarlino Mandriva 0 08-25-2003 07:22 AM
How do I compile a driver lexy Linux - Newbie 3 12-16-2002 04:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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