ARM Fast Models and Android 12 Boot Stuck at Initialization
When attempting to boot an Android 12 image on ARM Fast Models, the system often gets stuck during the initialization phase. This issue is particularly prevalent when using the Fast Models Base RevC-2xAEMvA with the Android Open Source Project (AOSP) branch android-12. The user in the discussion followed the Fast Models User Guide to compile the AOSP, generate the necessary image files (ramdisk.img, system.img, and myimage.img), and configure the Fast Models parameters. However, the boot process halts at an early stage, indicating potential issues with the Android image or the configuration of the Fast Models environment.
The primary symptom is that the system does not progress beyond the initial boot screen, as shown in the provided screenshot. This suggests that the bootloader or the kernel is unable to proceed, possibly due to missing or misconfigured components. One critical missing component identified is the uefi-vars.fd
file, which is required for running Android under AARCH64 on Fast Models. The absence of this file can prevent the system from initializing the UEFI environment, which is essential for booting modern operating systems like Android.
Missing UEFI Variables and Image Configuration Errors
The root cause of the boot issue lies in the incomplete configuration of the Android image and the Fast Models environment. Specifically, the absence of the uefi-vars.fd
file is a significant barrier. This file contains the UEFI variables necessary for the system to initialize the UEFI firmware, which is responsible for loading the operating system. Without these variables, the UEFI firmware cannot properly initialize, leading to a stalled boot process.
Additionally, the Android image itself may be improperly configured. The Fast Models User Guide provides instructions on how to prepare the Android image, but the process is complex and prone to errors. For instance, the user must ensure that the ramdisk.img
and system.img
are correctly generated and combined into myimage.img
. Any deviation from the correct procedure can result in an image that is incompatible with the Fast Models environment.
Another potential issue is the configuration of the Fast Models parameters. The user’s command includes several parameters that configure the behavior of the Fast Models, such as bp.secure_memory=0
and cache_state_modelled=0
. While these settings are intended to optimize the simulation, they may also introduce issues if not properly aligned with the Android image’s requirements. For example, disabling secure memory or cache state modeling can lead to unexpected behavior in the Android kernel, which expects these features to be available.
Generating UEFI Variables and Correcting Image Configuration
To resolve the boot issue, the first step is to generate the uefi-vars.fd
file. This file can be created using the UEFI firmware provided by ARM, which is typically included in the Fast Models package. The process involves running the UEFI firmware in a simulated environment and saving the generated variables to a file. The following steps outline the procedure:
-
Download the UEFI Firmware: Ensure that the UEFI firmware is available in the Fast Models package. If not, download it from the ARM website or the Fast Models documentation.
-
Run the UEFI Firmware in Fast Models: Use the Fast Models to run the UEFI firmware. This can be done by configuring the Fast Models to boot from the UEFI firmware image instead of the Android image. The command to do this might look like:
./FVP_Base_RevC-2xAEMvA --plugin=../../plugins/Linux64_GCC-9.3/Sidechannel.so -C bp.secureflashloader.fname=uefi_firmware.bin
Replace
uefi_firmware.bin
with the actual filename of the UEFI firmware. -
Save the UEFI Variables: Once the UEFI firmware is running, it will generate the necessary variables. These variables need to be saved to a file named
uefi-vars.fd
. The exact method for saving these variables depends on the UEFI firmware version and the Fast Models configuration. Refer to the UEFI firmware documentation for detailed instructions. -
Configure Fast Models to Use UEFI Variables: After generating the
uefi-vars.fd
file, configure the Fast Models to use this file during the boot process. This can be done by adding the following parameter to the Fast Models command:-C bp.uefi_vars.fname=uefi-vars.fd
Next, ensure that the Android image is correctly configured. Follow these steps to verify and correct the image configuration:
-
Verify the AOSP Build: Ensure that the AOSP build is correctly compiled for the
aosp_arm64-eng
target. This involves running thelunch aosp_arm64-eng
command and then building the AOSP using themake
command. Any errors during the build process should be addressed before proceeding. -
Generate the Correct Image Files: The
ramdisk.img
andsystem.img
files must be correctly generated and combined intomyimage.img
. The Fast Models User Guide provides instructions on how to do this, but it is crucial to follow each step carefully. Any deviation can result in an incompatible image. -
Check Fast Models Parameters: Review the Fast Models parameters to ensure they are correctly configured for the Android image. Pay particular attention to parameters that affect memory and cache behavior, as these can significantly impact the boot process. For example, ensure that
bp.secure_memory
andcache_state_modelled
are set to values that are compatible with the Android kernel. -
Test the Configuration: After making the necessary adjustments, test the configuration by running the Fast Models with the updated parameters. Monitor the boot process to ensure that it progresses beyond the initial screen. If the system still gets stuck, review the logs generated by the Fast Models for any error messages or warnings that could indicate the cause of the issue.
By following these steps, the boot issue with the Android 12 image on ARM Fast Models can be resolved. The key is to ensure that all necessary components, such as the uefi-vars.fd
file, are correctly generated and configured, and that the Android image is properly prepared for the Fast Models environment. With these adjustments, the system should be able to boot successfully, allowing for further development and testing of the Android image on ARM Fast Models.