doc:appunti:hardware:android_partitions
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
doc:appunti:hardware:android_partitions [2020/01/17 09:31] – [Web References] niccolo | doc:appunti:hardware:android_partitions [2020/01/17 12:24] – [The Scatter File] niccolo | ||
---|---|---|---|
Line 7: | Line 7: | ||
**eMMC Flash** combines NAND memory with a built-in controller, that handles most of the things you have to take care of when dealing with NAND flash. | **eMMC Flash** combines NAND memory with a built-in controller, that handles most of the things you have to take care of when dealing with NAND flash. | ||
+ | |||
+ | ===== The Scatter File ===== | ||
+ | |||
+ | A Scatter File is a .txt file which is used to describe **parts of flash memory** in an Android device which is running on a MediaTek’s ARM architecture. Usually, such files are needed at the time of flashing firmware using tools like the **SP Flash Tool**. | ||
+ | |||
===== EMMC Regions ===== | ===== EMMC Regions ===== | ||
- | **EMMC_BOOT_1** and **EMMC_USER** | + | **Embedded Multi-Media Controller** (eMMC) refers to a package consisting of both flash memory and a flash memory controller integrated into a single on-board chip. Device supports several hardware partitions, it is on-board and thus non removable. |
+ | |||
+ | * **BOOT** - one or more small partitions intended for boot firmware; eMMC 4.3 spec requires 2 boot partitions. | ||
+ | * **RPMB** - Replay Protected Memory Block - intended to store secure data (ie DRM content protection keys); eMMC 4.4 spec adds the requirement of an RPMB partition. | ||
+ | * **USER** - a large partition intended for general storage; eMMC 4.3 spec requires 1 user partition. | ||
+ | |||
+ | Into a **scatter file** you can see references to **region** labeled | ||
===== Inspecting partitions on the command line ===== | ===== Inspecting partitions on the command line ===== | ||
Line 53: | Line 64: | ||
</ | </ | ||
+ | The **mmcblk0** partition is actually the eMMC **USER** region, sized 15388672 blocks (15028 Mb). It is in turn partitioned in 23 partitions. The **boot0**, **boot1** and **rpmb** partitions have a size of 4096 blocks each, i.e. **4194304 (0x400000) bytes**. | ||
==== sgdisk ==== | ==== sgdisk ==== | ||
Line 58: | Line 70: | ||
< | < | ||
- | sgdisk --print / | + | sgdisk --print / |
Disk / | Disk / | ||
Logical sector size: 512 bytes | Logical sector size: 512 bytes | ||
Line 93: | Line 105: | ||
</ | </ | ||
+ | Doing the math, you can see that the 23 partitions existing in **mmcblk0** leave some space: One is at the begin, sized 1024 sectors or **524288 (0x80000) bytes**. The other unpartitioned space is at the end, the size can be calculated by the difference of size shown by '' | ||
==== / | ==== / | ||
- | The partition **/ | + | The partition **/ |
The actual Linux device content starts with the characters **EMMC_BOOT**. It seems that it is an header of **2048 (0x800) bytes** and the actual preloader follows that header. FIXME Some stock ROMs include the preloader image, without that header. But if you readback the preloader partition using **SP Flash Tool**, you get an image with that heder included. | The actual Linux device content starts with the characters **EMMC_BOOT**. It seems that it is an header of **2048 (0x800) bytes** and the actual preloader follows that header. FIXME Some stock ROMs include the preloader image, without that header. But if you readback the preloader partition using **SP Flash Tool**, you get an image with that heder included. | ||
Line 102: | Line 115: | ||
* **[[http:// | * **[[http:// | ||
* **[[http:// | * **[[http:// | ||
+ | * **[[http:// |