Milestone partitions

Just like a desktop computer's hard disk, the Milestone's Flash RAM is divided in partitions called CG's (Code or Content Groups). The list of CG's in a system is called CDT (Code Description Table?), and it is analogous to the partition table on a PC. The CDT itself is stored in a CG.

During the firmware flashing process, a SBF file that contains one or more CG's is used to update the Flash RAM contents accordingly. The CDT table (which is located within CG31) determines which NAND parts have to be checked for signatures. It is very different from the Droid's, of course1). The following tables show the CDT contents2).

CDT Table of Milestone / Titanium

Link3)NameSigned?CG_numCG_namesignature_typestart_addr4)end_addrbase_addrsig_start_addrsig_end_addr
mbmloader.imgRamloaderYes (OMAP security)63mbmloader00x000000000x000200000x870007800x8701ff800x8702077f
mbm.imgMotorola Boot ManagerYes (Motorola CSF/HAB)30mbm00x000200000x000c00000x8f3100000x8f34f8000x8f34ffff
mbmbackup.imgMBM backup (identical to MBM)no55mbmbackup00x000c00000x001600000xffffffff0xffffffff0xffffffff
bploader.imgBaseband software boot loaderNo56bploader00x001600000x001c00000xffffffff0xffffffff0xffffffff
cdt.binMEM_MAP / CDT TableYes31cdt.bin10x001c00000x002200000x8f0700000x8f0738000x8f073fff
pdsfs.imgYaffs2 image mounted as /etc/pdsNo38pds00x002200000x003a00000xffffffff0xffffffff0xffffffff
lblLinux Boot LoaderYes34lbl10x003a00000x004000000x80d000000x80d038000x80d03fff
lbl_backup.imgLBL BackupYes57lbl_backup10x004000000x004600000x80d000000x80d038000x80d03fff
cid No43cid00x004600000x004c00000xffffffff0xffffffff0xffffffff
spSee note (*)No41sp00x004c00000x006400000x8f0b00000x8f1af8000x8f1affff
devtree Yes61devtree10x006400000x006a00000x8f0900000x8f0af8000x8f0affff
logo.binBoot LogoYes42logo.bin00x006a00000x007400000x8ee700000x8eeaf8000x8eeaffff
misc.img Yes44misc00x007400000x007a00000xffffffff0xffffffff0xffffffff
boot.imgAndroid boot imageYes35boot10x007a00000x00b200000x811000000x813bf8000x813bffff
bpsw baseband/gps sw Yes45bpsw20x00b200000x00ee00000x641000000x643ff8000x643fffff
recoveryAndroid RecoveryYes47recovery10x00ee00000x013600000x811000000x814bf8000x814bffff
cdrom No5)33cdrom50x013600000x01c800000x820000000x827df8000x827dffff
system.imgAndroid /systemNo6)39system50x01c800000x0cc800000x820000000x8ca1f8000x8ca1ffff
cacheAndroid /cacheNo40cache00x0cc800000x136800000xffffffff0xffffffff0xffffffff
userdataAndroid /dataNo37userdata00x136800000x1fba00000xffffffff0xffffffff0xffffffff
custAndroid /system/etc/motorolaNo7)36cust50x1fba00000x1fd800000x820000000x8211f8000x8211ffff
kpanickernel panic dumpNo53kpanic00x1fd800000x1ff800000xffffffff0xffffffff0xffffffff
rsvReserved blockNo54rsv00x1ff800000x200000000xffffffff0x000000000x00000000

CDT Table of Droid X

