Introduction to the Android system startup process

 Android system startup

1, "Introduction to the Android System Startup Process"

2, "Android init process startup process"

3. "Android zygote process startup process"

4. "Android SystemServer Process Startup Process"

5. "Android launcher startup process"

6. "Detailed Explanation of Android Activity Startup Process"

Android System Development Preparation

1, "Android Source Code Download and Compilation"

2. "Android 11 source code compilation and pixel3 flashing"

3. "Android Framework Code IDE Loading and Debugging"

Android System Development Practice

1. "Android Setting Default Input Method"

2, "android framework prefabricated APK application"

3. "Detailed Explanation of Restricting Apps from Starting at the Android System Level"

4. "Android compiles the framework module separately and pushes it"

5. "Android Framework Development System Problem Analysis"

Android System Development Core Knowledge Reserve

1, "Android Compilation System - envsetup and lunch code articles"

2. "Android Compilation System - Concept"

3. "Detailed Explanation of Android Log System"

4. "Android System Handler Detailed Explanation"

5. "Android System Binder Detailed Explanation"

6. "Detailed Explanation of the Relationship between Activity, View and Window in Android"

7. "Detailed Explanation of the Android View Drawing Process"

8. "Detailed Explanation of Android Reading System Attributes"

9. "Detailed Explanation of Android Window Management Mechanism"

10. "Acquaintance with Android System"

11. "The communication method of AMS process in android notifying Zygote process fork new process"

Detailed explanation of Android core functions

1. "Android application market click to download APK installation details"

2, "Android gesture navigation (swipe from bottom to top to enter the multitasking page)"

3. "Android Gesture Analysis (Swipe left to right on the application interface to exit the application)"

4. "Detailed Explanation of Android Application Installation Process"

5, "android11 ​​installation application triggers desktop icon refresh process"

6. "Detailed Explanation of Android System Multitasking Recents"

7. "Android System Navigation Bar View Analysis"

———————————————————————————————————————————

Table of contents

1. Basic concepts

Second, start the process


1. Basic concepts

        The android system is based on linux, and the startup is roughly divided into the following stages,

illustrate:

1, BootRom->BootLoader->Linux Kernel->Init->Zygote->SystemServer->Apps
2, BootLoader layer: mainly includes Boot Rom and Boot Loader
3, Kernel layer: mainly Android kernel layer
4, Native layer: mainly It includes the init process and its forked user space daemon process, HAL layer, boot animation, etc.
5. JAVA Framework layer: mainly the initialization of services such as AMS and PMS
6. Application layer: mainly refers to the startup of SystemUI and Launcher
 

Second, start the process

        The overall architecture diagram is as follows, the picture comes from Gityuan,

    1. After the mobile phone is turned on, the boot chip starts, the boot chip starts to execute from the preset code solidified in the ROM, loads the boot program to the RAM, the bootloader checks the RAM, initializes hardware parameters and other functions.
    2. After the hardware and other parameters are initialized, enter the Kernel layer. The Kernel layer mainly loads some hardware device drivers, initializes process management and other operations. In the Kernel, first start the swapper process (pid=0), which is used to initialize process management, internal management, load Driver and other operations, and then start the kthread process (pid=2), the kernel process of these linux systems, kthread is all kernel processes the originator of.
    3. After the Kernel layer is loaded, the hardware device driver interacts with the HAL layer. Operations such as initialization process management will start the INIT process, which is in the Native layer.
    4. After the init process (pid=1, the init process is the originator of all processes, the first to start) starts, it will start user daemon processes such as adbd and logd, and will start important services such as servicemanager (binder service manager), and incubate at the same time Out of the zygote process, this belongs to the C++ Framework, and the code is a C++ program.
    5. The zygote process is generated by fork after the init process parses the init.rc file. It will load the virtual machine and start the System Server (the first process hatched by zygote); the System Server is responsible for starting and managing the entire Java Framework, including ActivityManager and WindowManager , PackageManager, PowerManager and other services.
    6. At the same time, zygote will start related APP processes. The first APP process it starts is Launcher, and then it starts Email, SMS and other processes. All APP processes are generated by zygote fork.
 

Guess you like

Origin blog.csdn.net/allen_xu_2012_new/article/details/130699710