Root/mbr+fat.txt

1mbr structure. Size: 200.
2
3000 1b8 code or fat:
4    00 3 jump instruction
5    03 8 OEM name
6    0b 2 bytes per sector
7    0d 1 sectors per cluster
8    0e 2 reserved sectors (incl. boot sector, from boot sector)
9    10 1 number of fats
10    11 2 non fat32: number of entries in root directory
11    13 2 total number of sectors on disk if < 32MB
12    15 1 media descriptor (bit 2 set means removable)
13    16 2 non fat32: sectors per fat
14    18 2 sectors per track
15    1a 2 heads
16    1c 4 number of sectors before boot sector
17    20 4 number of sectors on disk, if > 32MB
18    24 xx 4 sectors per fat
19    28 xx 2 bit 0-4: active fat, bit 7 set: write to all fats.
20    2a xx 2 file system version number
21    2c xx 4 cluster number for root directory
22    30 xx 2 sector number for FSInfo structure
23    32 xx 2 boot sector backup sector
24    34 xx c reserved
25    40 24 1 drive number
26    41 25 1 current head (dos internal)
27    42 26 1 boot signature (with 0x29, the next 3 fields are valid)
28    43 27 4 volume id
29    47 2b b volume label
30    52 36 8 file system type "FAT16 " / "FAT32 " / ...
31    
321b8 004 disk signature
331bc 002 null
341be 010 partition 0
351ce 010 partition 1
361de 010 partition 2
371ee 010 partition 3
381fe 002 mbr signature: 55 aa.
39
40Partition structure. Size: 10.
41
420 1 bootable flag 00=no; 80=yes.
431 3 first sector in partition, chs
444 1 partition type
455 3 last sector in partition, chs
468 4 first sector in partition, lba
47c 4 number of sectors in partition, for lba
48
49CHS address. Size: 3.
50head = chs[0]
51sector = chs[1] & 0x3f
52cylinder = (chs[1] & 0xc0) << 2 | chs[2]
53
54Fat filesystem information sector. Size: 200.
55000 4 signature: 52 52 61 41
56004 1e0 unused
571e4 4 fsinfo signature: 72 72 41 61
581e8 4 number of free clusters
591ec 4 most recently allocated cluster
601f0 c reserved
611fc 2 unknown
621fe 2 boot record signature: 55 aa
63
64Directory entry. Size: 20.
6500 8 name
6608 3 extension
670b 1 attributes (00arshdv)
680c 1 0
690d 1 creation time: (milli?)seconds
700e 2 creation time: hour and minute
7110 2 creation date
7212 2 last accessed date
7314 2 cluster[31:16]
7416 2 time
7518 2 date
761a 2 cluster[15:0]
771c 4 file size
78
79long file name: stored in directory entries immediately before the 8.3 name (last entry is first part of name)
8000 1 ordinal field, bit 6 set means highest.
8101 a 5 unicode characters.
820b 1 attribute: 000rsh0v.
830c 1 0
840d 1 checksum of short filename.
850e c 6 unicode characters.
861a 2 0
871c 4 2 unicode characters.
88
89checksum is name[0] rotated 11 times, name[1] 10 times, etc and all added up.
90

Archive Download this file

Branches:
master



interactive