Gettinng started with Linux drivers

Amit Uttamchandani auttamchandani at
Fri Apr 10 22:04:12 UTC 2009

I come from a python background and recently I've been wanting to start
writing drivers for Linux. I looked at several different resources (A
bunch of docs written by GKH, JCorbet, and etc.) and they have been of
great help. However, I have some questions which were not really
answered. Any help would be greatly appreciated.

 1. I am familiar with C but have never really written a driver. What
are the guidelines? Meaning, what are best practices on how to write
these drivers. Specifically, what should go in header .h files and what
should not (Maybe that's more related to generic C programming...).
When is it appropriate to place them in /usr/include instead of the
driver folder.

 2. What about debugging drivers? I have read a bunch of docs talking
about gdb, kdbg, etc. But again what are best practices here?

 3. How do I know if a driver has already been written? Right now, I
simply do a grep -R trying to match several device name strings.

 4. Tips on how to get started? I have read several example drivers but
are there any 'platinum' class drivers that you can recommend that is
clear and that you recommend regularly to beginners. (Specifically
networking phy drivers in my case.)

I apologize if these questions have been answered/asked before.

Thanks for any help.


More information about the devel mailing list