views:

193

answers:

3

I'm getting to the point where, after a year or so, I'm more or less comfortable using Linux (Ubuntu, first 8.04, now 9.04) as my main OS (it helped that the competition was, primarily, Vista). I can't shake the feeling that I should learn more about the workings under the hood.

I'm relatively inexperienced in programming (I can write simple C, C++, Python and Perl -albeit with some hand-holding), but I'd like to start learning how to put together a device driver. Primarily because I'm tempted to buy Apple's new Magic Mouse, and I imagine that there's likely no Linux driver as yet.

I'm happy to use books, websites, magazine articles (if I can get hold of them), but I just wondered if there's anyone out there that has a particular source that helped them get started?

Obviously this is Community Wiki, since it's such a vague and subjective question.

Any and all help, and suggestions, gratefully received. =)

(Also, I accept that writing a driver may be a bit like learning to ride a unicycle before learning to walk, but...I figure that the learning curve should/might be interesting.)

+3  A: 

A large stable of device drivers are critical to mainstream acceptance of Linux. Devices are constantly changing and the Linux community has a strong motivation for making documentation available. A quick google of 'linux device driver help' returns a ton of web resources.

A good start is this short tutorial and this one.

They'll at least let you know what you're in for. This topic is deep enough that I would recommend a book. Some good books include:

  1. Linux Device Drivers, Third Edition book or online as PDF and
  2. Essential Linux Device Drivers

I would consider both of these book "must have's". They are both comprehensive, but you'll find people complaining about different things in both. Look at them first & pick the one you like best.

If you plan to write your drivers for ubuntu, I would also suggest checking out the Ubuntu developer area so that transitioning your work to the rest of the ubuntu community is easier. You might also find that you can get some help from other ubuntu developers.

DaveParillo
+1  A: 

As an introduction, this book seemed to be a good starting point. Practical Linux Programming, its not a concise book, but it does appear to be a good starting point.

monksy
+1  A: 

Besides Linux Device Drivers, Third Edition as suggested earlier, I would also suggest you to take a look at the Linux Kernel 2.6 Programming guide and also Robert Love's Linux Kernel Development. Good Luck!

Amit