Beginning Kernel Hacking

Link to this post 06 Jul 09

I'm going to be doing some kernel hacking as part of a final year compsci project.

What is the best way of starting this, for instance is there some sort of sandbox mode for running the kernel. My current attempts have been with Arch and slackware linux running in a VM but has proven to be a nightmare.

Where do I start with this?

Link to this post 07 Jul 09

maybe try to recompile the kernel by hand. the best way to do that is to use Gentoo, but they are prepathcing the kernel before put it in the repository. i think you can do this with any other distro.

after that read the code of some modules and try to find bugss or howto abuse them. but be sure that the kernel is not written from newbie programmers.

am not so advanced. it would be interesting to hear the opiniion of the gurus.

Link to this post 11 Jul 09

Gentoo is a good place to start if you want to learn about the kernel. You can also do recompiles in other systems. I would recommend doing a few customizations before you go hacking away at the source code.

Link to this post 15 Jul 09

First, visit and for useful how-tos and other kernel documentation.

Next, don't give up on running your experimental OS in a virtual machine. I have done a fair amount of kernel development for both Linux and Solaris with VirtualBox VM's. The important thing here is that the host needs to be a stable system - I use CentOS/RHEL 5 as my host (8 cores and 8gb ram) and run newer Linux clients (Gentoo, Ubuntu, et al) as well as Windows and Solaris x86 as guests.

Link to this post 24 Jul 09

Actually, in Gentoo, you can get a kernel without any patches.
There are a variety of kernel packages available. Here are 3:

To use the kernel patched by Gentoo:

emerge gentoo-sources

To use the latest released kernel from

emerge vanilla-sources

Or, to use the daily git snapshot from

emerge git-sources

Or, as with any distro, you can just download the tarball from and have fun. Gentoo (potentially) makes it easier because it is required to compile the kernel yourself anyway.

In addition, make sure that you know what areas of the kernel you want to hack at. Honing your focus will help a ton. The kernel is a big piece of code!

Link to this post 14 Aug 09

I would take a look at GoboLinux. GoboLinux uses a kernel patch to hide the traditional filehierarchy's structure. Something that is rather simple like this would be a great start.

You may also want to look at some projects online such as Linux ABI and Longene.

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Linux Training / Board