Android Booting (Android 引导过程)

Android booting flow introduction 第一阶段:Android设备上电后,首先会从处理器片上ROM的启动引导代码开始执行,片上ROM会寻找Bootloader代码,并加载到内存。(这一步由“芯片厂商”负责设计和实现)第二阶段:Bootloader开始执行,首先负责完成硬件的初始化,然后找到Linux内核代码,并加载到内存。(这一步由“设备厂商”负责设计和实现)第三阶段:Linux内核开始启动,初始化各种软硬件环境,加载驱动程序,挂载根文 阅读详情

原文网址


Android Booting

The bootup of an Android system consists of several phases, which are outlined here.

Contents

  [hide]

Key bootup components

Bootloader

The first program which runs on any Android system is the bootloader. Technically, the bootloader is outside the realm of Android itself, and is used to do very low-level system initialization, before loading the Linux kernel. The kernel then does the bulk of hardware, driver and file system initialization, before starting up the user-space programs and applications that make up Android.

Often, the first-stage bootloader will provide support for loading recovery images to the system flash, or performing other recovery, update, or debugging tasks.

The bootloader on the ADP1 detects certain keypresses, which can be used to make it load a 'recovery' image (second instance of the kernel and system), or put the phone into a mode where the developer can perform development tasks ('fastboot' mode), such as re-writing flash images, directly downloading and executing an alternate kernel image, etc.

'init'

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.[2345]). 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 Android '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.

'init' resources

The syntax for these .rc files is documented in a readme file in the source tree. See the Android init language reference

Or, see also: http://www.kandroid.org/android_pdk/bring_up.html

See also http://www.androidenea.com/2009/08/init-process-and-initrc.html

Sequence of boot steps on ADP1

firmware

  • first-stage bootloader runs
    • it detects if a special key is held, and can launch the recovery image, or the 'fastboot' bootloader
  • eventually, a kernel is loaded into RAM (usually with an initrd)
    • normally, this will be the kernel from the 'boot' flash partition.

kernel

  • the kernel boots
    • core kernel initialization
      • memory and I/O areas are initialized
      • interrupts are started, and the process table is initialized
    • driver initialization
    • kernel daemons (threads) are started
    • root file system is mounted
    • the first user-space process is started
      • usually /init (note that other Linux systems usually start /sbin/init)

user space

  • the kernel runs /init
    • /init processes /init.rc and /init.<machine_name>.rc
    • dalvik VM is started (zygote). See Android Zygote Startup
    • several daemons are started:
      • rild - radio interface link daemon
      • vold - volume daemon (media volumes, as in file systems - nothing to do with audio volume)
  • the system_server starts, and initializes several core services
  • the activity manager starts core applications (which are themselves dalvik applications)
    • com.android.phone - phone application
    • android.process.acore - home (desktop) and a few core apps.
  • other processes are also started by /init, somewhere in there:
    • adb
    • mediaserver
    • dbus-daemon
    • akmd

Tools for analyzing Android Bootup

01-01 00:00:08.396 I/boot_progress_start(  754): 12559
01-01 00:00:13.716 I/boot_progress_preload_start(  754): 17879
01-01 00:00:24.380 I/boot_progress_preload_end(  754): 28546
01-01 00:00:25.068 I/boot_progress_system_run(  768): 29230
01-01 00:00:25.536 I/boot_progress_pms_start(  768): 29697
01-01 00:00:25.958 I/boot_progress_pms_system_scan_start(  768): 30117
01-01 00:00:40.005 I/boot_progress_pms_data_scan_start(  768): 44171
01-01 00:00:45.841 I/boot_progress_pms_scan_end(  768): 50006
01-01 00:00:46.341 I/boot_progress_pms_ready(  768): 50505
01-01 00:00:49.005 I/boot_progress_ams_ready(  768): 53166
01-01 00:00:52.630 I/boot_progress_enable_screen(  768): 56793
    • or this: 'adb logcat -d | grep preload'
