LinuxQuestions.org
Help answer threads with 0 replies.
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 10-06-2005, 01:04 PM   #1
jful99
LQ Newbie
 
Registered: Sep 2005
Posts: 5

Rep: Reputation: 0
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.
 
Old 10-06-2005, 03:41 PM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
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
 
Old 10-06-2005, 03:52 PM   #3
linux=future
Member
 
Registered: Apr 2005
Distribution: Debian
Posts: 154

Rep: Reputation: 30
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.
 
Old 10-07-2005, 02:31 AM   #4
jful99
LQ Newbie
 
Registered: Sep 2005
Posts: 5

Original Poster
Rep: Reputation: 0
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.
 
Old 10-07-2005, 09:36 AM   #5
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
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.
 
Old 10-07-2005, 10:29 AM   #6
sirclif
Member
 
Registered: Sep 2004
Location: south texas
Distribution: fedora core 3,4; gentoo
Posts: 192

Rep: Reputation: 30
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/
 
Old 10-09-2005, 12:34 AM   #7
jful99
LQ Newbie
 
Registered: Sep 2005
Posts: 5

Original Poster
Rep: Reputation: 0
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.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Device driver from 2.4 to 2.6 setu_garg Programming 1 09-16-2005 11:27 AM
device driver carthyc Linux - Newbie 1 07-07-2005 07:23 AM
Device Driver deveshs Programming 1 04-26-2005 11:53 PM
device driver rjc915 Programming 4 10-06-2003 11:43 AM
device driver yanw Linux - Hardware 1 01-23-2003 09:00 AM

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

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