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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
10-06-2005, 01:04 PM
|
#1
|
LQ Newbie
Registered: Sep 2005
Posts: 5
Rep:
|
device driver
Does anyone know of any resources (code, books, info,etc) that can help me wirte a device driver for Fedora. Possibly a usb or floppy driver. I am new to device driver programming so any help will be apreciated. Thank you.
|
|
|
10-06-2005, 03:41 PM
|
#2
|
LQ Guru
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Rep: 
|
The very *best* resource (bar none, IMHO) is this book:
Linux Device Drivers, 3rd Edition; O'Reilly
http://www.bookpool.com/sm/0596005903
<= ASSUMING YOU'RE WORKING WITH THE CURRENT, 2.6 KERNEL,
PLEASE DO *NOT* CONSIDER GETTING AN EARLIER
EDITION OF THIS BOOK
I'd also recommend:
Linux Kernel Development, 2nd Edition; Robert Love
http://www.bookpool.com/sm/0672327201
<= THIS HAS LESS CODE THAN THE O'REILLY BOOK - BUT A LOT
MORE "BACKGROUND", AND MUCH USEFUL "SAGE WISDOM"
My feeling is that the two complement each other very nicely.
'Hope that helps .. PSM
|
|
|
10-06-2005, 03:52 PM
|
#3
|
Member
Registered: Apr 2005
Distribution: Debian
Posts: 154
Rep:
|
Like many things in linux, the driver must be written in C (as far as I know). Drivers are written as modules, and modules have to have their own special functions. These functions are defined in the C library.
A good book on the subject is Linux Device Drivers from o'reilly. It starts basic with a hello world module, but goes into the details fairly quickly. The book assumes you know C pretty well already. Also, drivers are pretty close to the kernel so you might want to know a bit about the kernel too. Understanding the Linux Kernel from o'reilly can help on that. However, that may be a step above a driver, since I hear that a lot of people try to learn about the kernel by writing a driver.
As far as code goes, you can learn a lot by looking at drivers from other people. This is what's nice about an open source OS: all you need to do is download the kernel source and dive into the drivers section. There have got to be hundreds in there, so you'll have plenty to work with. Learning by looking at code is a painful method though, and unless the author likes to comment a lot you may not learn much.
|
|
|
10-07-2005, 02:31 AM
|
#4
|
LQ Newbie
Registered: Sep 2005
Posts: 5
Original Poster
Rep:
|
Hey guys thanks for your input. I've actually downloaded "Linux Device Drivers", 3rd Edition; O'Reilly and I am about to dive into it. I think is great that O'Reilly is offering the book free under an open source license. Open source is beautiful. This exchange of ideas allows you to be part of a community, and also drives innovation. Furthermore, I never thought even thought about looking at the kernel source. That will help me tremendously. Thanks again guys.
side note: I appreciate your quick responses. Linuxquestions really is a supreme Linux forum with innovative and helpful members.
|
|
|
10-07-2005, 09:36 AM
|
#5
|
LQ Guru
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Rep: 
|
I believe the free download is the 2nd edition. You do NOT - repeat: do NOT - want the 2nd edition - if you're using the 2.6 kernel.
To the best of my knowledge, the 3rd edition is only available in paperback (not electronically).
Please consider purchasing it. It's worth it. Honest!
PS:
Please consider buying Robert Love's Kernel book, too.
To the extent your personal "time" is worth anything whatsoever, an investment in these two books is a smart - a very smart - investment. IMHO...
Last edited by paulsm4; 10-07-2005 at 09:38 AM.
|
|
|
10-07-2005, 10:29 AM
|
#6
|
Member
Registered: Sep 2004
Location: south texas
Distribution: fedora core 3,4; gentoo
Posts: 192
Rep:
|
Quote:
I believe the free download is the 2nd edition. You do NOT - repeat: do NOT - want the 2nd edition - if you're using the 2.6 kernel.
|
http://lwn.net/Kernel/LDD3/
|
|
|
10-09-2005, 12:34 AM
|
#7
|
LQ Newbie
Registered: Sep 2005
Posts: 5
Original Poster
Rep:
|
Thanks for the Link sirclif. Thats is actually where I downloaded the Third edition of Device Drivers. Pauslm4 check out the link that sirclif provided. Also, I agree it its a good book that is definitely worth the purchase price.
|
|
|
All times are GMT -5. The time now is 12:02 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|