Reprint Please specify source: http://blog.csdn.net/droyon/article/details/38022887
The Linux boot process is broadly divided into three steps: 1, boot bootloader. 2. Initialization of operating system kernel. 3. Execute the first application.
1, the power-on is to the hardware equipment on the electricity, the role of the CPU in the power-up process execution, so, only the other hardware device initialization ok,cpu Execution instructions are meaningful, so the CPU finally power on.
After the CPU resets, the program instructions for fixed memory are executed, and the program that executes is called the "bootloader" boot program. used to load the user program. The mount requires an application address.
2, kernel initialization. In addition to bootloader thought of the program, the CPU appears to be the user program. Therefore, the kernel program at this point is the application in the previous step. From the software point of view, can be divided into "kernel programs", applications.
The role of the kernel program is to initialize a variety of hardware, including memory, network interfaces, monitors, input devices and so on. After executing these kernel programs, you start executing the application.
3, the first application is the home program. is launcher, used to manage a variety of apps. Launcher provides a portal to launch other applications.
The Linux architecture used by Android:
1, the processor reset completed, the implementation of read-only ROM area of the program, this program is bootloader. This program loads the application from the processor's pin-low status. For example: USB port, serial port, SD card, and mouth flash and so on.
Most will begin loading the program from the 0x00000000 address in the NAND flash chip. For small embedded systems, this program is the final program to execute. But for Android, the program in this address is not an Android application, just a uboot or fastboot program that initializes the hardware device. such as the network port. also provides a brush machine (kernel burn-write, upgrade) is to write new data to NAND flash.
when Uboot executes, some specific keys are detected, which are uboot pre-agreed at compile time and are used to enter debug mode. For example: Power key + volume down key. If the user does not press these keys, Uboot will skip loading debug mode and enter NADN Flash to load the kernel program. The mount address is specified by Uboot.
2. After the Linux kernel has been loaded, the kernel initialization is performed.
The Android kernel will load the Init.rc file and initialize the application based on this script file.
To start with, the Android kernel starts the process, and for Linux, Android is just one of its applications. Application contains many processes, the first application process of Android system is zygote, this process is the Linux process based on the above init.rc configuration information started. Zygote is a central process that will hatch other application processes that contain each of our apk's processes.
The zygote process mainly consists of two modules. 1. Socket server: command to accept and start the new Dalvik process. each APK process is a new Dalvik virtual machine process, and we can develop an Android application directly using a Java program identified by the Dalvik virtual machine. 2. The framework shares classes and resources. Loads the classes and resources defined by the preload-classes,preload-resources.
Zygote is the first Android process with an application named: App_process, located under System/bin. Zygote is the first application that hatches the first application called System Server and also runs in app_process.
Framework startup process for Android apps