Android Init Correlation

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.