Technical information
© Jean Louis-Guérin – V1.2a – September 2014 Page 59 / 69
Directory entries, both in the Root Directory region and in subdirectories, are of the following format:
Byte
Offset
Length
Description
0x00
8
DOS file name (padded with spaces). The first byte can have the following special values:
0x00 Entry is available and no subsequent entry is in use
0x05 Initial character is actually 0xE5.
0x2E 'Dot' entry; either '.' or '..'
0xE5 Entry has been previously erased and is available.
0x08
3
DOS file extension (padded with spaces)
0x0b
1
File Attributes
Bit Mask Description
0 0x01 Read Only
1 0x02 Hidden
2 0x04 System
3 0x08 Volume Label
4 0x10 Subdirectory
5 0x20 Archive
6 0x40 Device (internal use only, never found on disk)
7 0x80 Unused
An attribute value of 0x0F is used to designate a long file name entry.
0x0c
1
Reserved
0x0d
1
Create time, fine resolution: 10ms units, values from 0 to 199.
0x0e
2
Create time. The hour, minute and second are encoded according to the following bitmap:
Bits Description
15-11 Hours (0-23)
10-5 Minutes (0-59)
4-0 Seconds/2 (0-29)
Note that the seconds is recorded only to a 2 second resolution. Finer resolution for file
creation is found at offset 0x0d.
0x10
2
Create date. The year, month and day are encoded according to the following bitmap:
Bits Description
15-9 Year (0 = 1980, 127 = 2107)
8-5 Month (1 = January, 12 = December)
4-0 Day (1 - 31)
0x12
2
Last access date; see offset 0x10 for description.
0x14
2
EA-Index in FAT12 and FAT16. High 2 bytes of first cluster number in FAT32
0x16
2
Last modified time; see offset 0x0e for description.
0x18
2
Last modified date; see offset 0x10 for description.
0x1a
2
First cluster in FAT12 and FAT16. Low 2 bytes of first cluster in FAT32. Entries with the
Volume Label flag, subdirectory ".." pointing to root, and empty files with size 0 should
have first cluster 0.
0x1c
4
File size in bytes. Entries with the Volume Label or Subdirectory flag set should have a
size of 0.
Clusters are numbered from a cluster offset as defined above and the file_start_cluster is in 0x1a. This
means the first data segment can be calculated:
For FAT16/12:
File start sector = reserved sectors + (no of FAT * sectors per FAT) +
(max root entry * 32 / bytes per sector) +
((file start cluster − 2) * sectors per cluster)
For FAT32
File start sector = reserved sectors + (no of FAT * sectors per FAT) +
((file start cluster − 2) * Sectors per cluster)