first, the general operating system startup process:Different processor and hardware systems use different boot strategies, so the specific boot process will vary. However, regardless of the difference, from a computer system point of view, the startup process is generally divided into three steps:
Power on and execute bootloader program----> OS kernel initialization----> Execute First application Approximate process: 1, boot, system power, at this time the hardware circuit will produce a definite reset timing,ensure that the CPU is the last device to be reset; 2, when the reset is completed correctly, the CPU starts to execute the first instruction, the memory address of the instruction is different from the CPU, but it must be fixed. This address is specified by the producer of the CPU. The programs stored in this fixed address are often made:"Boot Program" (Boorloader), because its role is to load the real user program, 3, how to load this program, is a strategic problem, loading mode is diverse. However, regardless of which interface is mounted on the hardware, the loading process must provide the following information, including:• Where to read the user program? • What is the length of the user program? • When the user program is loaded, where should you jump to, that is, where is the user program's execution entry? 4, execute the kernel program: Initialize a variety of hardware, and then establish a variety of internal data structures, these data will be multi-threaded scheduling and memory management, etc. 5, run home program: such as Windows under the Desktop, Linux under the terminal;The above is a general operating system from the perspective of analysis of the Linux boot process, below, specifically, the Linux kernel used by Android boot process.
second, the Android system of the Linux kernel boot process:because the current Android system runs on top of the ARM processor, the following is the main analysis of the Linux boot process on the ARM processor. let's start by distinguishing three concepts: ARM, processor, CPU(1) ARM: A microprocessor core architecture, (2) Processor: A general term, can refer to a specific CPU chip, which contains CPU, on-chip memory, on-chip peripheral interface and other different hardware logic, so strictly speaking, the processor is not equivalent to the CPU; (3) The CPU:CPU is internal to the processor.Central processing UnitThe CPU can be classified by typeShort instruction set architectureAndLong instruction set architectureTwo major categories. Arm is part of the short instruction set architecture.
Process:
Arm Reset--executes a small piece of the program on its on-chip ROM (i.e., bootloader)--loads the Uboot or FastBoot program (initializes the hardware device, provides some debugging capabilities) --
Loading the Linux kernel--Kernel initialization
boot steps for the Linux kernel
During the Linux kernel boot process, there is a
init.rcFile, this file can be extracted from the system root in the Android phone using the adb pull command.
./adb pull/init.rc ~/desktopThe content format of init.rc is similar to a script, but it is not a standard Linux script, but a script that is only used for startup. For its full format, refer to Linux related documentation.
Linux Learning Journey (ii)---linux boot process