10-15 00:00:17.748 I/Zygote  (  535): ...preloaded 1873 classes in 2438ms.
10-15 00:00:17.764 I/Zygote  (  535): ...preloaded 0 resources in 0ms.
10-15 00:00:17.772 I/Zygote  (  535): ...preloaded 15 resources in 7ms.
  • Bootchart - see Using Bootchart on Android
  • strace is pretty handy also, to see the timings for system calls from a process as it runs
    • You can use strace as a wrapper for a program in init.rc, and save the results to a file
    • Use -f to follow sub-processes
    • Use -tt to get detailed timestamps for syscalls
    • Use -o to output the data to a file

Here is an example of using strace to follow the startup of zygote, and the apps that are forked from it.

Replace:

service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server

with

service zygote /system/xbin/strace -f -tt -o /cache/debug/boot.strace /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server

Here is some sample data:

$ head boot.strace
571   00:00:11.389939 execve("/system/bin/app_process", ["/system/bin/app_process", "-Xzygote", "/system/bin", "--zygote", "--start-system-server"], [/* 15 vars */]) = 0
571   00:00:11.658878 brk(0)            = 0x804b000
571   00:00:11.659048 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x77f9a000
571   00:00:11.659169 readlink("/proc/self/exe", "/system/bin/app_process", 4096) = 23
571   00:00:11.659339 access("/etc/ld.so.preload", R_OK) = 0
571   00:00:11.659440 open("/etc/ld.so.preload", O_RDONLY) = 3
571   00:00:11.659548 fstat64(0x3, 0x7fa76650) = 0
571   00:00:11.659887 mmap2(NULL, 36, PROT_READ|PROT_WRITE, MAP_PRIVATE, 3, 0) = 0x77f99000
571   00:00:11.659970 close(3)          = 0
571   00:00:11.660071 open("/lib/libc_sse.so", O_RDONLY) = 3

Please note that writing the strace data takes extra time. For long sequences of very fast syscalls (such as when the timezone file is being read) the overhead of strace itself exaggerates the timings in the trace. Use the timing information with caution.

Notes on the Android startup procedure

Overview

See "Android Initialization Process" at: http://blog.chinaunix.net/u2/85805/showart_1421736.html (this address is not work), using http://blog.chinaunix.net/space.php?uid=7788581&do=blog&id=2558375 instead.

strace

http://benno.id.au/blog/2007/11/18/android-runtime-strace

Interaction of different processes on application initialization

Talking about Android Process - http://blog.csdn.net/mawl2002/archive/2009/06/24/4295905.aspx

Improving Bootup Time presentation

See Improving Android Boot Time - notes and material for a talk at LinuxCon North America, 2010 by Tim Bird

News

1-second boot of Android

Ubiquitous Corporation has announced boot of ARM-based Android system in 1 second. Actually, it's more like a suspend and resume than a boot. See http://www.linuxfordevices.com/c/a/News/Ubiquitous-QuickBoot/?kc=LNXDEVNL032410 [March, 2010]


纯Web前端实现怀旧卡带插入效果:状态机与安卓兼容实战 打造高传播力的前端交互,往往不在于复杂框架,而在于对浏览器原生能力的深度挖掘。卡带插拔动画本质上是一个由状态驱动的用户界面交互流程。借助状态机来管理动画状态,可以避免异步事件导致的界面混乱;利用 Web Audio API 实时合成音效,则能在不加载额外资源的前提下增强操作反馈。当目标平台是安卓系统时,开发者需要关注浏览器的能力边界,合理选择 API 子集并做好能力降级,从而确保不同 WebView 下的稳定运行。这类交互设计可广泛应用于游戏收藏夹、模拟器导航页、开源掌机启动界面等场景,有效提升用户打开页面 阅读详情

相关推荐

安卓虚拟机跑老系统:Vectras VM 中的 NT 4.0 与 ME 兼容性实践

