How do I start writing device drivers?

I would like to learn how to write device drivers because I think it will be fun. I use a Mac OS X Macbook, but I also have a Ubuntu machine (runs on Mac Min). I am familiar with C and am currently reading this book . I found several links on the web like Mac Dev Center . I do it because it will be fun. I think it would be very nice to see how the equipment works because of the software that I wrote.

I think I would like to get some tips and advice and recommendations, and does anyone know a list of devices that do not have drivers, or I can write a driver for what is already supported (I would prefer the first, so I'm actually providing value ) What a good device to start with? Am I biting more than I can chew? I am not afraid of low level programming or assembly or any kind of effort. I really would like to try it!

+49
c assembly hardware drivers
Feb 08 2018-10-10 at
source share
4 answers

For Linux, you can check out the O'Reilly Linux Device Drivers book or read PDF files on the Internet. In my opinion, this is one of the best texts on this issue.

Linux kernel module programming guide is another good resource.

You can also choose the Linux kernel book. For this purpose I took a copy of Robert Love Linux Kernel Development (2nd Edition) ( 3rd Edition ).

+26
Feb 08 2018-10-10 at
source share

Writing a device driver can be quite simple or can be almost arbitrarily complex. For example, I participated in a project where it took six of us almost three years to solve the ONE problem in a device driver. Of course, we cleared up dozens of other errors looking for it ... the code has improved significantly. The fix turned out to be an eight-line patch, which cost conservatively about a million dollars.

But, as a side project, I wrote the ethernet driver from the chip data sheet a week later and took another week to debug it. No need to touch him since.

You can’t even say how much the driver will work; A GPU driver can cost hundreds of millions, a driver for a single LED costs several hours of work most.

+17
Feb 08 '10 at 10:01
source share

If you want to move on to developing Linux device drivers, the freely available book O'Reilly Linux Device Drivers, Third Edition is a must-read.

To find unsupported hardware for which you can write a driver, ask the Linux mailing lists . Maybe some USB 3.0 device?;)

+4
Feb 08 2018-10-10 at
source share

For Mac, you can take a look at Mac OS X Internals . He thinks and is hard, but interesting to read. These are mostly PowerPC based Macs, but there is an Intel based application. For Linux, take a look at Linux Device Drivers, 3rd Edition - it is lighter (free PDF files online :) and it is really focused on device drivers, it might be better to start.

+1
Feb 08 '10 at 15:57
source share



All Articles