You should compile your kernel with only the elements you need. The more that is left out, the faster the whole system will run. For example, if there is no sound card, sound card support can be removed from the kernel. By removing unneeded devices, you will:
- Decrease the size of the kernel.
- Provide a modest increase in speed for the devices that are present.
- Make more hardware resources available for other hardware such as network cards, disk controllers, and so on.
- Reduce the risk of hardware limits, such as those that may be based on the size of the compressed kernel.
Generally, it is a good idea to have device drivers compiled as modules for any equipment that you may add in the near future. For example, if you may use your Linux computer as a router, you will need a second network card, and you can add support for that card to your kernel. For example, if you have a 3Com 3c595 network card installed but you also have some 3Com 3c905 cards in storage, it may be a good idea to include the 3c905 module. That way, you can simply swap in the new card and let the module load, causing minimum downtime.
Modules are kernel extensions. They are not compiled directly into the kernel but can be plugged in and removed as needed. When configured as a module, a hardware failure such as that of a network card will not cause the whole system to fail.
Kernel Concepts
You will need to understand some basic kernel concepts before you can compile your own kernel. Kernels can be organized as one big unit or as a lot of interconnected pieces. Kernels are called up by boot loaders when you start your system.
Monolithic Versus Modular
A monolithic kernel is a kernel in which all the device modules are built directly into the kernel. Modular kernels have many of their devices built as separate loadable modules. Monolithic kernels can communicate with devices faster, since the kernels can talk to the hardware only indirectly through a module table. Unfortunately, the typical monolithic kernel is huge, which reduces available RAM. In addition, some systems just can’t boot a kernel that’s too large.
Linux once had problems loading modular kernels for some hardware. What a monolithic kernel, the drivers are already there and are often more appropriate for certain components such as embedded hardware.
A modular kernel has greater flexibility. You can compile almost all drivers as modules, and then each module can be inserted into the kernel whenever you need it. Modules keep the initial kernel size low, which decreases the boot time and improves overall performance. If Linux has trouble loading a kernel module, you can use the modprobe or insmod command to load modules as needed, and add those options to the /etc/modprobe.conf file.
Updating the Kernel
Updating the kernel is not as difficult as it looks. You should never overwrite or upgrade an existing kernel, as mistakes happen. New kernels are handled by installing the newly built kernel in /boot and then adding another boot option to your boot loader configuration file (/boot/grub/grub.conf) for the new kernel.
If you install the new directly from a Red Hat configured RPM, it updates the boot loader automatically.
If you do make a drastic mistake and the kernel does not boot, you can simply reboot the system and select the old kernel from the GRUB menu. You should also save existing kernel configuration files so that you have a template for newer kernels. This is discussed in more detail later in future posts.
Other RHEL Kernels
There are a number of different kernels included with the RHEL installation files. You can and should install the kernel best suited to your system. Available RHEL 5 kernels are briefly discussed below. For the real versionnum, run the uname -r command. To verify your arch, or architecture (such as i686), run the uname -m command. As described in the table, there are different versions of kernel devel, kernel PAE, kernel xen, and kernel headers packages for each supported architecture.
- kernel-versionnum.i686 - Designed for PCs with a single Intel/AMD CPU; also works with dual-core systems.
- kernel-versionnum.ia64 - Designed for Itanium2 systems.
- kernel-devel-versionnum - Installs drivers and other information to help compile third-party drivers.
- kernel-PAE-versionnum - If you have more than 4GB of RAM, install the PAE kernel associated with your CPU architecture.
- kernel-PAE-devel-versionnum - If you have more than 4GB of RAM, install the PAE kernel associated with your CPU architecture.
- kernel-headers-versionnum - Includes kernel headers; often sufficient for drivers.
- kernel-versionnum.src.rpm - Includes the source code for the RHEL kernel.
The list provides just a short list of kernel packages available for RHEL 5. It does not include Xen-related kernels. For more information on RHEL kernels available for multi CPU or higher-end CPUs, refer to the RHEL documentation available online from www.redhat.com/docs/manuals/enterprise/.

0 comments:
Post a Comment