Hardware Device Driver Initialization

When the system boots, several things happen. You have already seen the part that LILO and GRUB play in loading the operating system, but that is only the beginning. These loaders start the Linux kernel running, and then things really begin to happen.

The kernel is the heart of Linux. It loads into memory and initializes the various hardware device drivers. Most of the possible boot prompt arguments are intended to help the kernel initialize hardware, and the messages the kernel displays during startup help you determine what hardware is installed in the system and whether it is properly initialized.

Use the dmesg command to display the kernel startup messages; combine it with the less command or with grep to examine the startup messages more effectively. less allows you to scroll through the messages, one screenful at a time; grep permits you to search for something specific in the dmesg output. For example, combine dmesg and grep to locate kernel messages relating to the initialization of the Ethernet device eth0:

loading device 'eth0'...

eth0: SMC Ultra at 0x340, 00 00 C0 4F 3E DD, IRQ 10 memory 0xc8000-0xcbfff.

This message clearly shows the type of Ethernet adapter used (SMC Ultra) and the Ethernet MAC address assigned to the adapter (00 00 C0 4F 3E DD). Additionally, because the SMC Ultra is an ISA bus adapter, the bus interrupt (IRQ 10), the adapter memory address (0xc8000-0xcbfff), and the I/O port address (0x340) are shown. All of this information is useful for debugging a hardware configuration problem.

Most systems use Ethernet for all network communications, although some use other devices, such as serial ports for this purpose. When the kernel initializes the serial ports, it displays the device name, I/O port address, and IRQ of each serial port. It also displays the model of Universal Asynchronous Receiver Transmitter (UART) that is used for the serial interface. Old systems used 8250 UARTs, which are inadequate for use with modems and a problem for systems that need to run PPP. As this example shows, current systems use the faster 16550A UARTs:

ttyS00 at 0x03f8 (irq = 4) is a 16550A ttyS02 at 0x03e8 (irq = 4) is a 16550A

Also of interest for a network server are the kernel components of TCP/IP. These components include the fundamental protocols, such as IP (Internet Protocol), and the network sockets interface. Sockets is an application protocol interface developed at Berkeley for BSD Unix. It provides a standard method for programs to talk to the network. The TCP/IP initialization messages from a Red Hat 7.2 system are

NET4: Linux TCP/IP 1.0 for NET4.0 IP Protocols: ICMP, UDP, TCP, IGMP

IP: routing cache hash table of 1024 buckets, 8Kbytes TCP: Hash tables configured (established 16384 bind 16384) Linux IP multicast router 0.06 plus PIM-SM NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.

Reading the kernel messages helps you understand what occurs when the system starts up. Don't read these messages word for word—too many details will just bog you down. What you should do is look at the messages to gain a sense of how the system works. Of course, there are slight variations among the messages displayed on various systems, but the messages give you a very good idea of what is going on as the kernel initializes the hardware.

After the kernel concludes its portion of the boot process, the kernel starts the init program, which controls the rest of the startup.

Was this article helpful?

0 0

Post a comment