Candidates should be able to utilise kernel components that are necessary to specific hardware, hardware drivers, system resources and requirements. This objective includes implementing different types of kernel images, identifying stable and development kernels and patches, as well as using kernel modules.
Key knowledge area:
Kernel 2.6.x documentationKey files, terms and utilities include (amongst others):
/usr/src/linux/usr/src/linux/DocumentationzImagebzImageA kernel can be monolithic or not. A monolithic kernel is a kernel that contains all the driver code needed to use all the hardware connected to or contained within the system you are configuring. Such a kernel does not need the assistance of modules. So why doesn't everyone just build a monolithic kernel and be done with it? The main reason is that such kernels tend to be rather large and often won't fit on a single floppy disk. If the kernel does not fit on a single floppy disk, it poses problems when creating an emergency boot disk. Another reason is that the implementation of a new improved driver for a certain piece of hardware immediately results in the need for a new kernel. This is not the case with modules as will be explained in the section called “Using kernel modules”.
Most of the time, a kernel image is compressed to save space. There
are two types of compressed kerneltypes: zImage and
bzImage.
The
difference between zImage and bzImage
files lies in their different layout and loading algorithms.
For zImage the maximum allowed kernelsize is 520Kb
(see: Johnson01),
bzImage doesn't have this restriction. As a result of this
fact and the increasing size of the linux kernel, the
bzImage kernel now is the preferred image type.
bzImage refers to “big zImage
”, not to “bzip”!A kernel version number consists of three parts: major, minor and the patch level, all separated by periods.
The major release is incremented when a major change in the kernel is made.
The minor release is incremented when significant changes and additions are made. Even-numbered minor releases, e.g. 2.4, 2.6, 2.8, are considered stable releases and odd-numbered releases, e.g. 2.1, 2.3 are considered to be in development and are primarily used by kernel developers.
The last part of the kernel version number is the so-called patch level. As errors in the code are corrected (and/or features are added) the patch level is incremented. You should only upgrade your kernel to a higher patch level when your current kernel has a security problem or doesn't function properly or when new functionality has been added to the kernel.
Linux kernel modules are object files (.ko files) produced by the C compiler but not linked into a complete executable. Kernel modules can be loaded into the kernel to add functionality when needed. Most modules are distributed with the kernel and compiled along with it. Every kernel version has its own set of modules.
Modules are stored in a directory hierarchy under
/lib/modules/kernel-version, where
kernel-version is the string reported by
uname -r, such as 2.6.5-15smp. Multiple module
hierarchies may be available under /lib/modules if
multiple kernels are installed.
Subdirectories that contain modules of a particular type exist
beneath the /lib/modules/kernel-version
directory. This grouping is convenient for administrators,
but also facilitates important functionality to the command
modprobe.
Typical module types:
Modules for a few block-specific devices such as RAID controllers or IDE tape drives.
Device driver modules for nonstandard CD-ROM drives.
Drivers for filesystems such as MS-DOS (the msdos.ko module).
Includes modular kernel features having to do with IP processing, such as IP masquerading.
Anything that doesn't fit into one of the other subdirectories ends up here. Note that no modules are stored at the top of this tree.
Network interface driver modules.
Contains driver modules for the SCSI controller.
Special driver modules for video adapters.
Module directories are also referred to as tags in the context of module manipulation commands.