[Galaxy Note GT-N7000 Android Development] metalgearhathaway:
How to make your own custom PIT File

@TenzoNakami~ and all users wanting to continue this work for themselves and others :)

It is really easy, you simply have to be able to use a calculator and make sure you don't make an error putting the numbers in!

Download PitMagic from here: http://xdaforums.com/showthread.php?t=1916936

You are warned, if you do not feel comfortable doing this, please do not even try! It is only basic mathematics and everyone has access to a calculator, so no excuses and no contacting me if you make horrible mistakes! I am not being cruel here, if you get it wrong, then it means that you did something wrong, plain and simple, so be careful, triple check your sums! Even sleep on it and check the next day to be sure after a good nights sleep :)

How to make a custom PIT File

To work out your new values the following applies:

1) 1GB = 2,097,152 blocks (512mb is half that value etc.)

2) The Block Size and Block Count of the previous section equals the value you enter for the next sections Block Size Value

3) The Block Count is the amount of space you are allocating to that section

4) The partitions you may want to work with are:

a) FactoryFS - This is the system partition where your rom installs to

b) DATAFS - This is the application partition where all your user installed apps will install to

c) UMS - This is the partition that will be your internal SD card space, i.e. where you might place photos and music

d) HIDDEN - This is the partition that some roms will use as preload, some roms use lots, some a little and some not at all!

e) All other sections should remain untouched!

5) You MUST make sure that your values all add up to the total available space available, that value is the Block Size & Block Count added together from the Hidden partition entry towards the bottom of the pit file!

6) Take a look at the example below and you will now see that as you go down the partitions the block size and block count of a section equals the next sections block count value, everything adds up as you work down the list! By now you should be either understanding how this works, if you are not then my advice is go and do something fun instead and forget you read this :)

EXAMPLE:

This my n7000 pit file that has 2gb System (Factoryfs), 3gb data (DATAFS) and 512mb preload (HIDDEN) Ignore all that is shown in RED and only play with stuff coloured in GREEN!

----------------------------------------------------------

PIT Magic v1.3.10 Copyright © Gaz 2012.

----------------------------------------------------------

Analysis for: n7000 16gb variant - 2gb System - 3gb data - 512mb Preload.pit

----------------------------------------------------------

----------------------------------------------------------

<<< Pit File Start >>>

----------------------------------------------------------

----------------------------------------------------------

<<< PIT File Header Information >>>

----------------------------------------------------------

Header Magic: 0x12349876 (4 Bytes)

Entry Count: 15 (4 Bytes)

----------------------------------------------------------

Dummy Data #1 (In String and Hexadecimal Format):

----------------------------------------------------------

String:

Hexadecimal: 00000000

----------------------------------------------------------

Dummy Data #2 (In String and Hexadecimal Format):

----------------------------------------------------------

String:

Hexadecimal: 00000000

----------------------------------------------------------

Dummy Data #3 (In String and Hexadecimal Format):

----------------------------------------------------------

String:

Hexadecimal: 00000000

----------------------------------------------------------

Dummy Data #4 (In String and Hexadecimal Format):

----------------------------------------------------------

String:

Hexadecimal: 00000000

----------------------------------------------------------

Dummy Data #5 (In String and Hexadecimal Format):

----------------------------------------------------------

String:

Hexadecimal: 00000000

----------------------------------------------------------

Dummy Data Length: (4 Bytes Per Block, 20 Bytes In Total.)

----------------------------------------------------------

Header Size: (28 Bytes)

----------------------------------------------------------

<<< PIT File Entries >>>

----------------------------------------------------------

----------------------------------------------------------

Entry Memory Address: 0x1C

----------------------------------------------------------

Binary Type: 0 (UNKNOWN)

Device Type: 2 (MMC)

Identifier: 0

Attribute: 0 (READ ONLY)

Update Attribute: 0 (UNKNOWN)

Block Size:

Block Count:

File Offset (Obsolete): 0

File Size (Obsolete): 0

Partition Name: GANG

Flash FileName: emmc.img

FOTA FileName:

----------------------------------------------------------

