SlideShare a Scribd company logo
Android Booting Sequence
Bootloader
Kernel
init
Zygote DVM
SystemServer
Boot ROM
ManagersManagersManagersManagers
Stage 2
Stage 3
Stage 4
Stage 5
Stage 1
Stage 1
• On pressing POWER button, the Boot ROM code starts executing from a pre-
defined location which is hardwired in ROM.
• It loads the Bootloader into RAM.
• Bootloader is code that is executed before any Operating System starts to run.
• Bootloaders is a low-level code contains the instructions that tell a device how
to start up and find the system kernel.
• The bootloader usually lives on the system board in non-volatile memory and
is often specific to a device.
• The boot loader is usually split into stages. Stage 1 will load stage 2 from a
specific sector on the disk, then stage 2 will initialize the system and load the
kernel from 'boot' flash partition into RAM.
Stage 2
• Once kernel boots, it start setup cache, protected memory, scheduling, loads
drivers, starts kernel daemons, mounts root file system, initializing I/O , starts
interrupts, initializes process table.
• the 'kernel' is the central component of most operating systems; it is a bridge
between applications and the actual data processing done at the hardware
level.
• A kernel is the lowest level of easily replaceable software that interfaces with
the hardware in your device.
• It is responsible for interfacing all of your applications that are running in
“user mode” down to the physical hardware, and allowing processes, known as
servers, to get information from each other using inter-process communication
(IPC).
• When kernel finish system setup first thing it look for “init” in system files and
launch root process or first process of system.
Stage 3
• During booting of an Android device, init is the first user space process
start_kernel() spawns.
• The init process has two responsibilities.
– Mounts directories like /sys , /dev or /proc and
– Runs /init.rc script
• Init.rc is responsible for the initial set up of the system.
• It imports /init.${ro.hardware}.rc which is the primary vendor supplied .rc file.
• The 'init.rc' file is intended to provide the generic initialization instructions,
while the ‘init.${ro.hardware}.rc ' file is intended to provide the machine-
specific initialization instructions.
• The init process is what will set up all native services and this is similar to a
regular Linux system boot.
Stage 3 Cont..
• The init process first creates a shared memory region and stores a fd to the
region. Then init process maps the region into its virtual space
with mmap with MAP_SHARED flag, as a result, any updates to this area can be
seen by all processes.
• After that, init process will load properties from following files:
 /default.prop
 /system/build.prop
 /system/default.prop
 /data/local.prop
• At this stage, you can finally see the Android logo in your screen.
• init runs the C++ program /system/bin/app_process, and gives the resulting
process the name "zygote“.
Stage 4
• Zygote is a daemon started as a system service whose goal is to launch
applications.
• When app_process launches Zygote, it creates the first Dalvik VM and calls
Zygote’s main () method.
• Once Zygote starts, it preloads all necessary Java classes and resources,
starts System Server and opens a socket to listen for requests for starting
applications.
• Zygote receives a request to launch an App through /dev/socket/zygote. Once
it happens it trigger a fork() call.
• When a process forks, it creates a clone of itself. It replicates itself in another
memory space. This is done pretty efficiently. When this happens to Zygote, it
creates an exact and clean new Dalvik VM, preloaded with all necessary classes
and resources that any App will need. This makes the process of creating a VM
and load resources pretty efficiently.
Stage 4 Cont..
• As we know, Android runs on Linux. The Linux Kernel implements a strategy
call Copy On Write (COW).
• What this means is that during the fork process, no memory is actually copy to
another space. It is shared and marked as copy-on-write. Which means that
when a process attempt to modify that memory, the kernel will intercept the
call and do the copy of that piece of memory.
• In the case of Android those libraries are not writable. This means that all
process forked from Zygote are using the exact same copy of the system classes
and resources.
• The Zygote enables code sharing across the Dalvik VM, achieving a lower
memory footprint and minimal startup time.
Stage 5
• After zygote preloads all necessary Java classes and resources, it starts System
Server.
• The system server is the core of the Android system and as described in the
boot sequence post it is started as soon as Dalvik is initialized and running.
• The other system services will be running in the context of the System Server
process.
• The first thing that happens is that the server will load a native library called
android_servers that provides interfaces to native functionality.
• Then the native init method that will setup native services is called.
• After setting up the native services it create the server thread. This thread will
start the remaining services in the system according to the necessary start
order.
Stage 5 Cont..
• Each service is running in a separate Dalvik thread in the SystemServer
process.
• Once System Services up and running in memory, Android has completed
booting process, At this time “ACTION_BOOT_COMPLETED” standard broadcast
action will fire.
Reference
• http://www.androidenea.com/2009/08/init-process-and-initrc.html
• https://android.googlesource.com/platform/system/core/+/master/init/rea
dme.txt
• http://www.androidenea.com/2009/07/system-server-in-android.html
• https://anatomyofandroid.com/2013/10/15/zygote/
• http://www.androidenea.com/2009/08/init-process-and-initrc.html
• https://community.nxp.com/docs/DOC-102546
• http://www.onsandroid.com/2014/10/in-depth-android-boot-sequence-
process.html
• http://elinux.org/Android_Zygote_Startup
• http://rxwen.blogspot.in/2010/01/android-property-system.html
• https://en.wikibooks.org/wiki/Operating_System_Design/Initialization/Bootl
oader
• http://www.addictivetips.com/mobile/what-is-bootloader-and-how-to-
unlock-bootloader-on-android-phones-complete-guide/