虚拟化技术通过软件模拟完整硬件环境,让不同架构与时代的操作系统在同一设备上运行。QEMU 作为经典的系统模拟器,能够抽象出 CPU、内存、磁盘控制器等设备模型,其价值在于打破硬件绑定,却也对兼容性设计提出严苛要求。当在安卓设备上借助 Vectras VM 尝试安装 Windows NT 4.0 与 Windows ME 这类老系统时,内存大小、磁盘类型、ACPI 开关等参数都会成为启动成败的关键。这种看似复古的实验,恰恰是理解现代虚拟机工作原理和硬件抽象层的绝佳途径。从 BIOS 引导顺序到设备驱动代差,每

weixin_30443075的博客 417

Android系统启动流程分析

title: Android系统启动流程分析 date: 2021-09-27 23:35:00 tags: - 系统启动 - Android - Framework categories: Framework keywords: ‘Android,系统启动,Framework’ description: 此笔记记录分析Android系统启动过程的分析。 cover: https://upload-images.jianshu.io/upload_images/13838098-709a95ad43e71.

u010248147的博客 5695

Android 系统启动过程

本文完整拆解 Android 从按下电源键到桌面出现的七阶段启动链路,涵盖 BootROM、BootLoader、Linux Kernel、init、Zygote、SystemServer 及 Launcher 各阶段的核心职责与耗时分解。提供 preload 裁剪、服务延迟启动、bootchart 分析等开机优化实战,以及卡 Logo 问题的串口与 logcat 调试方法。

weixin_44081096的博客 647

android:android booting

android booting http://elinux.org/Android_Booting#Bootloader Contents  [hide] 1 Key bootup components 1.1 Bootloader 1.2 'init' 1.2.1 'init' resources 2 Seq...

hunter 408

android booting分析

Android 开机流程,是个很值得详细讨论的主题

Bootmenu1.0.5

安装bootmenu-A953.V.1.0.5.apk,并打开,提示授权时选择允许,然后依次选择安装bootmenu和进入恢复模式。

配有 1TB 驱动器的 Surface Pro 5 设备显示两个驱动器

症状 在配有 1TB 驱动器的某些 Surface 设备上遇到以下症状: Diskpart 显示两个 512 GB 驱动器而不是一个 1 TB 驱动器。 Windows 资源管理器显示两个 512 GB 驱动器而不是一个 1 TB 驱动器。 裸机恢复 (BMR) 映像表示“在恢复您的电脑时出现问题”,或者在尝试恢复 BMR 映像时报告其他错误。 原因 出现此问题的原因是,某些配有 1TB 驱动器的 Surface 设备使用存储空间技术将两个 512GB 驱动器合并.

loveinfall_wyc的博客 1890

通过两个mark点确定某一个点的位置

read_image (Image0, '0.bmp') binary_threshold (Image0, Region, 'max_separability', 'dark', UsedThreshold) connection (Region, ConnectedRegions) fill_up (ConnectedRegions, RegionFillUp) select_shape_std (RegionFillUp, SelectedRegions, 'max_area', 70) red...

CSDN博客 3892

Android Booting (综述)

Android 開機流程,是一個很值得詳細討論的主題;近期,也正在進行相關的技術工作,因此簡單整理一些相關資料,和大家分享。了解「整體開機流程」,是最重要的第一門課。我們將開機劃分為三大階段: 1. OS-Level,由 Bootloader 載入 Linux kernel 後,開始進行 kernel 本身的初始化,並載入 built-in 的驅動程式。Kernel 完成開機後,載入 init

Bloom and Grow 1094

【脑电绘图教程 2】使用Brainstorm进行脑电处理及源定位

Brainstorm 是一个开源应用程序,支持MEG、EEG、fNIRS、ECoG、深度电极和其他电生理学的数据分析,尤其用于MEG、EEG的源定位。Brainstorm的主要优点是其简单直观的图形界面,不需要进行任何编程,即可上手MEG、EEG分析,此外,它还支持多种数据类型(基本上EEGLab支持的,它都支持),并且具有数据批量处理功能,可以很方便的分析自己的数据。

qq_40735196的博客 1万+

Python读取Matlab v7.3数据

