Android Kernel development: System partition and image file burning

Source: Internet
Author: User

This article is the fifth article in the Android Kernel Development series, which focuses on how to burn a compiled output image file to an Android device.


The friend who played the brush is certainly not unfamiliar with the tool of FastBoot, it is a development tool provided in the Android SDK, support to update/burn the image file at hand by USB cable to the Android device, the common fastboot burning process is as follows:


FastBoot Flash boot boot.imgfastboot flash system system.imgfastboot flash UserData userdata.imgfastboot Flash cache Cache . imgfastboot Flash Recovery Recovery.imgfastboot reboot


In this way, we have successfully updated the image files of our compiled output to the partition specified by the Android device respectively.


But do you know what the principle is?


In fact, FastBoot is a transport protocol defined by Google, it works on both the Android device and the PC, just like the common HTTP protocol of the browser, requires the server/client to support the protocol to complete the data transfer.


Google provides the definition and source of the FastBoot protocol, requires device vendors to port the code to the bootloader of their devices, not all Android devices support FastBoot, so we may buy some of the development Board does not support FastBoot , this requires us to burn in other ways, or modify the Bootloader/u-boot source code to support the FastBoot protocol.


Google defined FastBoot protocol address: Here (need to turn over the wall)


As the AOSP official website was walled, I also copied a copy of the agreement definition text to our GitHub address as follows:


Https://github.com/Jhuster/AOSP/blob/master/documents/fastboot_protocol.txt


For any standard Android device, it will partition the internal storage space, the partition size of different devices is not the same, but usually there are several partitions:


/boot/system/recovery/data/cache/misc


Each partition corresponds to the actual storage location of each image file on the device. As shown, is the system partition division of the ADP1/G1 phone:


650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/6D/C3/wKiom1Vq5oWRtE_BAAMq4-wztyQ683.jpg "title=" 2015-05-28 100412 screen. png "alt=" wkiom1vq5owrte_baamq4-wztyq683.jpg "/>


So we know, in fact, the fastboot command execution process, is based on the command parameters, the new image file copy to the specified partition process, in fact, is not complex.


So, how does a device that doesn't support the FastBoot protocol burn Android images in general?


In fact, it is also mentioned above, FastBoot protocol is working in the bootloader, in the absence of FastBoot before the appearance of embedded system image burning through the bootloader is also completely can be done, here is an example of a simple demonstration of the Linux kernel burn-write process.


Usually in the U-boot start-up process, there will be 3 seconds to stay in the serial terminal hit enter interrupt u-boot boot kernel process, you can enter u-boot support of various commands and board interaction, for example, as follows:


$ NAND Erase 0x100000 0x200000//Erase Nandflash Specify the location area of the data $ tftp 0x80000000 Uimage//via TFTP to download the kernel To memory specifies the location $ nand write 0x80000000 0x100000 0x200000//writes the in-memory kernel to the Nandflash specified location


Similarly, as long as the partition and address of the storage space is clear, you can complete the image burning process through u-boot, of course, how u-boot burned to the development Board? This is written by the Jtag tool, which is not discussed in detail here.


Of course, if the system is from the external sdcard boot is more simple, just need to connect the sdcard to the computer, overwriting the corresponding partition inside the image file can be.


About the Android system partition and image burning introduced here, have any questions welcome message or letter [email protected] exchange, you can also follow my Weibo @ lu _ June get the latest articles and information, thank you.


This article is from the "Shadow Three People" blog, please be sure to keep this source http://ticktick.blog.51cto.com/823160/1656900

Android Kernel Development: System partition and image file Burn-write

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.