What will init do?
· Init creates the zygote.
· Init supply property service to manage theproperty of android.
· Init will wait for some events, especially forsocket and property service.
It has two files---init.rc and configure file for hardware.
This is the init.rc part:
It will call parse_config to analyze.
Parse_config will find one section to analyze theconfigurations.
1. Key words define
First time Define some functions, just as do_class_start. Anddefined one enum, just as K_class, K_mkdir
Second time define keyword_info struct. This struct storethe key info contains the key name, process function, process arguments, andproperty.
When symbol on or service, this means the section.
KEYWORD(ON, SECTION,0 , 0)
KEYWORD(SERVICE, SECTION,0, 0)
2. ANALYZE THE SERVICE OF ZYGOTE.
3. Init control the service.
Start the zygote.
In init.rc has one command:
Class _start default.
It will call do_class_start.
Property service
Property_init :
Create one area (32768 byte) for storing property, and loadthe default.prop
For share the property, the system need to do two steps:
1. Create one share memory,
2. Android use gcc’s constructor.
Start property service.
The user part can change the property by the propertyservice.