doc:appunti:hardware:android_partitions
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
doc:appunti:hardware:android_partitions [2020/01/17 09:55] – [NAND Flash vs eMMC Flash] niccolo | doc:appunti:hardware:android_partitions [2020/01/17 12:37] – [The Scatter File] niccolo | ||
---|---|---|---|
Line 9: | Line 9: | ||
===== The Scatter File ===== | ===== 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 MTK chipeset. Usually, such files are needed at the time of flashing firmware using tools like the **SP Flash Tool**. | ||
+ | |||
+ | Here it is an **excerpt** of a scatter file, showing **where** to **flash** or **readback** the **recovery partition**: | ||
+ | |||
+ | < | ||
+ | - partition_index: | ||
+ | partition_name: | ||
+ | file_name: recovery.img | ||
+ | is_download: | ||
+ | type: NORMAL_ROM | ||
+ | linear_start_addr: | ||
+ | physical_start_addr: | ||
+ | partition_size: | ||
+ | region: EMMC_USER | ||
+ | storage: HW_STORAGE_EMMC | ||
+ | boundary_check: | ||
+ | is_reserved: | ||
+ | operation_type: | ||
+ | reserve: 0x00 | ||
+ | </ | ||
+ | |||
+ | The most important data is **linear_start_addr** and **physical_start_addr** (which are always the same, or not?) that states the starting point of that partition into the flash memory, and **partition_size** which is obviously its lenght. | ||
+ | |||
+ | The **SP Flash Tool** program - when performing a // | ||
===== EMMC Regions ===== | ===== EMMC Regions ===== | ||
Line 60: | Line 85: | ||
</ | </ | ||
+ | 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 65: | Line 91: | ||
< | < | ||
- | sgdisk --print / | + | sgdisk --print / |
Disk / | Disk / | ||
Logical sector size: 512 bytes | Logical sector size: 512 bytes | ||
Line 100: | Line 126: | ||
</ | </ | ||
+ | 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 109: | Line 136: | ||
* **[[http:// | * **[[http:// | ||
* **[[http:// | * **[[http:// | ||
+ | * **[[http:// |