Kernel Hacking Environment

My personal flavor for Linux Kernel development is Debian. Now for your points:

  1. As you probably guessed Ubuntu doesn't bring anything new to the kernel to ease development afaik, apart from what's already available in Debian. For e.g. make_kpkg is a Debian feature and not Ubuntu. Here are some links to get you started on common Linux Kernel development tasks in Debian:

    • Chapter 4 - Common kernel-related tasks of Debian Linux Kernel Handbook
    • Chapter 10 - Debian and the kernel of The Debian GNU/Linux FAQ
  2. The easiest way to do kernel debugging is using QEMU and GDB. Some links to get you started:

    • http://files.meetup.com/1590495/debugging-with-qemu.pdf
    • http://www.cs.rochester.edu/~sandhya/csc256/assignments/qemu_linux.html

    Though, you should be aware that this method is not viable for certain scenarios like specific hardware issues debugging and such, for which you would be better of using physical serial debugging and real hardware. For this you can use KGDB(it works using ethernet too). KDB is also a good choice. Oh, and by the way, both KGDB and KDB have been merged into the Linux Kernel. More on those two here. Another cool method, which works marvelously for non-hardware related issues, is using the User-mode Linux Kernel. Running the Kernel in user-mode as any other process allows you to debug it just like any other program(examples). More on User-mode Linux here. UML is part of the Linux Kernel since 2.6.0 , thus you can build any official kernel version above that into UML mode by following these steps.

  3. See item 2. Unfortunately there is no ultimate best method here, since each tool/method has its pro's and con's.


If you're developing for an embedded platform that's not based on i386 hardware, you'll need to cross-compile. The Emdebian project provides toolchains to develop for many architectures (ARM, m68k, MIPS and more) on PCs (i386 or amd64). That means under Debian, you can simply add the repositories and apt-get install the toolchain for the target(s) of your choice.


JTAG probes do exist, but these are fairly expensive (and the companies building them have exclusive contracts). The best way to debug kernel code is to start it in kvm or qemu with gdbserver inside the emulation.