当前位置: 网学 > 编程文档 > Android > 正文

Android Initialization Process

来源:Http://myeducs.cn 联系QQ:点击这里给我发消息 作者: myeducs.cn 发布时间: 13/03/17

【网学网提醒】:网学会员为您提供Android Initialization Process参考,解决您在Android Initialization Process学习中工作中的难题,参考学习


    AndroidInitializationProcess---Sinkin(jinzhcheng@tom)
    init是内核启动后创建的第一个进程,由相关代码组成:system/core/init/builtins.csystem/core/init/init.csystem/core/init/devices.csystem/core/init/property_service.csystem/core/init/util.csystem/core/init/parser.csystem/core/init/logo.cItdoesthefollowingtasksstepbystep:(以下摘自Steve’sSpace)1.Initializelogsystem.2.Parse/init.rcand/init.%hardware%.rc.3.Executeearly-initactioninthetwofilesparsedinstep2.4.Devicespecificinitialize.Forexample,makealldevicenodein/devanddownloadfirmwares.5.Initializepropertysystem.Actuallythepropertysystemisworkingasasharememory.LogicallyitlookslikearegistryunderWindowssystem.6.Executeinitactioninthetwofilesparsedinstep2.7.Startpropertyservice.8.Executeearly-bootandbootactionsinthetwofilesparsedinstep2.9.Executepropertyactioninthetwofilesparsedinstep2.10.Enterintoanindefinitelooptowaitfordevice/propertyset/childprocessexitevents.Forexample,ifanSDcardisplugined,initwillreceiveadeviceaddevent,soitcanmakenodeforthedevice.Mostoftheimportantprocessisforkedininit,soifanyofthemcrashed,initwillreceiveaSIGCHLDthentranslateitintoachildprocessexitevent,sointheloopinitcanhandletheprocessexiteventandexecutethecommandsdefinedin*.rc(itwillruncommandonrestart).均通过Socket来完成监控。其中用于监控device的Socket是用来监控内核kobject子系统发送的NETLINK_KOBJECT_UEVENT事件The.rcfileisascriptfiledefinedbyAndroid.Thedefaultisdevice/system/rootdir/init.rc.Wecantakealootatthefileformat(device/system/init/readme.txtisagoodoverallintroductionofthescript).Basicallythescriptfilecontainsactionsandservices.Actions------Actionsarenamedsequencesofcommands.Actionshaveatriggerwhichisusedtodeterminewhentheactionshouldoccur.Whenaneventoccurswhichmatchesan
     action'strigger,thatactionisaddedtothetailofato-be-executedqueue(unlessitisalreadyonthequeue).Eachactioninthequeueisdequeuedinsequenceandeachcommandinthatactionisexecutedinsequence.Inithandlesotheractivities(devicecreation/destruction,propertysetting,processrestarting)"between"theexecutionofthecommandsinactivities.Actionstaketheformof:on...Services-------Servicesareprogramswhichinitlaunchesand(optionally)restartswhentheyexit.Servicestaketheformof:service[]*

网学推荐

免费论文

原创论文

浏览:
设为首页 | 加入收藏 | 论文首页 | 论文专题 | 设计下载 | 网学软件 | 论文模板 | 论文资源 | 程序设计 | 关于网学 | 站内搜索 | 网学留言 | 友情链接 | 资料中心
版权所有 QQ:3710167 邮箱:3710167@qq.com 网学网 [Myeducs.cn] 您电脑的分辨率是 像素
Copyright 2008-2015 myeducs.Cn www.myeducs.Cn All Rights Reserved
湘ICP备09003080号