Booting process of Android devices explained
The booting process of Android devices starts at the power-on of the SoC (system on a chip) and ends at the visibility of the home screen, or special modes like recovery and fastboot. The boot process of devices that run Android is influenced by the firmware design of the SoC manufacturers.
Background
As of 2018, 90% of the SoCs of the Android market are supplied by either Qualcomm, Samsung or MediaTek.[1] Other vendors include Rockchip, Marvell, Nvidia and previously Texas Instruments.
History
Verified boot, a booting security measure, was introduced with Android KitKat.[2]
Stages
Primary Bootloader
The Primary Bootloader (PBL), which is stored in the Boot ROM[3] is the first stage of the boot process. This code is written by the chipset manufacturer.[4]
The PBL verifies the authenticity of the next stage.
On Samsung smartphones, the Samsung Secure Boot Key (SSBK) is used by the boot ROM to verify the next stages.[5]
On SoCs from Qualcomm, it is possible to enter the Qualcomm Emergency Download Mode from the primary bootloader.
If the verification of the secondary bootloader fails, it will enter EDL.[6]
Secondary Bootloader
Because the space in the boot ROM is limited, a secondary bootloader on the eMMC or eUFS is used.[7] The secondary bootloader initializes TrustZone.[8]
On the Qualcomm MSM8960 for example, the Secondary Bootloader 1 loads the Secondary Bootloader 2. The Secondary Bootloader 2 loads TrustZone and the Secondary Bootloader 3.[9]
The SBL is now called XBL by Qualcomm and uses UEFI to be cross compatible for booting operating systems other than Android in the second stage.
Aboot
Qualcomm uses Little Kernel, MediaTek uses Das U-Boot. Little Kernel is a microkernel for embedded devices, which has been modified by Qualcomm to use it as an Android bootloader.[10] The Android Bootloader (Aboot), which implements the fastboot interface (which is absent in Samsung devices). Aboot verifies the authenticity of the boot and recovery partitions. By pressing a specific key combination, devices can also boot in recovery mode. Aboot then transfers control to the Linux kernel.
Kernel and initramfs
See also: Booting process of Linux. The initramfs is a gzipped cpio archive that contains a small root file system. It contains init, which is executed. The Android kernel is a modified version of the Linux kernel. Init does mount the partitions. dm-verity verifies the integrity of the partitions that are specified in the fstab file. dm-verity is a Linux kernel module that was introduced by Google in Android since version 4.4. The stock implementation only supports block based verification, but Samsung has added support for files.
Zygote
Zygote is spawned by the init process, which is responsible for starting Android applications and service processes. It loads and initializes classes that are supposed to be used very often into the heap. For example, dex data structures of libraries. After Zygote has started, it listens for commands on a socket. When a new application is to be started, a command is sent to Zygote which executes a fork system call.
Partition layout
The Android system is divided across different partitions.[11]
The Qualcomm platform makes use of the GUID partition table. This specification is part of the UEFI specification, but does not depend on UEFI firmware.[12]
See also
External links
Notes and References
- Book: Garri. Khireddine. Kenaza. Tayeb. Aissani. Mohamed. 2018 International Conference on Smart Communications in Network Technologies (SaCoNeT) . A Novel approach for bootkit detection in Android Platform . October 2018. http://dx.doi.org/10.1109/saconet.2018.8585583. 277–282. IEEE. 10.1109/saconet.2018.8585583. 978-1-5386-9493-0. 56718094.
- Web site: Android Verified Boot [LWN.net]]. live. 2021-09-25. LWN.net. https://web.archive.org/web/20150422212411/http://lwn.net:80/Articles/638627/ . 2015-04-22 .
- Book: Yuan. Pengfei. Guo. Yao. Chen. Xiangqun. Mei. Hong. 2018 6th IEEE International Conference on Mobile Cloud Computing, Services, and Engineering (MobileCloud) . Device-Specific Linux Kernel Optimization for Android Smartphones . March 2018. https://ieeexplore.ieee.org/document/8350440. 65–72. 10.1109/MobileCloud.2018.00018. 978-1-5386-4879-7. 13742883.
- Hay. Roee. 2017-08-14. fastboot oem vuln: android bootloader vulnerabilities in vendor customizations. Proceedings of the 11th USENIX Conference on Offensive Technologies. WOOT'17. Vancouver, BC, Canada. USENIX Association. 22.
- 2018-03-01. Forensics acquisition — Analysis and circumvention of samsung secure boot enforced common criteria mode. Digital Investigation. en. 24. S60–S67. 10.1016/j.diin.2018.01.008. 1742-2876. Alendal. Gunnar. Dyrkolbotn. Geir Olav. Axelsson. Stefan. 11250/2723051. free.
- Web site: 2018-01-22. Exploiting Qualcomm EDL Programmers (1): Gaining Access & PBL Internals. 2021-09-13. alephsecurity.com. en.
- Book: Yuan. Pengfei. Guo. Yao. Chen. Xiangqun. Mei. Hong. 2018 6th IEEE International Conference on Mobile Cloud Computing, Services, and Engineering (MobileCloud) . Device-Specific Linux Kernel Optimization for Android Smartphones . March 2018. http://dx.doi.org/10.1109/mobilecloud.2018.00018. 65–72. IEEE. 10.1109/mobilecloud.2018.00018. 978-1-5386-4879-7. 13742883.
- Book: Kanonov. Uri. Wool. Avishai. Proceedings of the 6th Workshop on Security and Privacy in Smartphones and Mobile Devices . Secure Containers in Android . 2016-10-24. http://dx.doi.org/10.1145/2994459.2994470. SPSM '16. 3–12. New York, NY, USA. ACM. 10.1145/2994459.2994470. 9781450345644. 8510729.
- Book: Tao, Chen, Yue Zhang, Yulong Wang, Zhi Wei. Downgrade Attack on TrustZone. 2017-07-17. 1106269801.
- Book: Tang, Qinghao. Internet of things security: principles and practice. 2021. Fan Du. 978-981-15-9942-2. Singapore. 166. 1236261208.
- Alendal. Gunnar. Dyrkolbotn. Geir Olav. Axelsson. Stefan. March 2018. Forensics acquisition — Analysis and circumvention of samsung secure boot enforced common criteria mode. Digital Investigation. 24. S60–S67. 10.1016/j.diin.2018.01.008. 1742-2876. 11250/2723051. free.
- Book: Zhao. Longze. Xi. Bin. Wu. Shunxiang. Aizezi. Yasen. Ming. Daodong. Wang. Fulin. Yi. Chao. Proceedings of the 2nd International Conference on Computer Science and Application Engineering . Physical Mirror Extraction on Qualcomm-based Android Mobile Devices . 2018. http://dx.doi.org/10.1145/3207677.3278046. Csae '18. 1–5. New York, New York, USA. ACM Press. 10.1145/3207677.3278046. 9781450365123. 53038902.