How To Compile A Kernel – The CentOS Way
Version 1.0
Author: Falko Timme <ft [at] falkotimme [dot] com>
Last edited 11/23/2006
Each distribution has some specific tools to build a custom kernel from the sources. This article is about compiling a kernel on CentOS systems. It describes how to build a custom kernel using the latest unmodified kernel sources from www.kernel.org (vanilla kernel) so that you are independent from the kernels supplied by your distribution. It also shows how to patch the kernel sources if you need features that are not in there.
I have tested this on CentOS 4.4.
I want to say first that this is not the only way of setting up such a system. There are many ways of achieving this goal but this is the way I take. I do not issue any guarantee that this will work for you!
How To get A centos Kernel source
1. Maybe you do not need the full kernel source
If you need to compile a kernel driver module, the chances are you do not really need the full kernel source tree. You might just need the kernel-devel package. (If, however, you are certain that the full source tree is required, please follow the instructions in Section 2.)
In CentOS-5, there are three kernel-devel packages available:
- kernel-devel (both 32- & 64-bit architectures)
- kernel-xen-devel (both 32- & 64-bit architectures)
- kernel-PAE-devel (32-bit architecture only)
In CentOS-4, there are four kernel-devel packages available:
- kernel-devel (both 32- & 64-bit architectures)
- kernel-smp-devel (both 32- & 64-bit architectures)
- kernel-xenU-devel (both 32- & 64-bit architectures)
- kernel-hugemem-devel (32-bit architecture only)
- kernel-largesmp-devel (64-bit architecture only)
If you are running the standard kernel (for example), you can install the kernel-devel package by:
Anatomy of the Linux kernel
http://www.ibm.com/developerworks/linux/library/l-linux-kernel/
History and architectural decomposition
M. Tim Jones (mtj@mtjones.com), Consultant Engineer, Emulex Corp.
The Linux® kernel is the core of a large and complex operating system, and while it’s huge, it is well organized in terms of subsystems and layers. In this article, you explore the general structure of the Linux kernel and get to know its major subsystems and core interfaces. Where possible, you get links to other IBM articles to help you dig deeper.
Given that the goal of this article is to introduce you to the Linux kernel and explore its architecture and major components, let’s start with a short tour of Linux kernel history, then look at the Linux kernel architecture from 30,000 feet, and, finally, examine its major subsystems. The Linux kernel is over six million lines of code, so this introduction is not exhaustive. Use the pointers to more content to dig in further.