Entry Memory Address: 0xA0

----------------------------------------------------------

Binary Type: 0 (UNKNOWN)

Device Type: 2 (MMC)

Identifier: 1

Attribute: 0 (READ ONLY)

Update Attribute: 0 (UNKNOWN)

Block Size:

Block Count:

File Offset (Obsolete): 0

File Size (Obsolete): 0

Partition Name: BOOT

Flash FileName: boot.bin

FOTA FileName:

----------------------------------------------------------

Entry Memory Address: 0x124

----------------------------------------------------------

Binary Type: 0 (UNKNOWN)

Device Type: 2 (MMC)

Identifier: 4

Attribute: 1 (READ / WRITE)

Update Attribute: 0 (UNKNOWN)

Block Size: 8,192

Block Count: 40,960

File Offset (Obsolete): 0

File Size (Obsolete): 0

Partition Name: EFS

Flash FileName: efs.img

FOTA FileName:

----------------------------------------------------------

Entry Memory Address: 0x1A8

----------------------------------------------------------

Binary Type: 0 (UNKNOWN)

Device Type: 2 (MMC)

Identifier: 2

Attribute: 0 (READ ONLY)

Update Attribute: 0 (UNKNOWN)

Block Size: 49,152

Block Count: 2,560

File Offset (Obsolete): 0

File Size (Obsolete): 0

Partition Name: SBL1

Flash FileName: Sbl.bin

FOTA FileName:

----------------------------------------------------------

Entry Memory Address: 0x22C

----------------------------------------------------------

Binary Type: 0 (UNKNOWN)

Device Type: 2 (MMC)

Identifier: 3

Attribute: 0 (READ ONLY)

Update Attribute: 0 (UNKNOWN)

Block Size: 53,248

Block Count: 2,560

File Offset (Obsolete): 0

File Size (Obsolete): 0

Partition Name: SBL2

Flash FileName:

FOTA FileName:

----------------------------------------------------------

Entry Memory Address: 0x2B0

----------------------------------------------------------

Binary Type: 0 (UNKNOWN)

Device Type: 2 (MMC)

Identifier: 5

Attribute: 0 (READ ONLY)

Update Attribute: 0 (UNKNOWN)

Block Size: 57,344

Block Count: 16,384

File Offset (Obsolete): 0

File Size (Obsolete): 0

Partition Name: PARAM

Flash FileName: param.lfs

FOTA FileName:

----------------------------------------------------------

Entry Memory Address: 0x334

----------------------------------------------------------

Binary Type: 0 (UNKNOWN)

Device Type: 2 (MMC)

Identifier: 6

Attribute: 0 (READ ONLY)

Update Attribute: 0 (UNKNOWN)

Block Size: 73,728

Block Count: 16,384

File Offset (Obsolete): 0

File Size (Obsolete): 0

Partition Name: KERNEL

Flash FileName: zImage

FOTA FileName:

----------------------------------------------------------

Entry Memory Address: 0x3B8

----------------------------------------------------------

Binary Type: 0 (UNKNOWN)

Device Type: 2 (MMC)

Identifier: 7

Attribute: 0 (READ ONLY)

Update Attribute: 0 (UNKNOWN)

Block Size: 90,112

Block Count: 16,384

File Offset (Obsolete): 0

File Size (Obsolete): 0

Partition Name: RECOVERY

Flash FileName:

FOTA FileName:

----------------------------------------------------------

Entry Memory Address: 0x43C

----------------------------------------------------------

Binary Type: 0 (UNKNOWN)

Device Type: 2 (MMC)

Identifier: 8

Attribute: 1 (READ / WRITE)

Update Attribute: 0 (UNKNOWN)

Block Size: 106,496

Block Count: 409,600

File Offset (Obsolete): 0

File Size (Obsolete): 0

Partition Name: CACHE

Flash FileName: cache.img

FOTA FileName:

----------------------------------------------------------

Entry Memory Address: 0x4C0

----------------------------------------------------------

Binary Type: 0 (UNKNOWN)

Device Type: 2 (MMC)

Identifier: 9

Attribute: 0 (READ ONLY)

