Home arrow Help Docs arrow Compiling kernel-I
Main Menu
Help Docs
Gnu/Linux Distros
Aaj Ka Tip
Aaj Ka Command
Free Software

Compiling kernel-I Print E-mail
Powering a Personal Desktop Using A Customized Linux 2.6 kernel

How to Implement Linux for an Enterprise Server? This question has been answered very well and the results have been great since we have various enterprise editions for servers which are optimized for better performance.

But how do we go about optimizing a Desktop running on Linux? This question has not been answered so well. One of the main features of the optimized versions of the Linux Distributions for the servers has been the optimized kernel.

Designing the kernel
With the launch of the new Linux kernel 2.6, the performance of Linux operating systems have increased by leaps and bounds but the kernel that is distributed with the Linux distributions is a generic kernel .i.e. it fulfills the requirements of many types of system configurations (it has support for all types of hardware including the video, audio, file system etc) while designing a kernel for ones personal needs these options can be brought down. We can choose to build a kernel which has support for only our hardware and use that kernel to give us better performance.
The options that we choose in our kernel can be saved in .config files, which can be used later. Linux distributions include the .config file of the generic kernel that they provide.
It is always good to build a kernel from a .config file that has been provided along with the kernel in our Linux distribution, this way the success rate of building a kernel can be increased,.  since it not possible for a user at the beginner or moderate level to choose the correct options from the kernel configuration .
What we can do is, open up the .config file of a kernel from out Linux distributor that has been working in our system and try to strip it down i.e. minimize the options our kernel works with.

While choosing a particular option we can choose it to be either built directly into the kernel or in modules. Modules are not built directly into the kernel; they are kept in a different directory in the operating system. These can be loaded on demand i.e. that can be loaded when they are required .So going by the above rule we included support for only those options that were deemed most important, directly in our kernel and the less frequently used ones as modules.

The first step towards building the kernel is to identify the system hardware
The details of the following should be known before compiling a kernel:
1. Video card
2. Sound card
3. Processor type
4. ATAPI/IDE devices
5.  File systems
6.Networking Protocols
7.Devices such as PCI,PCMCIA USB ,SCSI if any
8.Type of input devices such as Mouse ,keyboard, joystick

For more information on the type of hardware, run “lspci -vš.

The major part where the kernel can be striped down and tuned is in the following sections

# Processor type and features
       Choose the correct processor and other features include a                                       preemptible/nonpreemptible kernel (recommended preemptible)

# Power management options (ACPI, APM)
       Many of the options here are for Laptops, so choose the one required for your           system.

# Bus options (PCI, PCMCIA, EISA, MCA, and ISA)
       PCI cards can be left in t configuration while PCMCIA cards are for laptops, so u       does not need them either

       # PCI Hotplug Support
       These cards are also rare in desktops so check out for these too

# Device Drivers
       # Memory Technology Devices (MTD)
               These are also rare, and I am sure that I do not have any of these

       # Parallel port support
               # IEEE 1394 (FireWire) support
                       Required in laptops
       # Block devices
               Choose the correct block devices that you need

       # ATA/ATAPI/MFM/RLL support
               Choose the correct type of IDE/ATAPI device that you have

       # SCSI support type (disk, tape, CD-ROM)
               Most of the desktops do not have this, so can be safely removed

       # Old CD-ROM drivers (not SCSI, not IDE)
               Depends on the system configuration
       # Multi-device support (RAID and LVM)
               Can be safely removed

       # IEEE 1394 (FireWire) support
               Depends on the system configuration (generally in laptops)

       # networking support
               Choose the correct type of support your network hardware (Ethernet                      10/100/1000 Ambit, Token ring, Wan, Wireless interfaces etc) along with                 technology and protocols you want to use, like ATM, IPX, Bridges IPV6           etc.

               # IrDA options
               # Infrared-port device drivers
                       Can be removed
               # Bluetooth device drivers
                       Can be used a module (may be required for future use)

       # ISDN
               This can also be removed if you so not have an ISDN connection

       # Input device support
               Choose the correct input device support (Mouse, keyboard, joystick etc)

       # Character devices
               Character devices and watchdogs are rare so can remove then if u does not               have that

       # Sound
               Choose the correct sound driver that your system has (ISA, PNP PCI                      cards)

       # USB support
               Choose the USB device that you have
               It will be safer to keep these options in modules you may need them at                  later stage

# File systems
       Choose the File system that you wish to use .EXT2 (Linux native) support is too         built in the kernel, other file system support van be kept in modules. Remove the       ones you so not wish to keep. Also choose the Charset for the file systems              (Charset for VFAT is iso-8859-1)
       Also choose the Network File system, partition types for your system.

# Kernel hacking
       Choose this option if you wish to develop drivers for Linux

Linux 2.6 kernel has exhaustive features, the above mentioned points can only help to sort out some of these, as we get more and more acclimatized with our systems working and our enhanced kernel, subsequent revision of the kernel will lead to a leaner and a better performing kernel.
Some points to remember while designing the kernel are:

Do not forget to keep the support for the File systems that you are running.
It always a good point to read the help statements provided with the kernel source.
Also never overwrite the working kernel since that might be required if the newer kernel fails.
Use module option for those support which may be required ,this way you do need to compile yourself a new kernel each time and keeping the size of the kernel image smaller.

The resulting kernel obtained will be smaller in size, fast and optimized to the user needs. I have compiled the kernel for about a no. of times and today I am using a kernel which is giving me an excellent performance according to my needs.
< Previous   Next >

Join Us
About Us
Contact Us
Support Us
Login(only for dev.)

Royalty Free Images

O'Reilly User Group discount!

Powered By GIMP GIMP
Contact Webmaster Copyleft 2011 gnulinuxclub.org