Android-Compiled images

Source: Internet
Author: User

This article is "Android kernel development" of the fourth article, mainly about the source code compiled output of several important image files, here bootloader source code and the Linux kernel source code compiled output is also counted in it, Because after all, the Android system is missing these two parts on the device also can't run up.

1. MLO, u-boot.img

Any operating system boot, can not be separated from the "boot program", such as desktop Windows system BIOS, Desktop Linux system is commonly used grub, and in the embedded system, the bootloader is often called "bootloader", It is usually composed of the boot code and the U-boot two parts of the processor's on-chip ROM (and of course, there are other types of bootloader, which are dominated by the most commonly used u-boot).

These "bootloader" functions, usually complete the hardware system detection and configuration, and then to the designated location to "load and run" operating system kernel, the loading process is to extract the specified kernel image files into the memory DDR, and then run the kernel code, and hand over the CPU control.

As a result we know that the first and most important file of the Android system is "bootloader". "Bootloader" is OS-independent and requires "bootloader" to start booting, regardless of whether the device is running Linux or Android.

With regard to "bootloader", it is necessary to explain that the boot code in the processor ROM is usually implemented by the processor vendor, that we cannot obtain or modify, and that U-boot is the specific Development Board/device manufacturer, if we design our own Android hardware device, It is also necessary to modify the standard U-boot code to fit our own hardware modules.

U-boot compiled output file has 2, one is MLO, The other is u-boot.img, so for many Android boards, there must be a boot partition (usually the FAT32 format), which contains two important files, Mlo and u-boot.img.

2. Uimage

Since the Android system is based on the Linux kernel, as with the embedded Linux boot process, "bootloader" after the hardware detection and initialization configuration, the first step is to load and run the Linux kernel image, so during the Android device boot process, In addition to the MLO and u-boot.img files, the other most important file is the kernel image uimage file.

Note: After the successful compilation of the Linux kernel, the Zimage file is generated in the arch/arm/boot/directory, and the Mkimage command gives the Zimage file a 64-byte data header to get the Uimage file so that it can be u-boot recognized and properly booted.

3. ramdisk.img

When the Linux kernel starts, it first creates the virtual root file system, then addresses the real root file system image at the specified location and loads it into memory, then executes the init executable to complete the system boot process.

For embedded Linux systems, it is generally necessary to use tools such as BusyBox to create a root file system image, and Android source has implemented a root file system, That is, when the ramdisk.img,android kernel system starts, it loads ramdisk.img as the root file system, then executes the INIT program, parses the init.rc script, mounts the other partitions of the system, opens the various processes and services, and so on.

Therefore, the Android system launches a third essential file, the Ramdisk.img file, which is the root file system image of the Android system.

4. boot.img

In Android, Zimage and ramdisk.img are usually packaged together to generate a boot.img image file, put it on the boot partition, boot from bootloader, and the nature of the boot process is also separate uimage& Ramdisk.img is similar, just merge two images into one image in a certain format.

How does bootloader know where to load the Linux kernel (zimage) and the root file system (RAMDISK.IMG)? Usually by the command line arguments into the bootloader program, or in the bootloader code to give a boot parameter configuration file path, the specific principle can refer to the bootloader start Linux kernel related article analysis, here do not do a detailed introduction.

5. system.img

The images we mentioned earlier, such as "bootloader", "Linux Kernel", and "filesystem" are all core files that do not contain the Android system, so where is the core part of the real Android operating system? In fact, it is located in System.img, which contains the Android system firmware, user interface, a series of pre-compiled applications, etc., will be mounted to the/system partition after the kernel is booted. Therefore, it is also one of the essential images of Android system boot.

6. userdata.img

The previous system.img image contains all the Android system-level data, and the "user" of the "factory" data is placed in the userdata.img image, it will be mounted to the file system/data partition, the user's new stored data, Installed programs will be placed in this partition, if erased this partition, essentially the same as the phone restored factory settings, it is an essential image of the Android system boot.

7. Other Mirrors

Several of the previous descriptions are the most important image files involved in Android system startup, of course, There are several other files for compiling the output: The cache.img used to cache the most frequently accessed data and applications, the recovery.img used to restore the system, and so on, which is not explained in detail here.

Android-Compiled images

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.