[Reprinted] Android startup-Day 1

Source: Internet
Author: User

From: http://www.cnblogs.com/hangxin1940/archive/2011/10/01/2196964.html

 

On the first day, Google said that there would be electricity, so electricity would flow into the circuit board, and into the ARM processor, so arm was operating.

-- Xxx

 

The advent of the embedded world is a wild world, with electric traffic flowing to various chips and various processors waiting to wake up.

 

Arm woke up and began to examine itself ....

 

--------------- The following content may be incorrect. Please confirm -------------------

People call it bootloader, And the BIOS in the PC is a buddy, responsible for the initialization of each port of the chip, and CPU clock settings.

 

In mobile phones, bootloader generally refers to the bottom package of the mobile phone population (not all, will be said the next day). Taking motorcycles as an example, after buying a mobile phone, enthusiasts will always first brush the bottom package, what is the background package of Nordic, Hong Kong, and western Pakistan. First download 100 ~ Mb sbf file. What does the base package contain? Bootloader must be in it, but the embedded world was quite old. Can it be so big?

--------------- The content above may be incorrect. Please correct -------------------

Let's start with the following:

Here, I will explain how to solve the SBF package, so that you can easily find out what it is for those who have the geek spirit.

 

Download SBF-recalc and use this software to unbind the SBF package. Here, we use the 3.4.3 _ 11-stock.uktmobile_blur.sbf New British base package as an example. The decompressed file is as follows:

After so many things come out, do you see two 8 m Files? They are the basic kernel of Linux. They can unlock a third-party ROM and have boot. IMG, which is similar to the two files. I don't know which bootloader is and which level does not work ......

I. What does bootloader do?

Generally, mobile phones have many file systems, ranging from nor to NAND and sdcard. Each Rom stores different data.

Bootloader first reads some commands from its ROM, initializes various stacks, and so on. Then it goes to the program that the custom manufacturer burns the start address of a ROM and enters the mian function, this is to deal with the dog, various interruptions, peripheral ROM and so on.

 

Ii. Three routes after bootloader

 

Here, we usually deal with the combination of two types of interruptions/events. Which two of them are used? One is to enter the factory mode (the words bootloader are displayed, of course, the package is flushed ), the other is recory (recovery mode, Rom FLUSHING ).

There will be three routes to go later

 

(1) bootloader burning mode (factory Mode)

 

In general, when a user presses certain keys during the boot period (during the boot loader life cycle), such as the START key, my defy will also enter the bootloader interface when the USB is connected. These System interruptions will be accepted. Others are blocked.

I don't know much about it. It's purely embedded. For us, it's nothing more than a brush/burn package (generally, the brush package software will burn all the brains from bootloader to Android Rom into each Rom [here refers to hardware, memory ).

 

(2) recory mode (recovery mode)

 

In general, the user presses the on-premise key + volume/camera key (did I say it is reversed? May be forgotten) will enter the recovery mode. At this time, the bootloader loads the ROM/partition that stores the recory image (boot. IMG, as described later), gives control to it, and ends its own lifecycle.

 

(3) normal startup

Generally, if you do not press anything, bootloader will load the system kernel (boot. IMG of a ROM/partition ). Go to Linux kernel.

 

Iii. Linux Kernel

What is boot. IMG? IMG is a binary file. It is a binary image of a file system. The first image is a system image, and the latter is a zimage (about 2 MB). You should be familiar with it. It is required for Linux guidance, it is the kernel, which is entered by the bootloader in the final stage.

 

What did it do? For Linux boot, if you are familiar with PC, you will feel that vmlinux is installed. In this case, it includes a compressed kernel, vmlinux, which will first decompress vmlinux, and put it in ram, and then run.

I have to mention that I used Debian for my first access to Linux. I have never seen any USB flash drives at the time. I downloaded a micro-Linux based on a floppy disk based on the Debian tutorial, it's the kernel. You have to replace three floppy disks when you start the system ~~~, Basic commands are included ~~ How old was Windows 98 at that time? compared with three floppy disks, I fell in love with Linux ...... So comfortable CLI interaction, compared with DOS, is a region in heaven ~~

 

The task of vmlinux is to initialize the Linux World.

 

First, it initializes some necessary things, such as detecting the arm model or something, and then starts Linux Initialization (start_kernel), initializes various kernel subsystems, and finally starts init. Note, this is the kernel-level init.

 

Then init will mount the root file system (/). The root file system is the system where the kernel image is located and it exists in the memory. Then initialize the device driver. After that, the first screen startup screen is displayed here. For example, defy is a motorcycle logo.

 

After that, it will be the next day.

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.