What does the Android phone system do from the moment the power button is pressed?

  1. Boot Loader loading phase

The Boot Loader is the first to load after the physical power is pressed. Most of the devices will run some manufacturer-defined initialization codes at this stage, such as starting Clock, RAM, Media, etc., and provide support for loading Recovery Image and Download Mode. The Boot Loader is also divided into multiple stages, and we will not discuss it in detail here.

  1. Load the Kernel and initrd stages

The Boot partition loads the Linux kernel and initrd to RAM, and finally jumps to the Kernel to continue to complete the boot.

  1. Initialize device service phase

The Android kernel will start all necessary services for Android system devices, such as initializing Memory, initializing IO, memory protection, interrupt handlers, CPU scheduling, device drivers, and finally mounting the file system and starting the first user process init.

  1. load system service phase

init is the first process in the user space in the Linux system, its process PID is 1, and the parent process is process 0 of the Linux Kernel core. init has a special initialization mission, it will load an initialization startup script file init.rc, start some core services of the Android system, such as rild for calls, mtpd for VPN connections, provide adb related functions adbd, and support storage peripherals vold for hot-plug function, Zygote for process incubation service, Service Manager, etc.

  1. Virtual machine initialization phase

The Zygote process started will create the Dalvik VM, start the first Java component system service, and finally the AndroidFramework service, such as Telephone Manager, Activity Manager, Window Manager, and Package Manager.

  1. start-up phase

When the system is fully started, load Home ((desktop application), and then do some application layer initialization work, such as playing a global broadcast ACTION_BOOT_COMPLETED.

Guess you like

Origin blog.csdn.net/qq_41100456/article/details/130111356