More Related Content

What's hot

Android crash debugging
Android crash debuggingAndroid crash debugging
Android crash debugging
Ashish Agrawal
 
Embedded Android : System Development - Part III
Embedded Android : System Development - Part IIIEmbedded Android : System Development - Part III
Embedded Android : System Development - Part III
Emertxe Information Technologies Pvt Ltd
 
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Opersys inc.
 
Android Internals
Android InternalsAndroid Internals
Android Internals
Opersys inc.
 
Embedded Android : System Development - Part I
Embedded Android : System Development - Part IEmbedded Android : System Development - Part I
Embedded Android : System Development - Part I
Emertxe Information Technologies Pvt Ltd
 
Android Things : Building Embedded Devices
Android Things : Building Embedded DevicesAndroid Things : Building Embedded Devices
Android Things : Building Embedded Devices
Emertxe Information Technologies Pvt Ltd
 
Q4.11: Porting Android to new Platforms
Q4.11: Porting Android to new PlatformsQ4.11: Porting Android to new Platforms
Q4.11: Porting Android to new Platforms
Linaro
 
Shorten Device Boot Time for Automotive IVI and Navigation Systems
Shorten Device Boot Time for Automotive IVI and Navigation SystemsShorten Device Boot Time for Automotive IVI and Navigation Systems
Shorten Device Boot Time for Automotive IVI and Navigation Systems
National Cheng Kung University
 
Android Internals
Android InternalsAndroid Internals
Android Internals
Opersys inc.
 
Android's HIDL: Treble in the HAL
Android's HIDL: Treble in the HALAndroid's HIDL: Treble in the HAL
Android's HIDL: Treble in the HAL
Opersys inc.
 
Understanding the Android System Server
Understanding the Android System ServerUnderstanding the Android System Server
Understanding the Android System Server
Opersys inc.
 
Embedded Android : System Development - Part II (HAL)
Embedded Android : System Development - Part II (HAL)Embedded Android : System Development - Part II (HAL)
Embedded Android : System Development - Part II (HAL)
Emertxe Information Technologies Pvt Ltd
 
Embedded Android : System Development - Part IV
Embedded Android : System Development - Part IVEmbedded Android : System Development - Part IV
Embedded Android : System Development - Part IV
Emertxe Information Technologies Pvt Ltd
 
Timings of Init : Android Ramdisks for the Practical Hacker
Timings of Init : Android Ramdisks for the Practical HackerTimings of Init : Android Ramdisks for the Practical Hacker
Timings of Init : Android Ramdisks for the Practical Hacker
Stacy Devino
 
Android OTA updates
Android OTA updatesAndroid OTA updates
Android OTA updates
Gary Bisson
 
Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)
Emertxe Information Technologies Pvt Ltd
 
Hacking Android OS
Hacking Android OSHacking Android OS
Hacking Android OS
Jimmy Software
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)
RuggedBoardGroup
 
Android Binder IPC for Linux
Android Binder IPC for LinuxAndroid Binder IPC for Linux
Android Binder IPC for Linux
Yu-Hsin Hung
 
Embedded Android Workshop with Pie
Embedded Android Workshop with PieEmbedded Android Workshop with Pie
Embedded Android Workshop with Pie
Opersys inc.
 

What's hot (20)

Android crash debugging
Android crash debuggingAndroid crash debugging
Android crash debugging
 
Embedded Android : System Development - Part III
Embedded Android : System Development - Part IIIEmbedded Android : System Development - Part III
Embedded Android : System Development - Part III
 
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
 
Android Internals
Android InternalsAndroid Internals
Android Internals
 
