Chapter8.Booting the Kernel


Chapter 8. Booting the Kernel

In this chapter

  • 8.1 BIOS and Open Firmware 423

  • 8.2 Boot Loaders 424

  • 8.3 Architecture-Dependent Memory Initialization 431

  • 8.4 Initial RAM Disk 456

  • 8.5 The Beginning: start_kernel() 456

  • 8.6 The init Thread (or Process 1) 517

  • Summary 522

  • Exercises 523

So far, we presented the subsystems of the Linux kernel and the structures central to their operation. Every chapter has assumed that the subsystem was up and running, and we focused on the typical kernel subsystem management and handling operations. However, each subsystem must be initialized before it can be used. This initialization occurs during the kernel bootup, which is a process that begins after the bootloader finishes loading the kernel image into memory and passes processing control to it.

We chose to follow the kernel initialization process in the linear order in which it occurs. We begin with a discussion of what happens on power-on through to the call to the first architecture-independent function, start_kernel(), and follow the process up to the invocation of /sbin/init. Figure 8.1 illustrates the order of events from system power on to power off.

Figure 8.1. Kernel Inception and Boot Process


We begin with a discussion of BIOS and Open Firmware, which is the first code that runs in the x86 and PPC systems upon power on, respectively. This is followed by a discussion of bootloaders commonly used with Linux and how they load the kernel and pass execution control to it. We then discuss in detail the step known as kernel initialization, where all the subsystems are initialized. The end of the kernel initialization is marked by the call to /sbin/init by process 1. The init program continues on with what is known as system initialization by enabling processes that need to be running before users can log in.

It soon becomes obvious that part of the nature of kernel initialization consists of interleaved subsystem bring-up. This makes it difficult to follow the initialization of a given subsystem from start to end without being interrupted. However, following the linear order of the Linux kernel bootup allows us to trace the setup of kernel subsystems as they occur and illustrates the complexity of the bootstrapping process.

We refer to many of the structures introduced in previous chapters because this is where these structures are first brought up and initialized. We begin by looking at the first step: BIOS and Open Firmware.




The Linux Kernel Primer. A Top-Down Approach for x86 and PowerPC Architectures
The Linux Kernel Primer. A Top-Down Approach for x86 and PowerPC Architectures
ISBN: 131181637
EAN: N/A
Year: 2005
Pages: 134

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net