LATEST   
Email

29 July, 2011

Free more available disk space from NAND - PART II

As to change the partition layout of the nand disk, we have to create the pit file ourself for custom partitions size. The pit file can be obtained by compiling a C file containing the partition info. Below shows part of the s1_odin_20100512.c provided by coolya

* /dev/block/stl1 - 6 omitted

{ 0, 0, 0x06, 0x00, 0, 256, 30, "", "KERNEL", "zImage"},
{ 0, 0, 0x07, 0x00, 0, 256, 30, "", "RECOVERY", "zImage"},
{ 0, 0, 0x16, 0x02, 0, 256, 1146, "", "FACTORYFS", "factoryfs.rfs"},
{ 0, 0, 0x17, 0x02, 0, 256, 536, "", "DBDATAFS", "dbdata.rfs"},
{ 0, 0, 0x18, 0x02, 0, 256, 140, "", "CACHE", "cache.rfs"},
{ 0, 0, 0x0b, 0x00, 0, 256, 50, "", "MODEM", "modem.bin"},

The first entry is mapped as /dev/block/stl7 (/dev/block/bml7), and so forth. Thus MODEM will be mapped to /dev/block/stl12 (/dev/block/bml12). For the meaning of each of the column above, we have to refer to the structure listed below from the C file:

unsigned int _00; /* unknown. set to 1 is entry unused */
unsigned int _04; /* unknown. set to 1 is entry unused */
unsigned int partid; /* partition ID */
unsigned int flags; /* flags. 0x 00= RO, 0x02=R/W */
unsigned int _14; /* unknown */
unsigned int blocksize; /* blocksize in 512 byte units */
unsigned int partsize; /* partition size in blocks */
char _20[8]; /* unknown */
char partname[32]; /* partition name */
char filename[64]; /* filename */

Take the CACHE partition as example, the partition info stated in s1_odin_20100512.c reads:

{ 0, 0, 0x18, 0x02, 0, 256, 140, "", "CACHE", "cache.rfs"}

That is to say, the properties of the CACHE partition should be, starts from column one:
0 - the partition is being used
0 - the partition is being used
0x18 - the partition ID
0x02 - the partition allows read/write
0 - (unknown)
256 - blocksize
140 - partition size
"empty" - (unknown)
CACHE - the partition is known as CACHE
cache.rfs - the file to be filled


Normally, we only need to deal with columns 1, 2, 4, 7, 9 and 10:
- column 1 and 2: set to 0 to mark this partition usable
- column 4: set to 0x02 for both read/write accesses
- column 7: set this to 140 units (or 35MB) for this partition, where 140 x 256 / 1024 = 35MB, ie each unit = 0.25MB
- column 9: set this as CACHE for internal reference
- column 10: set the filename required for filling this partition

So for the KERNEL or /dev/block/stl7 (/dev/block/bm7):

{ 0, 0, 0x06, 0x00, 0, 256, 30, "", "KERNEL", "zImage"}

means that this partition is known as KERNEL, with 7.5MB disk space allocated, and the required file is zImage



read more:
Free more available disk space from NAND - PART I
freeNANDmod - get more space from NAND - PART III
freeNANDmod - get more space from NAND - PART IV

Facebook Comments
0 Blogger Comments
Facebook Comments by Blogger Widgets

0 comments:

Loading