Embedded Android : System Development - Part I
Embedded Android : System Development - Part IEmbedded Android : System Development - Part I
Embedded Android : System Development - Part I
 
Android Things : Building Embedded Devices
Android Things : Building Embedded DevicesAndroid Things : Building Embedded Devices
Android Things : Building Embedded Devices
 
Q4.11: Porting Android to new Platforms
Q4.11: Porting Android to new PlatformsQ4.11: Porting Android to new Platforms
Q4.11: Porting Android to new Platforms
 
Shorten Device Boot Time for Automotive IVI and Navigation Systems
Shorten Device Boot Time for Automotive IVI and Navigation SystemsShorten Device Boot Time for Automotive IVI and Navigation Systems
Shorten Device Boot Time for Automotive IVI and Navigation Systems
 
Android Internals
Android InternalsAndroid Internals
Android Internals
 
Android's HIDL: Treble in the HAL
Android's HIDL: Treble in the HALAndroid's HIDL: Treble in the HAL
Android's HIDL: Treble in the HAL
 
Understanding the Android System Server
Understanding the Android System ServerUnderstanding the Android System Server
Understanding the Android System Server
 
Embedded Android : System Development - Part II (HAL)
Embedded Android : System Development - Part II (HAL)Embedded Android : System Development - Part II (HAL)
Embedded Android : System Development - Part II (HAL)
 
Embedded Android : System Development - Part IV
Embedded Android : System Development - Part IVEmbedded Android : System Development - Part IV
Embedded Android : System Development - Part IV
 
Timings of Init : Android Ramdisks for the Practical Hacker
Timings of Init : Android Ramdisks for the Practical HackerTimings of Init : Android Ramdisks for the Practical Hacker
Timings of Init : Android Ramdisks for the Practical Hacker
 
Android OTA updates
Android OTA updatesAndroid OTA updates
Android OTA updates
 
Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)
 
Hacking Android OS
Hacking Android OSHacking Android OS
Hacking Android OS
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)
 
Android Binder IPC for Linux
Android Binder IPC for LinuxAndroid Binder IPC for Linux
Android Binder IPC for Linux
 
Embedded Android Workshop with Pie
Embedded Android Workshop with PieEmbedded Android Workshop with Pie
Embedded Android Workshop with Pie
 

Similar to Android Booting Sequence

Your first dive into systemd!
Your first dive into systemd!Your first dive into systemd!
Your first dive into systemd!Etsuji Nakai
 
Linux kernel booting
Linux kernel bootingLinux kernel booting
Linux kernel booting
Ramin Farajpour Cami
 
Linux Boot Process
Linux Boot ProcessLinux Boot Process
Linux Boot Process
darshhingu
 
Mobile Application Development- Configuration and Android Installation
Mobile Application Development- Configuration and Android InstallationMobile Application Development- Configuration and Android Installation
Mobile Application Development- Configuration and Android Installation
Chandrakant Divate
 
Linux startup
Linux startupLinux startup
Linux startup
Amin Hashemi
 
Modern Personal ComputerBoot up ProcessThe boot up process i.docx
Modern Personal ComputerBoot up ProcessThe boot up process i.docxModern Personal ComputerBoot up ProcessThe boot up process i.docx
Modern Personal ComputerBoot up ProcessThe boot up process i.docx
raju957290
 
Medooze MCU Video Multiconference Server Installation and configuration guide...
Medooze MCU Video Multiconference Server Installation and configuration guide...Medooze MCU Video Multiconference Server Installation and configuration guide...
Medooze MCU Video Multiconference Server Installation and configuration guide...sreeharsha43
 
Linux booting Process
Linux booting ProcessLinux booting Process
Linux booting Process
Gaurav Sharma
 
Device Drivers and Running Modules
Device Drivers and Running ModulesDevice Drivers and Running Modules
Device Drivers and Running Modules
YourHelper1
 
Course 102: Lecture 25: Devices and Device Drivers
Course 102: Lecture 25: Devices and Device Drivers Course 102: Lecture 25: Devices and Device Drivers
Course 102: Lecture 25: Devices and Device Drivers
Ahmed El-Arabawy
 
Systemd 간략하게 정리하기
Systemd 간략하게 정리하기Systemd 간략하게 정리하기
Systemd 간략하게 정리하기
Seungha Son
 
Linux booting process, Dual booting, Components involved
Linux booting process, Dual booting, Components involvedLinux booting process, Dual booting, Components involved
Linux booting process, Dual booting, Components involved
divyammo
 