文章目录Matlab保存数据Python读取 v7.3 Mat Matlab保存数据 在matlab设置中,常规->MAT文件,选择MATLAB版本7.3或更高版本保存数据。 注意保存数据的文件名为 corre.mat,保存的数据数组为data; 后面python的读取中会用到这两个参数 Python读取 v7.3 Mat 先安装hdf5storage库,再使用以下代码,就可以读取到mat中的数据,注意 import hdf5storage import numpy as np dataDi

weixin_43121914的博客 1086

Android系统启动(上篇)

前面我准备开始讲性能优化,讲到一半发现根本讲不下去。性能优化是基于对Framework深入理解的基础上的应用,如果对Framework没有深入的理解的话,又怎么能去很好的去做性能优化呢?所以,我调整了一下顺序。先讲清楚Framework这一块,然后再去补充性能优化专题。我们也是从开机到应用程序画面显示在我们面前这一流程开始。

qq_36428821的博客 2350

【多模态大模型】GLIP:零样本目标检测新范式与视觉语言理解

本文深入解析了多模态大模型GLIP在零样本目标检测和视觉语言理解领域的创新应用。GLIP通过统一目标检测与自然语言理解任务,实现了零样本学习能力,能够精准定位复杂文本描述对应的图像区域。文章详细介绍了GLIP的核心技术、数据策略及实战表现,并对比了与其他多模态模型的差异,为AI视觉理解提供了新范式。

weixin_29186249的博客 265

android booting 启动过程

原文 http://elinux.org/Android_Booting#Bootloader Android 系统的启动过程分为若干个阶段,本文主要介绍一下内容 Contents  [hide] 1 Key bootup components 1.1 Bootloader1.2 'init' 1.2.1 'init' resou

沉淀 2208

An工具介绍之摄像头

An工具介绍之摄像头

人生得意须尽欢 6202

SCHUNK SVH五指灵巧手 | 熵洛智能

雄克仿真五指机械手产品系列可以如人手操作那般完美地完成抓取操作。电子装置完全集成于腕关节中,使五指机械手几乎可以完成所有的人体手部动作。凭借带有9个驱动器的运动指骨,机械手可高精度地 执行多种抓取操作。富有弹性的抓取表面确保了对物体的可靠抓取。除了开启抓取和操作任务的全新领域之外,雄克还为在五指机械手的手势基础上进行人与机器人的交流开创了无限可能。编辑切换为居中添加图片注释,不超过 140 字(可选)产品特点:机械手有左手或右手两种版本适合移动应用耗能低,使用 24 V DC 在腕关节处完整集成了控制、调节

ShannonTech的博客 1342

无法引导 Android x86,Android-x86 9.0-r2 稳定版发布 修复在UEFI模式下iso无法引导问题...

Android-x86 9.0-r2 已发布,此版本是基于 Android-x86 9.0 (pie-x86) 的第二个稳定版。9.0-r2 基于最新的 Android 9.0.0 Pie 版本(android-9.0.0_r54),与 9.0-r1 相比,此版本进行了重大升级,例如对Mesa Vulkan 的初始支持、在 Mesa 上支持 OpenGL ES 3.x、升级至 Linux 4.19...

weixin_42508185的博客 1137

Windows系统下复现PointNet++算法

本文详细介绍了如何在Windows系统下复现PointNet++算法,内容包括程序下载、环境配置、数据集准备以及三个主要任务(语义分割、分类、部件分割)的实现步骤和常见报错解决方法。通过遵循本文的指导,用户可以顺利完成PointNet++算法的复现。

LingYi_5的博客 4339

android x86 安装it,Android X86 虚拟机安装手册

自从安卓手机操作系统诞生以来,一时间在手机市场可谓是风声水起,诺基亚王朝的败落,摩托的再次崛起,国产手机的发展方向可以说都和Android,这个小机器人有着千丝万缕的关系。随着android在手机市场上的普及,有些人既然试着将android移植到X86的电脑上,这也就是android-x86项目。我也试着在虚拟机中安装了一些,我想一些经验还是值得和大家分享的。首先新建虚拟机,种类要选择other中...

weixin_35453718的博客 645

【数字IC/FPGA】低功耗设计

