The startup process of the Linux kernel (uimage format image, Uimage = Zimage_ Compressed kernel image + 0x40 byte size uboot format information header) can be broadly divided into three phases:
First: The Kernel's self-extracting process (assembler + C language Implementation)
Mainly by, arch/arm/boot/compressed to zimage complete decompression, and call Call_kernel jump to the next stage code.
Second: board-level boot phase (assembly implementation)
The main CPU and architecture checks, the initialization of the CPU itself and the establishment of the page table, etc.
Third: General kernel boot phase (C language Implementation: Key analysis)
1. Enter the Init/main.c file, starting with the Start_kernel () function for a series of kernel initialization work, and finally calling the Rest_init () function
2. Create the first kernel thread in the Rest_init () function Kernel_init
3. Initialize various drivers in the Kernel_init () thread, and finally call the Init_post () function
4. Release the initialized memory segment in the Init_post () function, marking the kernel boot complete, and establishing the standard input/standard output/Standard error output, and then try to find a user process init, the process as the first user process of the system, the process number 1.
5. The kernel boot is complete, then the user's thing.