Starting March 27, 2025, we recommend using android-latest-release
instead of aosp-main
to build and contribute to AOSP. For more information, see Changes to AOSP.
Manage boot time
Stay organized with collections
Save and categorize content based on your preferences.
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 (RVC) must start during the kernel boot.
Order |
Component |
Android |
Android Automotive |
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. |
4 |
Init process |
Parses init.rc scripts, mounts file systems, launches Zygote, launches
system process. |
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. |
Optimize 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.
-
init.rc
- 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).
-
Package Manager
-
System server. Start only the system services that are used.
For help with optimization, Google provides the following tools:
-
Use packages/services/Car/tools/bootanalyze/bootanalyze.py
to analyze logcat and
dmesg logs.
-
Use 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 README.md
file).
Start services early
In the boot sequence, some services might start before Android starts to boot.
Rearview camera
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
hardware/libhardware/include/hardware/vehicle_camera.h
.
Vehicle HAL (VHAL)
Some systems might 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 /system
can simply launch service manager then
VNS early.
-
System that can't quickly mount /system
must move both service manager and VNS
to the kernel boot image and link all dependent libraries statically.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-08-29 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-29 UTC."],[],[],null,["# Manage boot time\n\nThe boot process is a chain of actions starting from the boot ROM, followed by the bootloader,\nkernel, **Init** , **Zygote** , and **system server** (bold\nindicates Android-specific boot process). In the automotive-specific boot process, early services\nsuch as rearview camera (RVC) must start during the kernel boot.\n\n| Order | Component | Android | Android Automotive |\n|-------|---------------|----------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| 1 | Boot ROM | Loads the first stage of the boot loader into internal RAM. ||\n| 2 | Bootloader | Inits memories, verifies for security, and loads kernel. ||\n| 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. |\n| 4 | Init process | Parses `init.rc` scripts, mounts file systems, launches Zygote, launches system process. | **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). |\n| 5 | Zygote | Sets up Java Runtime and init memory for Android objects. ||\n| 6 | System server | First Java component in the system, starts core Android services. | **CarService** starts after all system services are started. |\n\nOptimize boot time\n------------------\n\nTo improve boot time in your system, use the following guidelines:\n\n- **Kernel.** Load only the modules in use and initialize only the hardware\n components in use.\n\n- `init.rc`\n\n - Watch for blocking operations (service compared to command invocation).\n - Start only what is used.\n - Setting correct priority for services.\n- **Zygote.** Class preloading optimization (specify the list of classes to\n load).\n\n- **Package Manager**\n\n - Optimize product image to include only APKs in use.\n\n - [Enable DEX\n preoptimization](/docs/core/runtime/configure#compilation_options).\n\n- **System server.** Start only the system services that are used.\n\nFor help with optimization, Google provides the following tools:\n\n- Use `packages/services/Car/tools/bootanalyze/bootanalyze.py` to analyze logcat and\n dmesg logs.\n\n- Use `packages/services/Car/tools/bootio/` to record I/O for processes during the\n boot. You must compile the kernel with specific flags (refer to the `README.md`\n file).\n\nStart services early\n--------------------\n\nIn the boot sequence, some services might start before Android starts to boot.\n\n### Rearview camera\n\nThe rearview camera (RVC) should be handled in the kernel. The VMCU notifies the native kernel\nprocess when the vehicle shifts into Reverse, after which the native kernel process displays the\nRVC image onto the display. The vehicle HAL can control the RVC using\n`hardware/libhardware/include/hardware/vehicle_camera.h`.\n\n### Vehicle HAL (VHAL)\n\nSome systems might need to read and buffer CAN data (for example, vehicle speed, gear status)\nduring the early stages of the boot sequence while waiting for the user-space service to start\n(which occurs later in the boot sequence). This scenario requires VNS and the HAL and CAN\ncontrollers to start very early, typically within a few seconds.\n\n- Systems that can quickly mount `/system` can simply launch service manager then\n VNS early.\n\n- System that can't quickly mount `/system` must move both service manager and VNS\n to the kernel boot image and link all dependent libraries statically."]]