That is a perfectly legitimate question, and one I would have asked myself in the early stages of learning Linux.
The kernel is the interface between the Linux Operating System and your computer hardware. It contains, and allows you to specify the loading of, all the hardware drivers. If it all works correctly, your software (applications) will be able to function as intended. Remember Windoze, Plug 'n' Pray, and all those messages about not being able to find suitable drivers in the specified location? Well, this is the same thing for Linux, but thankfully presented in a more controllable fashion. And you control it!
The second part of the question (why change the kernel?) is also simply answered. When you start up (boot) your system, the initialization processes "look" at all the hardware you are trying to address, and make intelligent guesses as to the correct drivers and options to use. Maybe the guesses are inappropriate (as can often be the case with new hardware and laptop configurations). To get your hardware working correctly, it is sometimes necessary to "tweak" the kernel configuration options. This is not the easiest thing in the world to do, as you will see later in the current section...
Red Hat 8.0 ships with a custom kernel, including support for the ext3 journaling file system and USB devices. Correct operation depends on a RAM disk (/dev/initrd) being initialized (e.g. loaded) by the boot loader before the kernel is started. Misconfiguration of any of these items will on the Toshiba laptop leave you with a nightmare situation: a computer that is unable to read from some or all of the following - hard disk, USB floppy disk, IDE-SCSI CD-ROM... Worse still, you will not be able to connect to external devices via serial, PCMCIA or ethernet ports.
Unfortunately, these aspects of modern laptop "design" are not well covered in the many FAQs and HOW-TOs relating to kernel modification. Nor are the quirks of Red Hat 8.0! That is why it is REALLY important to make a recovery CD as described below, and to back up all your data before starting any of this.
Please be sure to create an emergency boot CD, if you do not already have one. (A conventional boot floppy will not work with RH8.0 on this PC). There are various ways of creating a bootable CD, but the easiest method I have found is to use the "disaster recovery" utility mkcdrec:
All of the following instructions assume that you are logged in as root. Bear in mind it is possible to do a lot of damage if you enter a command incorrectly, so please take your time.
You must have the Red Hat kernel-source package installed. Check by doing:
$ rpm -q -a | grep kernel-sourceand you should see "kernel-source-2.4.18-x", where 2.4.18-x is the same version number as the one you get from uname -r. If you do not have kernel-source installed, please download the rpm file from Red Hat and install it before going any further.
The Red Hat Linux 8.0 kernel source tree is referenced by /usr/src/linux-2.4 : this is a symbolic link to the actual kernel directory which is /usr/src/linux-2.4.18-14. The suffix "-14" is the "EXTRAVERSION" of the kernel, indicating that it has been customized by Red Hat from the official 2.4.18 kernel. It is a good idea (indeed, I would say it's essential) to name your own custom versions of the kernel in a similar way. For example, 2.4.18-14test1 would be a good name for your first test version. You can change the "EXTRAVERSION" or customization reference of the kernel by editing a line near the beginning of /usr/src/linux-2.4.18-14/Makefile. In this example, you would change "EXTRAVERSION = -14" to "EXTRAVERSION = -14test1".
Note: If you have not previously installed the NVidia display drivers as detailed elsewhere in this guide, the default EXTRAVERSION will be "-14custom". Just change the "-14custom" part to your own chosen label, like "-14test1".
Staying in the directory /usr/src/linux-2.4.18-14, look for a file named .config and make a backup copy of it somewhere else. Put it in your $HOME directory, if you like. Before you start the new build, it is important that the kernel tree is in a known state. Execute the shell command make mrproper. After this has finished cleaning everything up, you now have two choices:
$ cp configs/kernel-2.4.18-i686.config .configand remember, for it to work, you must be in the directory /usr/src/linux-2.4.18-14 and there should be a symlink from /usr/src/linux-2.4 >> /usr/src/linux-2.4.18-14
There are various tools for doing this, but the easiest in my opinion is the graphics based interface, "xconfig". To start it, type: make xconfig
Then choose the desired kernel options. There is an excellent site which gives advice on correctly setting options for the Toshiba Satellite Pro 6100 - follow this link. Also, take account of any specific configuration requirements that may have been mentioned on the current page, or elsewhere on my site. When you have finished, select the option "Save and exit".
Xconfig will tell you to check the top level Makefile (/usr/src/linux-2.4.18-14/Makefile), so please do it now, and make sure (again) that the EXTRAVERSION is set to what you think it should be...! If you keep it at EXTRAVERSION = -14, the following steps will OVERWRITE your default linux kernel, with possibly catastrophic results.
Everything OK so far? Now comes the really tedious bit - and please do not sit watching all the compilation commands or you will definitely go mad. Find something else to do for the next 2 hours, while keeping half an eye open for compilation errors...
If there are any problems during the above processes, all I can suggest is that you start again from the beginning, and if that fails, do a "Google" search on the error string you are getting. Someone else may have run into the same problem.
Check that you have the relevant vmlinuz, initrd and System Map files in your /boot directory. For example, if your EXTRAVERSION name is -14test1, you should see files with that suffix included in their name.
Now configure your boot loader. I use Grub, for which the relevant configuration file is /boot/grub/grub.conf. Here is an example:
default 0
# Note: default 0 points the boot loader to the first kernel option (default) below. When the splash screen comes up, you have 10 seconds to choose the other option(s)
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/hda2
# initrd /initrd-version.img
#boot=/dev/hda
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
password --md5 *********
title Red Hat Linux default kernel (2.4.18-14)
root (hd0,0)
kernel /vmlinuz-2.4.18-14 ro root=LABEL=/ hdc=ide-scsi
initrd /initrd-2.4.18-14.img
title Red Hat Linux (test config 2.4.18-14test1)
root (hd0,0)
kernel /vmlinuz-2.4.18-14test1 ro root=LABEL=/ hdc=ide-scsi
initrd /initrd-2.4.18-14test1.img
I don't use Lilo as a boot loader for various reasons, but if you prefer Lilo, look at the lilo.conf or lilo.conf.anaconda file (I think it is in the /etc folder) and change as appropriate. You are not allowed long "labels" (equivalent to "title" in Grub) and must not include spaces in them. See examples in this section. Remember to run lilo before rebooting, or you may end up with an unbootable system.
Shut down your computer, say a quick prayer, and re-start.
Good luck!