低功耗设计方法功耗的类型低功耗设计方法静态低功耗技术多阈值工艺方法电源门控方法体偏置动态低功耗技术多电压域(Multi-Voltage Domain)预计算门控时钟门级优化技术毛刺的消除逻辑级优化物理级优化控制输入向量低功耗Soc系统的动态管理动态电压及频率调节技术低功耗操作系统存储器功耗控制总结 功耗的类型 CMOS电路中的功耗由两部分构成,第一部分为负载电容充放电时引起的功耗,称为动态功耗,另一部分为漏电流引起的功耗,称为静态功耗。其中动态功耗包括翻转功耗和短路功耗。翻转功耗是数字电路中信号翻转时电容充

qq_40268672的博客 3080

NTscan扫描工具

ntscan是一个扫描器,可以扫描没有密码和弱密码的共享,先到配置文件中填写猜测的用户名和密码,扫描过程中右侧出现的是扫描日志。

Booting Android: bootloaders, fastboot and boot images

Booting Android: bootloaders, fastboot and boot images

tuhuolong的专栏 686

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

Building and booting Nexus 5 kernel

Date 06/05/2014 Tags english / master's thesis / linux My description of building process will be strongly based on this article which was a great help in whole process:http://pete.akeo.ie/2013

Fly20141201. 的专栏 1312

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

3分钟解锁安卓自动开机:Magisk Autoboot模块让设备告别手动启动

你是否厌倦了每次设备关机后都要寻找电源键?或者需要频繁重启设备进行测试却觉得手动操作太麻烦?今天,我将向你介绍一个改变游戏规则的Magisk模块——Magisk Autoboot。这个智能模块能让你的安卓设备在连接充电器时自动开机,真正实现"即插即用"的智能化体验。**安卓自动开机**功能从此不再需要复杂的硬件改造或专业的技术知识。 ## 你的设备为什么需要自动启动功能? 想象一下这些场景,你

gitblog_00809的博客 784

终极指南:Magisk Autoboot模块如何实现安卓设备智能自动启动

你是否曾为每次设备关机后都要手动按电源键而烦恼?或者在进行自动化测试时,频繁的设备重启让你效率低下?今天,我将为你深入解析一个革命性的Magisk模块——Magisk Autoboot,它能让你的安卓设备在连接充电器时自动开机,真正实现"即插即用"的智能化体验。这个**Magisk自动启动模块**通过巧妙的技术手段,解决了安卓设备无法自动启动的长期痛点。 ## 核心价值:为什么你需要Magisk

gitblog_01139的博客 878

安卓自动开机终极指南:Magisk Autoboot模块完整使用教程

你是否厌倦了每次给手机充电都要手动按电源键?是否希望设备能像智能家居一样"即插即用"?今天我要介绍的Magisk Autoboot模块,正是解决这一痛点的完美方案。这个神奇的模块能让你的安卓设备在连接充电器时自动开机,实现真正的零操作启动体验。 ## 🤔 为什么你需要自动开机功能? 想象这些场景: - 家庭媒体中心设备断电后需要手动重启 - 自动化测试设备需要频繁重启 - 展示设备意外关机后

gitblog_00030的博客 422

深入解析TMS320F2837xS引导机制:从原理到实战配置

微控制器的引导机制是嵌入式系统开发的基础,它决定了系统上电后的初始执行路径。其核心原理在于芯片复位后,由固化的Boot ROM代码接管,根据预设的启动配置(如GPIO引脚状态或寄存器值)决定从何处加载并跳转用户程序。理解这一机制的技术价值在于,它不仅是系统可靠启动的保障,更是实现固件远程升级、多版本切换等高级功能的基础。在电机控制、数字电源等实时性要求高的应用场景中,稳定的引导流程能有效避免系统“变砖”风险。本文以德州仪器C2000系列中的TMS320F2837xS为例,深入剖析其Boot ROM的工作流程

weixin_34214500的博客 435
上一篇: Ten potential of mobile Internet business and profit model
下一篇: Android Custom UI: Making a Vintage Thermometer
AutoAsm
博客等级 码龄27年 27粉丝 20原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址