Article One (system/core/init/init.c):
Friends interested in Android know that the Android system is built on top of the Linux kernel. So what's the relationship between Linux kernel and Android? How does the Linux kernel boot up android? This article provides a simple description.
Android is built on top of the Linux kernel, but he has some extensions to the kernel, adding some drivers. such as Binder,loger and so on drive. You can compare the Android kernel code with its baseline version. You can see all the Android extensions to the Linux kernel.
A friend familiar with Linux startup knows that after the Linux boot completes, the user-state init process (PID 0) is started, which plays a very important role in the entire system operation, if you do not know about the Init process, please check the relevant information. Init completes the initialization of the system, then enters the shell and receives input from the user.
Android launcher is no mystery, it is to replace the Linux kernel init process with its own INIT process, complete its own initialization work (device, file system, etc. initialization). Then start your own virtual machine, program, and so on stuff. Android Init Process Code is located below system/core/init/init.c, you can go to see its source, to understand the Android launch detailed process. Android launch process of the information online has been more, here will not repeat.
You can see that debugging init is very important during the porting of Android. Because everything that is related to the hardware platform is initialized here, the INIT process may need to be ported or configured. Other processes are hardware-independent and should be able to run without the need for modification in theory.
As can be seen from the above description, the Android init process plays a connecting role. --automatically called by the Linux kernel, init-initializes Android devices and resources, and then launches the Android-related process until the entire Android system is booted.
The relationship between Android and Linux