init of android (part of )

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.

 

 

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章