Android boot process from power on

Source: Internet
Author: User

Statement:

Original address: http://www.androidenea.com/2009/06/android-boot-process-from-power-on.html, thisArticleIt is based on the translation of this article. The translation is not good, please smile -):

 

1. Power on and boot Rom Code Execution
Boot and execute boot RomCode

At power on the CPU will be in a state where no initializations have been done. internal clocks are not set up and the only memory available is the internal RAM.
When power supplies are stable the execution will start with the boot ROM code. This is a small piece of code that is hardwired in the cpu asic.

When the instance is started, the CPU is not initialized, and no internal clock is set. Only internal RAM is available. When the power supply is stable, the boot ROM code is executed. This is a small piece of code that is hard-coded in the cpu asic.

  • . the boot ROM code will detect the boot media using a system register that maps to some physical BALS On the ASIC.
    This is to determine where to find the first stage of the boot loader.
    the boot ROM code directs the boot media to map system registers to some physical areas of the ASIC to determine where to find the first phase of the boot loader.

  • B. Once the boot media sequence is established the boot Rom will try to load the first stage boot loader to internal RAM.
    Once the boot loader is in place the boot ROM code will perform a jump and execution continues in the boot loader.
    Once the boot media sequence is determined, the boot Rom will try to load the first phase of the boot loader to the internal RAM. Once the boot loader is in place, the boot ROM code will jump to and execute the Boot Loader

 

2. The Boot Loader

The boot loader is a special program separate from the Linux kernel that is used to set up initial memories and load the kernel to ram.
On desktop systems the boot loaders are programs like grub and in Embedded Linux uboot is often the boot loader of choice.
Device manufacturers often use their own proprietary boot loaders.

Boot Loader is a special Linux kernel independentProgramIt is used to initialize the memory and load the kernel to ram. The boot loader program of the desktop system includes grub,
Equipment Manufacturers often use their proprietary Boot Loader programs.

 

  • A. The first boot loader stage will detect and set up external Ram.
    The first phase of boot loader will detect and set external Ram

  • B. Once external Ram is available and the system is ready the to run something more significant the first stage will load the Main Boot Loader and place it in external Ram.
    Once the external Ram is available, the system will prepare to load the Main Boot Loader and put it in the external Ram.

  • C. the second stage of the boot loader is the first major program that will run. this may contain in code to set up file systems, additional memory,
    network support and other things. on a mobile phone it may also be responsible for loading code for the modem CPU and setting up low level memory
    protections and security options.

    the second stage of boot loader is the first important program to run. It includes setting the file system, Memory, network support, and other code. On a mobile phone,
    may be responsible for loading the modem's CPU code and setting low-level memory Protection and Security Options

  • D. once the boot loader is done with any special tasks it will look for a Linux kernel to boot. it will load this from the boot media
    (or some other source depending on system configuration) and place it in the ram.
    it will also place some boot parameters in memory for the kernel to read when it starts up.
    once the boot loader completes these special tasks, it starts to look for the Linux kernel. It loads the Linux kernel from the boot media (or elsewhere, depending on the system configuration ), put it in Ram.
    It also replaces some startup parameters read during kernel startup in the memory.

  • E. Once the boot loader is done it will perform a jump to the Linux kernel, usually some decompression routine, and the kernel assumes system responsibility.
    Once the boot loader is complete, it will jump to the Linux kernel. Generally, by extracting the program and extracting the kernel file, the kernel will obtain SYSTEM privileges.

     

3. the Linux Kernel
Linux Kernel

The Linux kernel starts up in a similar way on Android as on other systems. It will set up everything that is needed for the system to run. initialize interrupt controllers,
Set up memory protections, caches and scheduling.
The Linux Kernel on Android is the same as the Startup Mode on other systems. It will set everything required for system running, initialize the interrupt controller, set memory protection, high-speed cache and scheduling.

    • A. Once the memory management units and caches have been initialized the system will be able to use virtual memory and launch user space processes.
      Once the memory management unit and cache initialization are complete, the system can use virtual memory and start user space processes.

    • B. the kernel will look in the root file system for the INIT process (found underSystem/CORE/initIn the android open source tree) and launch it as the initial user space process.
      The kernel looks for the initialization program in the root directory (the Code corresponds to the android source tree:/System/CORE/init), Start it as the initialization user space Process

       

4. The INIT process
Initialization Process

The INIT process is the "grandmother" of all system processes. Every other process in the system will be launched from this process or one of its descendants.
The initialization process is the "grandmother" of all other system processes. Every other process in the system will start from the process or its sub-process.

 

    • A. The INIT process in Android will look for a file called init. Rc. This is a script that describes the system services, file system and other parameters that need to be set up.
      The init. RC Script is placed in system/CORE/rootdir In the android open source project.
      The initialization process looks for the init. RC file. The init. RC Script File describes the system service, file system, and other parameters to be set. The file is in the Code:System/CORE/rootdir

    • B. The INIT process will parse the init script and launch the system service processes.
      Initialize process parsing init script and start System Service Process

       

5. zygote and Dalvik

The zygote is launched by the INIT process and will basically just start executing and initialize the Dalvik VM.
Zygote is started by the initialization process and starts to run and initialize the Dalvik virtual machine.

6. The system server
System Service
The system server is the first Java component to run in the system. It will start all the android services such as Telephony Manager and Bluetooth.
Start up of each Service is currently written directly into the run method of the system server. The system server source can be found in the file:
Frameworks/base/services/Java/COM/Android/Server/systemserver. JavaIn the open source project.

System Service is the first Java component running in the system. It starts all android services, such as telephone services and Bluetooth services. the startup of each service is directly written in systemserver. in the run method of the Java class
Code:Frameworks/base/services/Java/COM/Android/Server/systemserver. Java

7. Boot completed
Startup complete

Once the system server is up and running and the system boot has completed there is a standard broadcast action called action_boot_completed.
Once the system service starts and runs, the android system starts and sends an action_boot_completed broadcast.

 

 

 

 

 

 

 

 

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.