Android Internals at Linaro Connect Asia 2013
Android Internals at Linaro Connect Asia 2013Android Internals at Linaro Connect Asia 2013
Android Internals at Linaro Connect Asia 2013
Opersys inc.
 
Chapter -2 operating system presentation
Chapter -2 operating system presentationChapter -2 operating system presentation
Chapter -2 operating system presentation
chnrketan
 
Bootloader and bootloading
Bootloader and bootloadingBootloader and bootloading
Bootloader and bootloadingArpita Gupta
 
Linux booting procedure
Linux booting procedureLinux booting procedure
Linux booting procedure
Dhaval Kaneria
 
Unix Shell and System Boot Process
Unix Shell and System Boot ProcessUnix Shell and System Boot Process
Unix Shell and System Boot Process
Arvind Krishnaa
 
unit 2 confinement techniques.pdf
unit 2 confinement techniques.pdfunit 2 confinement techniques.pdf
unit 2 confinement techniques.pdf
RohitGautam261127
 

Similar to Android Booting Sequence (20)

Your first dive into systemd!
Your first dive into systemd!Your first dive into systemd!
Your first dive into systemd!
 
Linux kernel booting
Linux kernel bootingLinux kernel booting
Linux kernel booting
 
Linux Boot Process
Linux Boot ProcessLinux Boot Process
Linux Boot Process
 
Ch04
Ch04Ch04
Ch04
 
Ch04 system administration
Ch04 system administration Ch04 system administration
Ch04 system administration
 
Mobile Application Development- Configuration and Android Installation
Mobile Application Development- Configuration and Android InstallationMobile Application Development- Configuration and Android Installation
Mobile Application Development- Configuration and Android Installation
 
Linux startup
Linux startupLinux startup
Linux startup
 
Modern Personal ComputerBoot up ProcessThe boot up process i.docx
Modern Personal ComputerBoot up ProcessThe boot up process i.docxModern Personal ComputerBoot up ProcessThe boot up process i.docx
Modern Personal ComputerBoot up ProcessThe boot up process i.docx
 
Medooze MCU Video Multiconference Server Installation and configuration guide...
Medooze MCU Video Multiconference Server Installation and configuration guide...Medooze MCU Video Multiconference Server Installation and configuration guide...
Medooze MCU Video Multiconference Server Installation and configuration guide...
 
Linux booting Process
Linux booting ProcessLinux booting Process
Linux booting Process
 
Device Drivers and Running Modules
Device Drivers and Running ModulesDevice Drivers and Running Modules
Device Drivers and Running Modules
 
Course 102: Lecture 25: Devices and Device Drivers
Course 102: Lecture 25: Devices and Device Drivers Course 102: Lecture 25: Devices and Device Drivers
Course 102: Lecture 25: Devices and Device Drivers
 
Systemd 간략하게 정리하기
Systemd 간략하게 정리하기Systemd 간략하게 정리하기
Systemd 간략하게 정리하기
 
Linux booting process, Dual booting, Components involved
Linux booting process, Dual booting, Components involvedLinux booting process, Dual booting, Components involved
Linux booting process, Dual booting, Components involved
 
Android Internals at Linaro Connect Asia 2013
Android Internals at Linaro Connect Asia 2013Android Internals at Linaro Connect Asia 2013
Android Internals at Linaro Connect Asia 2013
 
Chapter -2 operating system presentation
Chapter -2 operating system presentationChapter -2 operating system presentation
Chapter -2 operating system presentation
 
Bootloader and bootloading
Bootloader and bootloadingBootloader and bootloading
Bootloader and bootloading
 
Linux booting procedure
Linux booting procedureLinux booting procedure
Linux booting procedure
 
Unix Shell and System Boot Process
Unix Shell and System Boot ProcessUnix Shell and System Boot Process
Unix Shell and System Boot Process
 
unit 2 confinement techniques.pdf
unit 2 confinement techniques.pdfunit 2 confinement techniques.pdf
unit 2 confinement techniques.pdf
 

Recently uploaded

When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 

Recently uploaded (20)

When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 

