Linux Kernel: Introduction and Booting

 

1. Computer System Review

  To begin with, we should have a refresher on the skeleton of a computer system, especially the Operating System:

 

技术分享

 

 

2. Overview of Linux Kernel

  What we learn here is 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 Linux Source Tree:

技术分享

 

3. Booting Procedure

  When the computer is tuned on, CPU will jump to memory 0xFFFF0 (the address of BIOS), and run a Power-On Self Test (POST) of BIOS. After that, once a bootale device is found, BIOS will extract the Master Boot Record (MBR) from the first sector (512B) of the hard disk into memory 0x7C00, and then transfer control to the boot loader, the first 446B of the MBR 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 is just to load GRUB stage 1.5, which immediately follows MBR and contains file sytem drivers. Then GRUB stage 2 will be loaded by stage 1.5, and will display boot menu to the user. Finally, GRUB will load the user-selected (or default) kernel into memory and pass on control to the kernel.

  Once the kernel has finished all the initialization, it will create the init process (pid = 1), which is the root of all processes running on Linux. The init process will start various processes according to the run-level, and typically create instances of "getty" to spawn user‘s shell process. Besides creating more processes, another task of the init process lies in the system shutdown.

 

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。