The boot process is a chain of actions starting from the boot ROM, followed by the Bootloader, Kernel, Init, Zygote, and System Server (bold indicates Android-specific boot process). In the automotive-specific boot process, early services such as rearview camera must start during the Kernel boot.
|1||Boot ROM||Loads the first stage of the boot loader into internal RAM.|
|2||Bootloader||Inits memories, verifies for security, and loads kernel.|
|3||Kernel||Sets up interrupt controllers, memory protection, caches and scheduling, launches user space processes||Rearview Camera (RVC) process starts early in kernel boot. After the process is up, GPIO from VMCU triggers RVC to show on display.|
||Vehicle HAL (VHAL) starts during init phase as part of core services. Can be moved to earlier states depending on ServiceManager; requires removing dependencies on shared libraries (such as init).|
|5||Zygote||Sets up Java runtime and init memory for Android objects.|
|6||System Server||First Java component in the system, starts core Android services.||CarService starts after all system services are started.|
Optimizing boot time
To improve boot time in your system, use the following guidelines:
Kernel. Load only the modules in use and initialize only the hardware components in use.
- Watch for blocking operations (service compared to command invocation).
- Start only what is used.
- Setting correct priority for services.
Zygote. Class preloading optimization (specify the list of classes to load).
Optimize product image to include only APKs in use.
System Server. Start only the system services that are used.
For help with optimization, Google provides the following tools:
packages/services/Car/tools/bootanalyze/bootanalyze.pyto analyze logcat and dmesg logs.
packages/services/Car/tools/bootio/to record I/O for processes during the boot. You must compile the kernel with specific flags (refer to the
Starting services early
In the boot sequence, some services may start before Android starts to boot.
The rearview camera (RVC) should be handled in the kernel. The VMCU notifies the native kernel
process when the vehicle shifts into Reverse, after which the native kernel process displays the
RVC image onto the display. The vehicle HAL can control the RVC using
Vehicle HAL (VHAL)
Some systems may need to read and buffer CAN data (for example, vehicle speed, gear status) during the early stages of the boot sequence while waiting for the user-space service to start (which occurs later in the boot sequence). This scenario requires VNS and the HAL and CAN controllers to start very early, typically within a few seconds.
Systems that can quickly mount
/systemcan simply launch service manager then VNS early.
System that cannot quickly mount
/systemmust move both service manager and VNS to the kernel boot image and link all dependent libraries statically.