views:

584

answers:

7

I want to code drivers in C in linux os, though I think its very tough. Can I get some hints as to how to start or books to follow? Drivers can be from my USB port to graphics card!!

I know as to where I can search for books, I would like to know as to what the basic knowledge I should start with. Do I need to have hardware knowledge and which specific books are good for novice like me?

+2  A: 

try amazon !! there is many books there for drivers . some have samples 2 !!

eduffy
Why the downvote? I like how the style matches the question's.
aib
Because it's not considered *helpful*, I think.
Roddy
+6  A: 

"Linux Device Drivers" (the O'Reilley book) by Rubini and Corbet is the definitive book for Linux Device Drivers.

Cool! see the free pdf version in Roddy's answer & kristina's comment!

Doug T.
The third edition is also available free online at http://lwn.net/Kernel/LDD3/.
kristina
+15  A: 

Start with Linux Device Drivers by Rubini and Corbet, published by O'Reilly.

It's also available as a free PDF download.

Roddy
Bar none, the only reference required.
Jamie
+2  A: 

Before you jump into designing drivers you should first get exceptional C skills and probably some Linux Kernel know-how. Desigining drivers is not trivial and might scare you off if you are not used to programming on a low-level.

I might recommend The C programming Language if you are not accustomed to C as it is, in my opinion, the primer on C if you have some programming background.

tr9sh
Solid C skills are certainly a good idea, but there's nothing scary about kernel and driver development. The stakes are just higher when you make a mistake. :-)
Steve Madsen
+4  A: 

Several texts:

Stephen Johnson
A: 

Just look at the source codes of current drivers. I wrote my usb rndis driver by only reading the comments put above the codes.

Get the kernel source and look at /drivers directory. Usb drivers are in usb directory, however usb drivers about networking are resided in /net/usb.

You can learn lots by reading the comments.

ercu
+1  A: 

you have here a really good example

http://www.linuxjournal.com/article/7353

Night Walker