Compile and run the Linux Kernel

The most obvious first step of my project to better understand the Linux kernel is to compile and run it for myself. It’s not the first time I’ve done this — my first experience was with Linux From Scratch several years ago — but I was still quite intimidated by the process. In actual fact, it turns out to be relatively simple; as I hope to show here.

The Plan

Building the Linux kernel, as with most computer-related tasks, is a step-by-step process. The following lists the work we will be doing. (Explanations of each of these tasks will be given later.)

  1. Download the source code
  2. Configure the build
  3. Compile the kernel
  4. Put the kernel and its modules in the right place
  5. Make an initial ramdisk
  6. Get your bootloader to recognise your new kernel (this link applies only to GRUB users. LILO users will have completed this during the previous step.)

At this stage, assuming everything has gone as it should, then you should be ready to reboot into your new kernel.

Over the next few blog posts, I’ll be covering each of these steps in detail. Each time I do, I’ll add the link to the list above.

I hope you enjoy the exercise!

Leave a comment

One thought on “Compile and run the Linux Kernel