Update Attribute: 0 (UNKNOWN)

Block Size: 516,096

Block Count: 32,768

File Offset (Obsolete): 0

File Size (Obsolete): 0

Partition Name: MODEM

Flash FileName: modem.bin

FOTA FileName:

----------------------------------------------------------

Entry Memory Address: 0x544

----------------------------------------------------------

Binary Type: 0 (UNKNOWN)

Device Type: 2 (MMC)

Identifier: 10

Attribute: 1 (READ / WRITE)

Update Attribute: 0 (UNKNOWN)

Block Size: 548,864

Block Count: 4,194,304

File Offset (Obsolete): 0

File Size (Obsolete): 0

Partition Name: FACTORYFS

Flash FileName: factoryfs.img

FOTA FileName:

----------------------------------------------------------

Entry Memory Address: 0x5C8

----------------------------------------------------------

Binary Type: 0 (UNKNOWN)

Device Type: 2 (MMC)

Identifier: 11

Attribute: 1 (READ / WRITE)

Update Attribute: 0 (UNKNOWN)

Block Size: 4,743,168

Block Count: 6,291,456

File Offset (Obsolete): 0

File Size (Obsolete): 0

Partition Name: DATAFS

Flash FileName: data.img

FOTA FileName:

----------------------------------------------------------

Entry Memory Address: 0x64C

----------------------------------------------------------

Binary Type: 0 (UNKNOWN)

Device Type: 2 (MMC)

Identifier: 12

Attribute: 2 (STL)

Update Attribute: 0 (UNKNOWN)

Block Size: 11,034,624

Block Count: 18,685,952

File Offset (Obsolete): 0

File Size (Obsolete): 0

Partition Name: UMS

Flash FileName: ums.rfs

FOTA FileName:

----------------------------------------------------------

Entry Memory Address: 0x6D0

----------------------------------------------------------

Binary Type: 0 (UNKNOWN)

Device Type: 2 (MMC)

Identifier: 13

Attribute: 1 (READ / WRITE)

Update Attribute: 0 (UNKNOWN)

Block Size: 29,720,576

Block Count: 1,048,576

File Offset (Obsolete): 0

File Size (Obsolete): 0

Partition Name: HIDDEN

Flash FileName: hidden.img

FOTA FileName:

----------------------------------------------------------

Entry Memory Address: 0x754

----------------------------------------------------------

Binary Type: 1 (COM. PROCESSOR)

Device Type: 1 (FILE / FAT)

Identifier: 9

Attribute: 0 (READ ONLY)

Update Attribute: 0 (UNKNOWN)

Block Size:

Block Count:

File Offset (Obsolete): 0

File Size (Obsolete): 0

Partition Name:

Flash FileName:

FOTA FileName:

----------------------------------------------------------

<<< Pit File End >>>

----------------------------------------------------------

Generated on: 02/03/2015 19:52:47

Next,how to input your values

1) First run pitmagic:

2) Click the PIT File Analysis tab and open one of my pit files and export to file and this will export a text file to the root of your pitmagic directory, open the document and make amendments and your calculation in there and double check you make no mistakes, you can then refer to that to enter the details into the main pit file editor tab!

3) Now that you have done that, on the pit file editor tab click open and select my pit file you are using as a base profile and then click save as and save it with a name of your own, now you are ready to start entering your values.

4) Navigate to the PIT Entry List pull down box to select the PIT Entry list address field you are going to alter.

5) Then enter the value for Block Size (which is the running total of memory allocated so far) and the Block Count (which is the value you are applying to the section.

6) Click save after each amendment!

7) Once you are done, go back to the pit file analysis tab and open you pit and export and check that the values were save correctly!

8) If you are happy, now try using your newly created pit file! :)

You are warned, if you do not feel comfortable doing this, please do not even try! It is only basic mathematics and everyone has access to a calculator, so no excuses and no contacting me if you make horrible mistakes! I am not being cruel here, if you get it wrong, then it means that you did something wrong, plain and simple, so be careful, triple check your sums! Even sleep on it and check the next day to be sure after a good nights sleep :)