LinkNameSigned?CG_numCG_namesignature_typestart_addr8)end_addrbase_addrsig_start_addrsig_end_addr
mbr Yes (OMAP security)64mbr00x000000000x00020000
mbmloader.imgRamloaderYes (OMAP security)63mbmloader00x000200000x00040000
mbm.imgMotorola Boot ManagerYes (Motorola CSF/HAB)30mbm00x000800000x00100000
mbmbackup.imgMBM backup (identical to MBM)no55mbmbackup00x001000000x00180000
ebrebrNo65ebr00x001800000x00200000
bploader.imgBaseband software boot loaderNo56bploader00x002000000x00280000
cdt.binMEM_MAP / CDT TableYes31cdt.bin10x002800000x00300000
pdsfs.imgYaffs2 image mounted as /etc/pdsNo38pds00x003000000x00700000
lblLinux Boot LoaderYes34lbl10x007000000x00780000
lbl_backup.imgLBL BackupYes57lbl_backup10x008000000x00900000
cid No43cid00x025800000x02600000
sp No41sp00x009000000x00b00000
devtree Yes61devtree10x00b000000x00b80000
devtree_backup Yes62devtree_backup10x00b800000x00c00000
logo.binBoot LogoYes42logo.bin00x008000000x00900000
misc.img Yes44misc00x025000000x02580000
boot.imgAndroid boot imageYes35boot10x010000000x01400000
bpsw baseband/gps sw Yes45bpsw20x00b200000x00ee0000
recoveryAndroid RecoveryYes47recovery10x014000000x01900000
cdrom No9)33cdrom50x019000000x02500000
system.imgAndroid /systemNo10)39system50x02a000000x01420000
cacheAndroid /cacheNo40cache00x0cc800000x13680000
userdataAndroid /dataNo37userdata00x200000000x40000000
kpanickernel panic dumpNo53kpanic00x026000000x02a00000

CDT Table of Milestone 2

LinkNameSigned?CG_numCG_namesignature_typestart_addr11)end_addrbase_addrsig_start_addrsig_end_addr
mbrMaster Boot RecordYes (OMAP security)64mbr10xb00000000xb001ffff 0x830038000x83003fff
mbmloaderRamloaderYes (OMAP security)63mbmloader00xb00200000xb003ffff 0x8701ff800x8702077f
mbmMotorola Boot ManagerYes (Motorola CSF/HAB)30mbm00xb00800000xb00fffff 0x8934f8000x8934ffff
mbmbackupMBM backup (identical to MBM) 55mbmbackup00xb01000000xb017ffff 0xffffffff0xffffffff
ebrebr 65ebr10xb01800000xb01fffff 0x830138000x83013fff
bploaderBaseband software boot loader 56bploader00xb02000000xb027ffff 0xffffffff0xffffffff
cdt.binMEM_MAP / CDT TableYes31cdt.bin10xb02800000xb02fffff 0x890738000x89073fff
pdsYaffs2 image mounted as /etc/pds 38pds00xb03000000xb06fffff 0xffffffff0xffffffff
lblLinux Boot LoaderYes34lbl10xb07000000xb077ffff 0x80d038000x80d03fff
lbl_backupLBL BackupYes57lbl_backup10xb07800000xb07fffff 0x80d038000x80d03fff
logo.binBoot Logo 42logo.bin00xb08000000xb08fffff 0x86f6f8000x86f6ffff
sp 41sp00xb09000000xb0afffff 0x892af8000x892affff
devtree Yes61devtree10xb0b000000xb0b7ffff 0x8910f8000x8910ffff
devtree_backup Yes62devtree_backup10xb0b800000xb0bfffff 0x8910f8000x8910ffff
bpswbaseband/gps swYes45bpsw20xb0c000000xb10fffff 0x644ff8000x644fffff
bootAndroid boot imageYes35boot10xb11000000xb18fffff 0x818ff8000x818fffff
recoveryAndroid RecoveryYes47recovery10xb19000000xb20fffff 0x818ff8000x818fffff
cdrom NO33cdrom50xb21000000xb2efffff 0x8bdbf8000x8bdbffff
misc 44misc00xb2f000000xb2f7ffff 0xffffffff0xffffffff
cid 43cid00xb2f800000xb2ffffff 0xffffffff0xffffffff
kpanickernel panic dump 53kpanic00xb30000000xb33fffff 0xffffffff0xffffffff
systemAndroid /system 39system50xb34000000xc7afffff 0x9efbf8000x9efbffff
prek 32prek10xc7b000000xc7b7ffff 0x8a71f8000x8a71ffff
pkbackup 46pkbackup10xc7b800000xc7bfffff 0x8a71f8000x8a71ffff
cacheAndroid /cache 40cache00xc7c000000xd43fffff 0xffffffff0xffffffff
preinstallUSB Windows Driver 66preinstall00xd44000000xe43fffff 0xffffffff0xffffffff
userdataAndroid /data 37userdata00xe44000000xefffffff 0xffffffff0xffffffff
Note(*)
cg41(sp)isn't signed (it's seen from cdt), but it contains some interesting stuff:
1) copy of cdt from offset 0x14.
2) some records for every code group with 5th signature type: cdrom (started from offset 0x60000), system (0x80000), cust (0xa0000). these records contain signature, cg description from cdt and some other unknown info. every element of sp has header that contains strings (or may be values) like rrrA, ip*2, CDTV, OTVV, etc). these headers are built with mbm and the whole sp code group seems to be filled with mbm.
(according to cdt…sp has a signature, but the signature_type is 0. we don't know if mbm will check) (signature_type 0 means means that code group isn't checked by mbm, btw logo.bin also haven't signature. Every cdt description that contains starting address, contains also signature adresses. But you can check sp or logo.bin - these cgs doesn't contain any signature on the address from cdt.)
3) type 1 signatures on CGs are checked on each boot by mbm
4) comment by yakk regarding the meaning of type 5 signature for CGs: “ramdld stores special mark to sp code group after flashing system and mbm checks signature during first boot after flashing and reset that mark, and store some info (the signature itself in moto format, and some other)”.