Android Booting Sequence

  • 3. Stage 1 • On pressing POWER button, the Boot ROM code starts executing from a pre- defined location which is hardwired in ROM. • It loads the Bootloader into RAM. • Bootloader is code that is executed before any Operating System starts to run. • Bootloaders is a low-level code contains the instructions that tell a device how to start up and find the system kernel. • The bootloader usually lives on the system board in non-volatile memory and is often specific to a device. • The boot loader is usually split into stages. Stage 1 will load stage 2 from a specific sector on the disk, then stage 2 will initialize the system and load the kernel from 'boot' flash partition into RAM.
  • 4. Stage 2 • Once kernel boots, it start setup cache, protected memory, scheduling, loads drivers, starts kernel daemons, mounts root file system, initializing I/O , starts interrupts, initializes process table. • the 'kernel' is the central component of most operating systems; it is a bridge between applications and the actual data processing done at the hardware level. • A kernel is the lowest level of easily replaceable software that interfaces with the hardware in your device. • It is responsible for interfacing all of your applications that are running in “user mode” down to the physical hardware, and allowing processes, known as servers, to get information from each other using inter-process communication (IPC). • When kernel finish system setup first thing it look for “init” in system files and launch root process or first process of system.
  • 5. Stage 3 • During booting of an Android device, init is the first user space process start_kernel() spawns. • The init process has two responsibilities. – Mounts directories like /sys , /dev or /proc and – Runs /init.rc script • Init.rc is responsible for the initial set up of the system. • It imports /init.${ro.hardware}.rc which is the primary vendor supplied .rc file. • The 'init.rc' file is intended to provide the generic initialization instructions, while the ‘init.${ro.hardware}.rc ' file is intended to provide the machine- specific initialization instructions. • The init process is what will set up all native services and this is similar to a regular Linux system boot.
  • 6. Stage 3 Cont.. • The init process first creates a shared memory region and stores a fd to the region. Then init process maps the region into its virtual space with mmap with MAP_SHARED flag, as a result, any updates to this area can be seen by all processes. • After that, init process will load properties from following files:  /default.prop  /system/build.prop  /system/default.prop  /data/local.prop • At this stage, you can finally see the Android logo in your screen. • init runs the C++ program /system/bin/app_process, and gives the resulting process the name "zygote“.
  • 7. Stage 4 • Zygote is a daemon started as a system service whose goal is to launch applications. • When app_process launches Zygote, it creates the first Dalvik VM and calls Zygote’s main () method. • Once Zygote starts, it preloads all necessary Java classes and resources, starts System Server and opens a socket to listen for requests for starting applications. • Zygote receives a request to launch an App through /dev/socket/zygote. Once it happens it trigger a fork() call. • When a process forks, it creates a clone of itself. It replicates itself in another memory space. This is done pretty efficiently. When this happens to Zygote, it creates an exact and clean new Dalvik VM, preloaded with all necessary classes and resources that any App will need. This makes the process of creating a VM and load resources pretty efficiently.
  • 8. Stage 4 Cont.. • As we know, Android runs on Linux. The Linux Kernel implements a strategy call Copy On Write (COW). • What this means is that during the fork process, no memory is actually copy to another space. It is shared and marked as copy-on-write. Which means that when a process attempt to modify that memory, the kernel will intercept the call and do the copy of that piece of memory. • In the case of Android those libraries are not writable. This means that all process forked from Zygote are using the exact same copy of the system classes and resources. • The Zygote enables code sharing across the Dalvik VM, achieving a lower memory footprint and minimal startup time.
  • 9. Stage 5 • After zygote preloads all necessary Java classes and resources, it starts System Server. • The system server is the core of the Android system and as described in the boot sequence post it is started as soon as Dalvik is initialized and running. • The other system services will be running in the context of the System Server process. • The first thing that happens is that the server will load a native library called android_servers that provides interfaces to native functionality. • Then the native init method that will setup native services is called. • After setting up the native services it create the server thread. This thread will start the remaining services in the system according to the necessary start order.
  • 10. Stage 5 Cont.. • Each service is running in a separate Dalvik thread in the SystemServer process. • Once System Services up and running in memory, Android has completed booting process, At this time “ACTION_BOOT_COMPLETED” standard broadcast action will fire.
  • 11. Reference • http://www.androidenea.com/2009/08/init-process-and-initrc.html • https://android.googlesource.com/platform/system/core/+/master/init/rea dme.txt • http://www.androidenea.com/2009/07/system-server-in-android.html • https://anatomyofandroid.com/2013/10/15/zygote/ • http://www.androidenea.com/2009/08/init-process-and-initrc.html • https://community.nxp.com/docs/DOC-102546 • http://www.onsandroid.com/2014/10/in-depth-android-boot-sequence- process.html • http://elinux.org/Android_Zygote_Startup • http://rxwen.blogspot.in/2010/01/android-property-system.html • https://en.wikibooks.org/wiki/Operating_System_Design/Initialization/Bootl oader • http://www.addictivetips.com/mobile/what-is-bootloader-and-how-to- unlock-bootloader-on-android-phones-complete-guide/