Book: LPI Linux Certification in a Nutshell
Section: Chapter 5.  Boot, Initialization, Shutdown, and Runlevels (Topic 2.6)



5.1 Objective 1: Boot the System

It is the Linux Loader's (LILO) job to launch a Linux kernel or other operating system at boot time (LILO configuration is described in Section 14.2. In some cases, that task requires the ability to deliver to the Linux kernel certain information, which may be required to configure peripherals. This information is sent using kernel parameters on the LILO command line.

5.1.1 Boot-Time Kernel Parameters

The Linux kernel has the capability to accept information at boot time in the form of a sort of command line. The idea is similar to an argument list in name or name=value forms that might be specified for a program. These values are used to supply the kernel with information that it may not be able to determine on its own. Kernel parameters can also be used to override known values. In either case, they convey vital information to hardware drivers compiled into the kernel.[2]

[2] Boot prompt arguments do not affect kernel modules.

Kernel parameters are entered either in the lilo configuration file or at the LILO prompt. For example, to boot with a root partition other than the one specified in Example 4-1 (see Section 4.3), the user could enter the following at the LILO prompt:

LILO: linux root=/dev/hda9

This command boots the kernel whose label is linux and overrides the default value of /dev/hda1 to /dev/hda9 for the root filesystem.

On the Exam

There are far too many kernel parameters to list in this book. Consequently, you must familiarize yourself with them in general terms so that you can answer questions on their form. Remember that they are specified to LILO after a kernel image name, and that they consist of either a single item, such as ro, or name=value pairs such as root=/dev/hda2. Multiple parameters are space-separated.

There are many boot-time kernel parameters. While unlikely, depending upon your hardware configuration and use of modules, you may need to use these parameters to specify resource settings (such as I/O ports and interrupts) for hardware such as Ethernet or SCSI adapters. For detailed information on these parameters, see the Linux /usr/doc/HOWTO/BootPrompt-HOWTO.

5.1.2 Introduction to Kernel Module Configuration

Modern Linux kernels are modular, in that modules of code traditionally compiled into the kernel (say, a sound driver) are loaded as needed. The modules are separate from the kernel and can be inserted and removed by the superuser if necessary. While parameters in the lilo configuration file and the lilo command line affect the kernel, they do not control kernel modules.

To send parameters to a kernel module, they are inserted into the file /etc/conf.modules ( /etc/modules.conf on some Linux distributions) as text. Common module options you may find in your module configuration file are I/O address, interrupt, and DMA channel settings for your sound device. This file will also probably carry PCMCIA driver information when installed on laptops. Module configuration will probably be handled by your distribution's installation procedure but may require modifications if hardware is added or changed later. Example 5-1 shows a typical /etc/conf.modules file.

Example 5-1. A Typical /etc/conf.modules File
alias scsi_hostadapter aic7xxx 
alias eth0 3c59x 
alias parport_lowlevel parport_pc 
pre-install pcmcia_core /etc/rc.d/init.d/pcmcia start 
alias sound opl3sa2 
pre-install sound insmod sound dmabuf=1 
alias midi opl3 
options opl3 io=0x388 
options opl3sa2 mss_io=0x530 irq=5 dma=0 dma2=1 mpu_io=0x388 
   io=0x370 

On the Exam

Read questions that ask about kernel or module parameters carefully. Kernel options can be passed on the LILO command line; module options are specified in conf.modules.

In this example, note first that an alias named sound is created for the audio driver opl3sa2. Further, you can see that various I/O port, interrupt request (IRQ), and DMA channel settings are specified for that driver. The installer determines the settings. Unless you're aware of a specific parameter or option that needs to be sent to a specific kernel module, you probably won't need to change conf.modules.

5.1.2.1 Kernel boot-time messages

As the Linux kernel boots, it gives detailed status of its progress in the form of console messages.[3] Modules that are loaded also yield status messages. These messages contain important information regarding the health and configuration of your hardware. Generally, the kinds of messages you will see are:

[3] These messages may take users used to other, less verbose, operating systems by surprise due to their detailed nature. You'll learn a lot about your hardware by booting a Linux kernel.

  • Kernel identification

  • Memory and CPU information

  • Information on detected hardware, such as pointers (mice), serial ports, and disks

  • Partition information and checks

  • Network initialization

  • Kernel module output for modules that load at boot time

These messages are displayed on the system console at boot time but often scroll off the screen too fast to be read. The messages are also logged to disk. They can easily be viewed using the dmesg command, which displays messages logged at the last system boot. For example, to view messages from the last boot sequence, simply pipe the output of dmesg to less:

# dmesg | less

It is also common to use dmesg to dump boot messages to a file for later inspection or archive, by simply redirecting the output:

# dmesg > bootmsg.txt

For more information on the Linux kernel, including the compilation and installation of a new kernel and modules, see Chapter 15.

5.1.2.2 Reviewing system logs

In addition to kernel messages, many other boot-time messages will be logged using the syslog system. Such messages will be found in the system log files such as /var/log/messages. For example, dmesg displays information on your network adapter when it was initialized. However, the configuration and status of that adapter is logged in /var/log/messages as a result of the network startup. When examining and debugging boot activity on your system, you need to review both kinds of information. syslog, its configuration, and log file examination are covered in Section 7.3.