【Java精品源码栏目提醒】:文章导读:在新的一年中,各位网友都进入紧张的学习或是工作阶段。
网学会员整理了Java精品源码-【精品】Android启动过程分析 - 其它资料的相关内容供大家参考,祝大家在新的一年里工作和学习顺利!
Android 启动过程Key bootup componentsBootloader系统引导Bootloader 是 Android 系统加电运行的第一个程序,这只是 android 的外围程序,主要是在加载 linux 内核之前做些低级别的系统初始化工作。
在启动用户空间的应用程序之前,系统内核负责硬件、驱动和文件系统等一系列模块和组件的初始化工作。
The first program which runs on any Android system is the bootloader. Technically the bootloader isoutside the realm of Android itself and is used to do very low-level system initialization beforeloading the Linux kernel. The kernel then does the bulk of hardware driver and file systeminitialization before starting up the user-space programs and applications that make up Android.第一阶段的系统引导过程包括装载恢复镜像,或进行其他的系统恢复、更新和调试任务。
Often the first-stage bootloader will provide support for loading recovery images to the system flashor performing other recovery update or debugging tasks.The bootloader on the ADP1 detects certain keypresses which can be used to make it load arecovery image second instance of the kernel and system or put the phone into a mode where thedeveloper can perform development tasks fastboot mode such as re-writing flash images directlydownloading and executing an alternate kernel image etc.init初始化A key component of the Android bootup sequence is the program init which is a specializedprogram for initializing elements of the Android system. Unlike other Linux systems embedded orotherwise Android uses its own initialization program. Linux desktop systems have historicallyused some combination of /etc/inittab and sysV init levels - e.g. /etc/rc.d/init.d with symlinks in/etc/rc.d/rc.2345. Some embedded Linux systems use simplified forms of these -- such as the initprogram included in busybox which processes a limited form of /etc/inittab or a direct invocation ofa shell script or small program to do fixed initialization steps.The init program processes two files executing the commands it finds in them called init.rc andinit.ltmachine_namegt.rc where ltmachine_namegt is the name of the hardware that Android isrunning on. Usually this is a code word. The name of the HTC1 hardware for the ADP1 is trout andthe name of the emulator is goldfish.the init.rc file is intended to provide the generic initialization instructions while theinit.ltmachine_namegt.rc file is intended to provide the machine-specific initialization instructions.init resourcesThe syntax for these .rc files is documented in a readme file in the source tree. See the Android initlanguage referenceOr see also: http://www.kandroid.org/android_pdk/bring_up.htmlSee also http://www.androidenea.com/2009/08/init-process-and-initrc.htmlSequence of boot steps on ADP1firmwarefirst-stage bootloader runsit detects if a special key is held and can launch the recovery image or the fastboot bootloadereventually a kernel is loaded into RAM usually with an initrdnormally this will be the kernel from the kernel flash partition.kernelthe kernel bootscore kernel initializationmemory and I/O areas are initializedinterrupts are started and the process table i