• Embed Doc
  • Readcast
  • Collections
  • CommentGo Back
Download
Linux Kernel Internal
Kernel
What is Kernel?

This is a term for the computing elite, so proceed at your own risk. To understand what a kernel is,
you first need to know that today's operating systems are built in "layers." Each layer has different
functions such as serial port access, disk access, memory management, and the user interface itself.
The base layer, or the foundation of the operating system, is called the kernel. The kernel provides
the most basic "lowlevel" services, such as the hardwaresoftware interaction and memory
management. The more efficient the kernel is, the more efficiently the operating system will run.
The Basic Responsibilities of Kernel :

Process Management
\u2022
Memory Management
\u2022
Device Management
\u2022
System Calls
\u2022

How to compile Linux Kernel ?
1. Download kernel sources You can download the latest Linux kernel sources at www.kernel.org.
Now put your kernel sources at /usr/src/. As root, unpack the tarball, and then make (or change) the
symbolic link to it as
ln s linux2.4.xx linux
2. Preparation \u2013 Gather the information about your system.
3. Configuration
This is the most difficult part for kernel compilation. To start configuration, change to /usr/src/linux
and type make menuconfig or make xconfig . If you have previously configured the kernel,
the configuration is saved in a file .config . You can load in this file to start your configuration
based on what you have done last time.
For each item, there is a help that you should look at. There some thing that you need to notice
when select each item.

Compile the support for your hard disk controller and your native file system (ext2) into
\u2022
kernel. Don't compile them as modules.
You can select EXT3 Journaling file system support as a module. See the result of
\u2022
lsmod.
You should select MS dos fat fs support and vfat (windows) fs support as modules if
\u2022
you mount a windows partition.
Be sure to compile sound card support as a module. If not, you can't use sndconfig
\u2022
to configure your sound card later.
You can select support for USB as a module. And you should select 'y' to enable
\u2022

preliminary USB device file system.
4. Compile kernel and modules
After you are done with kernel configuration, use the following command to compile the kernel.

make dep
make clean

make bzImage
The new kernel is named bzImage, and it is stored at /usr/src/linux/arch/i386/boot/bzImage. The
current kernel is normally /boot/vmlinuz. You should copy the new kernel to the /boot directory
and give a new name. For example
cp /usr/src/linux/arch/i386/boot/bzImage /boot/vmlinuz2.4.xx
Don't forget to compile and install the modules. You can do it by

make modules
make modules_install

5. Configure grub or lilo, the boot loader
To boot the new kernel you should add a new entry to grub or lilo, depending on which you are
using. To do it, edit the file /etc/grub.conf or /etc/lilo.conf.
For example, in /etc/grub, you can add the following entry. (suppose you just compiled the kernel

version 2.4.17)
title Red Hat Linux (2.4.17)
root (hd0,1)

kernel /boot/vmlinuz2.4.17 ro root=/dev/hda2
Now you can reboot your machine and select to boot the new kernel at the menu of grub or lilo. If
new kernel cannot boot correctly, you can press ctrl+alt+del to reboot and select the old

kernel for troubleshooting.
Booting of Kernel:
BIOS selects the boot device.
\u2022
BIOS loads the boot sector from the boot device.
\u2022
Boot sector loads setup, decompression routines and compressed kernel image.
\u2022
The kernel is uncompressed in protected mode.
\u2022
Lowlevel initialization is performed by asm code.
\u2022
Highlevel C initialization.
\u2022
of 00

Leave a Comment

You must be to leave a comment.
Submit
Characters: ...
You must be to leave a comment.
Submit
Characters: ...