SlideShare uma empresa Scribd logo
1 de 11
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/

Mais conteúdo relacionado

Mais procurados

Android booting sequece and setup and debugging
Android booting sequece and setup and debuggingAndroid booting sequece and setup and debugging
Android booting sequece and setup and debuggingUtkarsh Mankad
 
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 PlatformsLinaro
 
Understanding the Android System Server
Understanding the Android System ServerUnderstanding the Android System Server
Understanding the Android System ServerOpersys inc.
 
Android OTA updates
Android OTA updatesAndroid OTA updates
Android OTA updatesGary Bisson
 
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)Nanik Tolaram
 
Using the Android Native Development Kit (NDK)
Using the Android Native Development Kit (NDK)Using the Android Native Development Kit (NDK)
Using the Android Native Development Kit (NDK)Xavier Hallade
 
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 HALOpersys inc.
 
Learning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverLearning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverNanik Tolaram
 
Reducing boot time in embedded Linux
Reducing boot time in embedded LinuxReducing boot time in embedded Linux
Reducing boot time in embedded LinuxChris Simmonds
 
Android Storage - Vold
Android Storage - VoldAndroid Storage - Vold
Android Storage - VoldWilliam Lee
 
Android graphic system (SurfaceFlinger) : Design Pattern's perspective
Android graphic system (SurfaceFlinger) : Design Pattern's perspectiveAndroid graphic system (SurfaceFlinger) : Design Pattern's perspective
Android graphic system (SurfaceFlinger) : Design Pattern's perspectiveBin Chen
 
Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?Opersys inc.
 
U-Boot presentation 2013
U-Boot presentation  2013U-Boot presentation  2013
U-Boot presentation 2013Wave Digitech
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux DevelopersOpersys inc.
 

Mais procurados (20)

Android booting sequece and setup and debugging
Android booting sequece and setup and debuggingAndroid booting sequece and setup and debugging
Android booting sequece and setup and debugging
 
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
 
Android Booting Scenarios
Android Booting ScenariosAndroid Booting Scenarios
Android Booting Scenarios
 
Understanding the Android System Server
Understanding the Android System ServerUnderstanding the Android System Server
Understanding the Android System Server
 
Embedded Android : System Development - Part I
Embedded Android : System Development - Part IEmbedded Android : System Development - Part I
Embedded Android : System Development - Part I
 
Android OTA updates
Android OTA updatesAndroid OTA updates
Android OTA updates
 
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
 
Using the Android Native Development Kit (NDK)
Using the Android Native Development Kit (NDK)Using the Android Native Development Kit (NDK)
Using the Android Native Development Kit (NDK)
 
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
 
Android Things : Building Embedded Devices
Android Things : Building Embedded DevicesAndroid Things : Building Embedded Devices
Android Things : Building Embedded Devices
 
Learning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverLearning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device Driver
 
Reducing boot time in embedded Linux
Reducing boot time in embedded LinuxReducing boot time in embedded Linux
Reducing boot time in embedded Linux
 
Android Internals
Android InternalsAndroid Internals
Android Internals
 
Android Storage - Vold
Android Storage - VoldAndroid Storage - Vold
Android Storage - Vold
 
Android graphic system (SurfaceFlinger) : Design Pattern's perspective
Android graphic system (SurfaceFlinger) : Design Pattern's perspectiveAndroid graphic system (SurfaceFlinger) : Design Pattern's perspective
Android graphic system (SurfaceFlinger) : Design Pattern's perspective
 
Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?
 
U-Boot presentation 2013
U-Boot presentation  2013U-Boot presentation  2013
U-Boot presentation 2013
 
Introduction to Android Window System
Introduction to Android Window SystemIntroduction to Android Window System
Introduction to Android Window System
 
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)
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux Developers
 

Semelhante a 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
 
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 HackerStacy Devino
 
Linux Boot Process
Linux Boot ProcessLinux Boot Process
Linux Boot Processdarshhingu
 
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.docxraju957290
 
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 ProcessGaurav Sharma
 
Device Drivers and Running Modules
Device Drivers and Running ModulesDevice Drivers and Running Modules
Device Drivers and Running ModulesYourHelper1
 
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
 
Android crash debugging
Android crash debuggingAndroid crash debugging
Android crash debuggingAshish Agrawal
 
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 involveddivyammo
 
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 2013Opersys inc.
 
Chapter -2 operating system presentation
Chapter -2 operating system presentationChapter -2 operating system presentation
Chapter -2 operating system presentationchnrketan
 
Bootloader and bootloading
Bootloader and bootloadingBootloader and bootloading
Bootloader and bootloadingArpita Gupta
 
Linux booting procedure
Linux booting procedureLinux booting procedure
Linux booting procedureDhaval Kaneria
 
Unix Shell and System Boot Process
Unix Shell and System Boot ProcessUnix Shell and System Boot Process
Unix Shell and System Boot ProcessArvind Krishnaa
 

Semelhante a 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
 
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
 
Linux Boot Process
Linux Boot ProcessLinux Boot Process
Linux Boot Process
 
Ch04 system administration
Ch04 system administration Ch04 system administration
Ch04 system administration
 
Ch04
Ch04Ch04
Ch04
 
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 간략하게 정리하기
 
Android crash debugging
Android crash debuggingAndroid crash debugging
Android crash debugging
 
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
 

Último

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 

Último (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

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/