I'm interested in using the RPi to teach myself hardware level programming. I've searched the internet for some tutorials for RPi but all I find are general "how to compile the kernel" tutorials. I'm more interested in actual "how to write kernel code/device drivers"-type tutorials. Are there specific tutorials for RPi, or would any *nix tutorial for hardware level programming suffice?

  • Posible duplicate of Is there a collection of teaching materials?
    – Jivings
    Jul 25 '12 at 19:41
  • 2
    @Jivings: The suggested duplicate doesn't address either part of my question. Elinux and CAS doesn't seem to have anything about RPi kernel programming while GPIO programming barely scratches the surface of writing drivers. Additionally, there is no mention in the suggested duplicate of RPi vs. general *nix tutorials.
    – Jakub
    Jul 25 '12 at 19:54

I don't think you'll find a better resource than this unless you know somebody personally.


P.S. In case the link dies, the book is called Linux Device Drivers.

  • This does look very good, I've always been a fan of the O'Reilly series.
    – Jakub
    Jul 26 '12 at 15:56
  • So I take it that driver programming in the Linux kernel will transfer pretty easily to Raspbian?
    – Jakub
    Jul 26 '12 at 16:03
  • Raspbian is basically just a smaller Debian distribution compiled with special parameters specific to the hardware on the Raspberry Pi. So yes it should, though I am not an expert on either driver programming nor the Raspberry Pi so let's wait for someone more knowledgeable to chime in.
    – NickHalden
    Jul 26 '12 at 16:11
  • Seems very outdated (Kernel 2.6 and from 2009). Anything more up-to-date? Jan 15 '13 at 11:56

I have just found something from the University of Cambridge.

It's easy to follow and very well made introduction how to put your first OS together: http://www.cl.cam.ac.uk/freshers/raspberrypi/tutorials/os/

  • WOW! :) This is brilliant!
    – gideon
    Jun 13 '13 at 5:16

In addition to the LDD book, you may also look at the training course documents at free-electrons.com. There all the course materials are open sourced. Quite suitable for who has started a little bit into linux kernel programming, or who is looking for deeper and wider understanding of specific topics/areas.

To start with, you may look at least the first two courses:

And don't forget the lxr source code cross-reference site on free-electrons.com, where you can check source code for various kernel versions.

If you favor an IDE especially NetBeans or Eclipse, and know how to run perl scripts and Makefile, you may look at my project Nbk tools on github.com. The script enables you to fully index a kernel project with NetBeans C++ kit. It greatly helps improve the experience to understand more of the source code internal structures and relations. I usually make a minimal configuration of the kernel plus the specific device I'm looking at, and make a build and do an index in NetBeans just for analyzing the kernel code. While do the actual development in another project. This script is tested directly in NetBeans, but with Eclipse the idea would be the same (you need to modify the script to suit Eclipse).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.