Android eMMC 分区详解

1. fastboot flash boot boot.img

    当使用上述命令写入编译的Image时,fastboot做了些什么?基于那些信息把Image写到哪里呢?

    Android的每一款产品,都有一个partition.xml描述,有关分区的信息。下面是一个例子。

2. eMMC 分区表

Partition# Name# Size# Strat LBA-End LBR Description#
0 MBR & GPT   0x00000000-0x000000FF Master Boot Record and GUID Partition Table
1 x-loader(MLO) 256KB 0x00000100-0x000001FF First stage bootloader
2 bootloader(u-boot.bin) 384KB 0x00000200-0x000005FF Second stage bootloader
3 misc 128KB 0x00000600-0x000006FF Reserved.This partition can be used for internal purpose
4 recovery (zImage + recovery-ramdisk.img) 8MB 0x00000A00-0x000049FF recovery partition
5 boot (boot.img = zImage + ramdisk.img) 8MB 0x00004A00-0x000089FF Partition contains kernel + ramdisk images.
6 system (system.img) 256MB 0x00008A00-0x000889FF android file system
7 cache (cache.img) 32MB 0x00088A00-0x000989FF Partition will be used to store application cache
8 userdata (userdata.img) 32MB 0x00098A00-0x000A89FF Partition contains userdata supplied by oem vendor like configuration files,utilities etc..
9 media Remaining 0x000A8A00-0x00762761 Partition contains media files; supplied by oem vendor
 

    这是一个TI芯片的分区表 http://processors.wiki.ti.com/index.php/Android_gingerbread_eMMC_booting

    分区表定义了每个分区的起始地址和大小。Partition 0存放了所有的分区信息。

    不同的硬件可以根据需要调整相应的分区大小。TI和Qcom平台采用的方式不同,但原理相同。

    手机Boot时,BootLoader(LK, uboot)从eMMC的第一个分区读取MBR信息,构建一个分区表。

3. 获取分区信息,烧写Image文件

      有了上一步构建的分区表,fastboot 可以查询 boot分区的起始地址,根据起始地址,fastboot可以调用eMMC写指令把Image文件烧写到相应的eMMC地址。



你可能感兴趣的:(Android eMMC 分区详解)