Init.c
1. Initialize the properties (including setting up A/dev,/proc directory, initialize properties, execute action in initialization files such as init.rc, etc.).
2. The command to process the configuration file (primarily the init.rc file), including handling various actions.
3. Performance analysis (using the Bootchart tool).
4. Infinite loop Execution command (start other processes).
Storing init.c files in ramdisk.img
Property_init ();
1.import/init.${ro.hardware}.rc import additional configuration files.
2. Loading the Default.prop file
3. Create the attribute memory area on the shared memory (Init_workspace ()) and map to the local process space.
4. When the property server receives a client request Uevent=pollin
Executive HANDLE_PROPERTY_SET_FD ()
(setprop ctl.start bootanim command to perform the boot animation.)
5. Client send request (PROPERTIES.C)-"Property_set ()
Get_hardware_name (Hardware, &revision);
Get the value of the hardware field in the Open/proc/cpuinfo file (lowercase)
It is not difficult to see that the hardware field value obtained is used in import/init.${ro.hardware}.rc.
Process_kernel_cmdline ();
The Import cmd command sets the properties of the application-tier profile through the properties of the kernel.
Init.rc
1. Contents of the file:
On Init:section Init
On boot:section Boot
...
Class_start Defult This is a command, corresponding function Do_class_start
Service is also a section
2. Functions that parse the section:
Parse_new_section (State,kw,nargs,args);
K_service:
Parse_service (state, Nargs,args);
Service->classname= "Default";
Android Init Correlation