The bootup of an Android system consists of several phases, which are outlined here.
- On the ADP1, there are multiple versions of the bootloader
- mount root file system
A key component of the Android bootup sequence is the program 'init', which is a specialized program for initializing elements of the Android system. Unlike other Linux systems (embedded or otherwise), Android uses its own initialization program. (Linux desktop systems have historically used some combination of /etc/inittab and sysV init levels - e.g. /etc/rc.d/init.d with symlinks in /etc/rc.d/rc.). Some embedded Linux systems use simplified forms of these -- such as the init program included in busybox, which processes a limited form of /etc/inittab, or a direct invocation of a 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' and 'init.<machine_name>.rc', where <machine_name> is the name of the hardware that Android is running on. (Usually, this is a code word. The name of the HTC1 hardware for the ADP1 is 'trout', and the name of the emulator is 'goldfish'.
the 'init.rc' file is intended to provide the generic initialization instructions, while the 'init.<machine_name>.rc' file is intended to provide the machine-specific initialization instructions.
The syntax for these .rc files is documented in a readme file in the source tree. See the Android init language reference
Sequence of boot steps on ADP1
- first-stage bootloader runs
- it detects if a special key is held, and can launch the recovery image, or the 'fastboot' bootloader
- kernel is loaded
- kernel boots
- core kernel initialization
- driver initialization
- user space starts
- kernel runs /init
- /init processes /init.rc and /init.rc.<machine_name>
- activity manager is run
- dalvik VM is started (zygote)
- kernel runs /init
- activity manager starts core applications
- com.android.phone - phone application
- android.process.acore - home (desktop) and a few core apps.
- other processes started by /init:
Tools for analyzing Android Bootup
- Bootchart - see Using Bootchart on Android
Notes on the Android startup procedure
See "Android Initialization Process" at: http://blog.chinaunix.net/u2/85805/showart_1421736.html
Interaction of different processes on application initialization
Talking about Android Process - http://blog.csdn.net/mawl2002/archive/2009/06/24/4295905.aspx