[TG01 ROM Development] cedesmith:
@hdubli

don't use sddl+, use short pins method, we don't know how much checking sddl+ skips.

i think you should name the file exactly as original .tsw file.

you could also try to rename .tsw to .enc or put .bin file on card to skip cheek.

smaller file size is normal if your imgfs is smaller then original.

to verify everything is ok do the following ( on new rom ):

tgtool -sp tg01-new.bin ttt
TGTool v1.3.18 copyright(c) 2010 cedesmith

11: Name:WMB1 0273-029C(050F4000-0565DFFF) unk:00000000
12: Name:WMB2 029D-066D(0565E000-0D44EFFF) unk:00000000
13: Name:WMB3 025A-0685(04DBB000-0D766FFF) unk:00000526

Part 00 OS 00000273-00000685 (050F4000-0D766FFF)

this is useful to that you get addresses in the file (050F4000, 0565E000, 0D44EFFF) witch i will use as example further.

open rom in your hex editor and goto 050F4000 you should see

E9 FD FF 00 after a big block of FF

00 00 00 00 till adders +1C0 where partition table is

at adress + 0x840 you should see MSFLSH50

this was the master boot record

goto 0565E000:

you should see F8 AC 2C 9D E3 D4 2B 4D BD 30 91 6E D8 4F 31 DC 01 imgfs signature and XPR close by, compression signature.

goto 0D44EFFF:

you should see at next byte ëþ.MSWIN4.1 flowed by TFAT32

this is fat partition where user data is stored.

use a file compare (i use total commander) to binary compare original rom and new rom

you should have a differenece at 0x20884 where is the size of imgfs in blocks and at 0x20894

then next difference should be after 50f4000 where mbr is.

you could do the same thing on the payload before merging on the rom:

NBInfo.exe TG01.OS-new.payload
NBInfo 2.1rc2

'TG01.OS-new.payload' has valid boot sector

Partition table:

Partition 0
-----------
File System: 0x20 (boot)
Start Sector: 0x00000002
Total Sectors: 0x000002fe
Boot indicator: 0x00
First Head: 0x02
First Sector: 0x01
First Track: 0x00
Last Head: 0x3f
Last Sector: 0x01
Last Track: 0x0b

Partition 1
-----------
File System: 0x23 (XIP RAM)
Start Sector: 0x00000300
Total Sectors: 0x00000700
Boot indicator: 0x00
First Head: 0x00
First Sector: 0x01
First Track: 0x0c
Last Head: 0x3f
Last Sector: 0x01
Last Track: 0x27

Partition 2
-----------
File System: 0x25 (imgfs)
Start Sector: 0x00000a00
Total Sectors: 0x0000f3c0
Boot indicator: 0x00
First Head: 0x00
First Sector: 0x01
First Track: 0x28
Last Head: 0x3f
Last Sector: 0x01
Last Track: 0x3f6

Partition 3
-----------
File System: 0x04 (FAT)
Start Sector: 0x0000fdc0
Total Sectors: 0x00025180
Boot indicator: 0x00
First Head: 0x00
First Sector: 0x01
First Track: 0x3f7
Last Head: 0x3f
Last Sector: 0x01
Last Track: 0x13c

Geometry: flash has 64 virtual heads

MSFLSH50 header found at offset 0x800
(0 Reserved Entries, 3 Flash Region Entries)

Flash Region Entry 0:
---------------------
Region type: XIP
Start phys. block: 0x00000000
Size in phys. blocks: 0x00000000
Size in log. blocks: 0x00000028 -> Size in sectors: 0x00000a00
Sectors per block: 0x00000040
Bytes per block: 0x00020000
Compact blocks: 0x00000000
-> Bytes per sector: 0x00000800

Flash Region Entry 1:
---------------------
Region type: READONLY_FILESYS
Start phys. block: 0x00000000
Size in phys. blocks: 0x00000000
Size in log. blocks: 0x000003cf -> Size in sectors: 0x0000f3c0
Sectors per block: 0x00000040
Bytes per block: 0x00020000
Compact blocks: 0x00000002
-> Bytes per sector: 0x00000800

Flash Region Entry 2:
---------------------
Region type: FILESYS
Start phys. block: 0x00000000
Size in phys. blocks: 0x00000000
Size in log. blocks: 0xffffffff -> Size in sectors: 0xffffffc0
Sectors per block: 0x00000040
Bytes per block: 0x00020000
Compact blocks: 0x00000002
-> Bytes per sector: 0x00000800

Searching for IMGFS signature...
Found IMGFS at byte 0x00500000 (sector 0x00000a00).

dwFSVersion: 00000001
dwSectorsPerHeaderBlock: 00000001
dwRunsPerFileHeader: 00000001
dwBytesPerHeader: 00000034
dwChunksPerSector: 00000020
dwFirstHeaderBlockOffset: 00000800
dwDataBlockSize: 00001000
szCompressionType: XPR
dwFreeSectorCount: 00023385
dwHiddenSectorCount: 00000040
dwUpdateModeFlag: 00000000
---

here mbr starts at 0, imgfs at 0x0A00*0x800=500000, and fat at 0xfdc0*0x800=7EE0000. notice 0xA00 and FDC0 in partition info output of nbinfo

plz check if all of the above are correct