Question

I need to convert myself from a high-level OOP programmer to a kernel device driver programmer. So i must somehow learn low level stuff ( e.g. advanced bit manipulation and stuff ), Linux kernel plus device driver programming.

This is my new job, so my only option is to comply.

A list of books or tutorials will be much appreciated.

Thanks.

Was it helpful?

Solution

For an introduction http://www.tldp.org/LDP/lkmpg/2.6/lkmpg.pdf . Others may be

  • Linux Device Drivers, 3rd Edition - Jonathan Corbet,
  • Linux System Programming: Talking Directly to the Kernel and C Library - Robert Love,
  • Understanding the Linux Kernel - Daniel P. Bovet.

OTHER TIPS

Learn C. I mean really learn, not just how to make something work, but understand pointers inside out, be able to know what complex expressions do, type promotions etc.

And in parallel just start working on it. Learning by experiencing usually works very well. Maybe try a simple driver that just exports something through sysfs, and then the same with procfs, debugfs, device file. Issues with multiple readers/writers ... there's always some scenario you can make up and then try to solve it.

Get hold of a target machine

Reading books alone is not enough, the best way would be to get a target board (I prefer Raspberry Pi) to load and test the kernel that you will be compiling, the driver that you will be writing.

Among other things, following are the best resources on the internet:

  • LWN - Has articles on linux kernel features, some of them wriiten by the original authors of those features
  • Linux Journal - A magazine of linux kernel tools and features
  • LXR - Online indexed Linux source code
  • Mailing lists - Subscribe to one of the linux kernel mailing lists that relates to what you would be working on to stay updated

And these are very valuable resources for linux kernel information:

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top