Extracting partitions

Method, which use right ecc correction

You need kernel module and mtd-utils. Here you can download precompiled mtd-utils and kernel module, with sources. mtd-utils.tar.bz2

insmod mtd_dumpall.ko
echo "0 64" > /proc/mtd_dumpall
cat /proc/mtd_dumpall > /tmp/mtd0.bin

The result is in ASCII format where ^d[^:]+ denotes data lines and ^o[^:]+ denotes OOB data. Each data line have 0x20 ASCII hex.

To transform them to binary:

grep ^d | xxd -r -c 0x20 > out.bin

or just try use nanddump directly

janneg_'s kernel module

After booting into Linux, some of these partitions are available through MTD devices (/dev/mtd*). But other partitions are not available because the Linux kernel provided by Motorola does not map them into MTD devices. janneg_ has created a kernel module that maps them all, thus enabling us to extract anything from the Milestone's Flash. You can try a precompiled binary here if you don't want to compile it yourself.

MOTOMAGX Backup

There's a tool called MotoMagX Backup that is used on MotoMagX phones to retrieve the CGs from the phone via USB, and even though Milestone is NOT a MotoMagX phone it has several similarities with that technology. This tool, MotoMagxBackup v0.01, has been tested with the Milestone by MauiMauer. The tool recognizes the Milestone connected via USB, sends the ramloader program that is run in the phone's RAM, but then the phone locks up and needs to have its battery removed (phone return ERR: 0x85 - which means unknown command).

Milestone RAMDLDs don't have READ command handler that is used by MMBackup. The MBM itself has that handler, but it doesn't work and hangs the phone if use it with correct parameters.

1) See here for a copy of the Droid's CDT table
2) compiled by [mbm] and vekexasia based on raw data and on OpenEZX Wiki. Reformatted by karmapolis.
3) the links are for Milestone dumps
4) comment by [mbm]: “subtract the base address from the signature start/end to get the offsets in the mtd files”
5) , 6) , 7) , 9) , 10) checked once right after flashing image from SBF
8) , 11) comment by [mbm]: “subtract the base address from the signature start/end to get the offsets in the mtd files”
 
partitions/cdt.txt · Last modified: 2011/08/04 02:39 by martinllanos
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki