1. Computer System Review
To begin with, we should has a refresher on the skeleton of a computer system, especially the Operating system:
2. Overview of Linux Kernel
What we learn are Linux 0.11, which is a modular, unix-like, monolithic kernel. The major tasks of a kernel includes Process Management, Memory Management, Device Management, supporting System Calls and So forth.
The following picture is the layout of the Linux Source Tree:
3. Booting Procedure
When the computer was tuned on, CPU would jump to memory 0xffff0 (the address of the BIOS), and run a power-on self Tes T (POST) of the BIOS. After this, once a bootale device is found, BIOS would extract the Master Boot Record (MBR) from the first sector (512B) of the hard disk in memory 0x7c00, and then transfer control to the boot loader, the first 446B of the M BR followed by the Partition Table.
GNU GRUB is an operating system independent boot loader. The 1st stage of Grub boot process lies within MBR, and its task was just to load GRUB stage 1.5, which immediately follows MBR and contains file sytem drivers. Then GRUB Stage 2 would be loaded by stage 1.5, and would display boot menu to the user. Finally, GRUB would load the user-selected (or default) kernel into memory and pass on control to the kernel.
Once the kernel have finished all the initialization, it would create the init process (PID = 1), which is the root Of all processes running on Linux. The init process would start various processes according to the Run-level, and typically create instances of "Gett Y "to spawn user ' s shell process. Besides creating more processes, another task of the Init process lies in the system shutdown.
Linux Kernel:introduction and booting