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.

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值