Processors
Processors
Optimizing the Linux* Kernel for the Intel(R) Pentium(R) 4 processor

The Linux* kernel is a complex program which provides the underlying services to the rest of a Linux distribution. But it is easy to add new features or improvements to it.

It is common practice with a Linux based operating system to recompile the kernel from. One of the reasons that you would do this is to optimize the kernel for a particular processor such as the Pentium 4 processor so that it can utilize features that would normally not use, resulting in faster performance. Other reasons is to add support for certain hardware devices. Note: To get the most out of the Intel Pentium processor, you should use the 2.4 kernel or higher.

There are four basic steps to rebuild the kernel:

  • Configure the kernel
  • Compile the kernel
  • Install the kernel
  • Reconfigure the lilo.conf file and execute lilo
Configure the kernel
  1. Change into the kernel version directory where version represents the version of the Linux kernel.

    Example:

    cd /usr/src/linux-2.4.2

  2. Run one of the Linux Kernel Configuration Tools:

    • make xconfig (X Window based)
    • make menuconfig (Menu based)
    • make config (text based)
  3. Select Processor type and features. If you are using version 2.4 of the kernel, select the Pentium® 4 processor. Exit and save the changes Note: the kernel has many, many options. You have to reconfigure and recompile the kernel to enable certain hardware and to enable certain features

    When you compile the kernel, you are converting a high-level language such as C language to machine language that can be understood by the processor. In Linux, this is know as a binary. To compile the kernel, you would do the following:

    make dep

    make clean

    make bzImage

    make modules

    These can be combined into a single command:

    make dep;make clean;make bzImage;make modules

    The make bzImage is the actual compiling of the kernel

  4. Next, you have to copy the appropriate files so that Linux can boot from the new kernel:

    cp /usr/src/kernelversion/arch/i386/boot/bzImage /boot/vmlinuz-kernelversion

    cp /usr/src/kernelversion/System.map /boot/System.map-kernelversion

  5. After the kernel is installed, you will need to install the modules by executing the following command:

    make modules_install

  6. The /etc/lilo.conf file is a text file provides the boot menu and tells which kernel to boot from. Assuming that the kernel images are in /dev/hda1 (first hard drive, first partition), you would insert the following lines in the /etc/lilo.conf file:

    image=/boot/vmlinuz-kernelversion

    label=Linuxnew

    root=/dev/hda1

    read-only

  7. To make the new kernel boot by default, make sure to change the default line to:

    default=/boot/vmlinuznew

  8. Execute the following command at a command prompt:

    Lilo

    Make sure there are no errors that appear

  9. Reboot system

This applies to:

Intel® Pentium® 4 Processor Extreme Edition
Intel® Pentium® 4 Processors



Solution ID: CS-012822
Last Modified: 16-Nov-2009
Date Created: 30-Jun-2004
Back to Top