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.
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.)
- Download the source code
- Configure the build
- Compile the kernel
- Put the kernel and its modules in the right place
- Make an initial ramdisk
- 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!