Secure Digital SD Card Source Code Driver Project
Section 09. Layout Of A MMC or SD Card With FAT

09. Layout Of A MMC or SD Card With FAT

a) General Information

Note – this section of the manual is for information only. You do not need to read and understand this large and in depth section to use the driver! However you may want to if you wish to gain an understanding of disk access, the FAT filing system and how this driver works.

Terms used for hard disks and therefore MMC / SD memory cards

Remember when understanding these terms that hard disks uses multiple disks of magnetic material with a read/write head for each side of each disk. Bytes are read from and written to a disks surface in circular paths.

Track

The circular track on one surface of a disk (numbered 0 – #). This is not usually referred to.

Cylinder

All of the tracks in the same position on all of the surfaces (numbered 0 – #). This is not usually referred to other than when determining the parameters of a disk during initialisation.

Head

Each side of a disk has a read / write head (numbered 0 – #). This is not usually referred to other than when determining the parameters of a disk during initialisation.

Sector

This is the fundamental unit of disk mapping – all reading and writing to disks is carried out in sectors. A sector is usually 512 bytes in size, but can be 128 – 1024 bytes.

(Numbered as 1 – # (0 is reserved for identification purposes)).

Cluster

A cluster is a specified group of sectors. It is clusters that are the addressing unit when reading and writing files using the FAT system (i.e. a directory will point to a particular file using the cluster number that contains the start of the file). A cluster may only be used by one file, and large files will use multiple clusters to hold their data. A disk with a large cluster size (lots of sectors per cluster) will mean that disk space is wasted as any unused bytes after the end of a file in its final cluster will not be available for anything else. A disk with a small cluster size means less wastage. However, a small cluster size means a larger FAT table as a FAT table contains an entry for every cluster on a disk (or in the partition if the disk is partitioned), hence the need to FAT32 instead of FAT16 for larger volumes.

The valid range is 1 – 64 sectors per cluster. The first cluster that may be used is number 2 (clusters 0 & 1 are reserved).

The FAT filing system was developed for DOS and DOS thinks of a disk as a linear object, not as it is actually constructed. This means that DOS treats the sectors of a disk as a sequential list of sectors, from the first on the disk to the last. Whilst this made things more complex when writing drivers for hard disks, it makes things easier when dealing with modern flash memory cards as these are linear memory objects.

Byte Ordering

The FAT file system uses ‘little endian’. That is that the first byte read is the least significant byte of a large value, the next byte read is more significant than the last and so on. For example this is how a 32bit value would be stored (with the bit numbers shown):-

byte[3] 31 30 29 28 27 26 25 24 //This is the last byte read from the disk

byte[2] 23 22 21 20 19 18 17 16

byte[1] 15 14 13 12 11 10 09 08

byte[0] 07 06 05 04 03 02 01 00 //This is the first byte read from the disk

The following sections show how the different sections of a disk are organised for FAT16 and FAT32, looking at the disk as a linear memory object (which is how it is addressed). See the following sections for an in depth description of each block.

The Layout of a FAT16 Volume

Start Address Size Contents
0×00000000 512 bytes Master Boot Record

(Amongst other things this specifies the address of each of the main partitions).

Partition Start Address + 0 512 bytes Partition 1 -

The Boot Record. Located in the first sector of a partition.

Partition Start Address + 512 As specified in the Boot Record Partition 1 -

FAT table 1

Partition Start Address + 512

+ (Size of FAT Table x (FAT table # – 1))

(*Note 1)

As specified in the Boot Record Partition 1 -

FAT table # (specified by ‘Number of Copies of FAT’ in master boot record. A value of 2 is normal)

Partition Start Address + 512 + (Size of FAT Table x Number of Copies of FAT) As specified in the Boot Record Partition 1 -

Root directory

Partition Start Address + 512 + (Size of FAT Table x Number of Copies of FAT)

+ Size of Root Directory

Calculated from the Master Boot Record Total Partition Size Partition 1 -

Data area for files and other directories.

(This area occupies the remainder of the disk, or the space to the start of the next partition).

Then follows further partitions if present:-

Start Address Size Contents
Partition Start Address + 0 512 bytes Partition 2 -

The Boot Record. Located in the first sector of a partition.

Partition Start Address + 512 As specified in the Boot Record Partition 2 -

FAT table 1

Partition Start Address + 512

+ (Size of FAT Table x (FAT table # – 1))

(*Note 1)

As specified in the Boot Record Partition 2 -

FAT table # (specified by ‘Number of Copies of FAT’ in master boot record. A value of 2 is normal)

Partition Start Address + 512 + (Size of FAT Table x Number of Copies of FAT) As specified in the Boot Record Partition 2 -

Root directory

Partition Start Address + 512 + (Size of FAT Table x Number of Copies of FAT)

+ Size of Root Directory

Calculated from the Master Boot Record Total Partition Size Partition 2 -

Data area for files and other directories.

(This area occupies the remainder of the disk, or the space to the start of the next partition).

Repeated for each partition

Note1 – These cells may repeat or not be present at all.

The Layout of a FAT32 Volume

This is basically the same as for a FAT16 volume, but without the root directory included (and with each block using a different amount of space).

Start Address Size Contents
0×00000000 512 bytes Master Boot Record

(Amongst other things this specifies the address of each of the main partitions).

Partition Start Address + 0 512 bytes Partition 1 -

The Boot Record. Located in the first sector of a partition.

Partition Start Address + 512 As specified in the Boot Record Partition 1 -

FAT table 1

Partition Start Address + 512

+ (Size of FAT Table x (FAT table # – 1))

(*Note 1)

As specified in the Boot Record Partition 1 -

FAT table # (specified by ‘Number of Copies of FAT’ in master boot record. A value of 2 is normal)

Partition Start Address + 512 + (Size of FAT Table x Number of Copies of FAT) Calculated from the Master Boot Record Total Partition Size Partition 1 -

Data area for files and other directories.

(This area occupies the remainder of the disk, or the space to the start of the next partition).

Then if there is more than 1 partition, the additional partitions follow:-

Start Address Size Contents
Partition Start Address + 0 512 bytes Partition 2 -

The Boot Record. Located in the first sector of a partition.

Partition Start Address + 512 As specified in the Boot Record Partition 2 -

FAT table 1

Partition Start Address + 512

+ (Size of FAT Table x (FAT table # – 1))

As specified in the Boot Record Partition 2 -

FAT table # (specified by ‘Number of Copies of FAT’ in master boot record. A value of 2 is normal)

Partition Start Address + 512 + (Size of FAT Table x Number of Copies of FAT) Calculated from the Master Boot Record Total Partition Size Partition 2 -

Data area for files and other directories.

(This area occupies the remainder of the disk, or the space to the start of the next partition).

Repeated for each partition

*Note 1 – Shaded cells may repeat or not be present at all.

b) The Master Boot Record

The first sector of a hard disk is set aside for the Master Boot Record. This is operating system independent. It is located on the first Sector of the disk, at Cylinder 0, Head 0, Sector 1. It contains the partition table, which defines the different sections of your hard drive and if this section of a disk is corrupted it can mean that the disk is dead!

Note – if trying to view the master boot record using PC disk viewing software ensure that you have selected the correct section of the disk. Some software will show you the contents of the first partition by default, not the first sector containing the master boot record.

Byte

Value
0 0×0000 446 bytes of boot up executable code and data.
|| ||
445 0x01BD
446 0x01BE Offset 0×00 PARTITION 1 START

Current State of Partition (00h=Inactive, 80h=Active)

447 0x01BF Offset 0×01 Beginning of Partition – Head
448 0x01C0 Offset 0×02 Beginning of Partition – Cylinder/Sector
449 0x01C1 Offset 0×03
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Cylinder Bits 7 to 0 Cylinder Bits 9+8 Sector Bits 5 to 0
450 0x01C2 Offset 0×04 Type of Partition:

0×00 Unknown or Nothing
0×01 12-bit FAT
0×04 16-bit FAT (Partition Smaller than 32MB)
0×05 Extended MS-DOS Partition
0×06 16-bit FAT (Partition Larger than 32MB)
0x0B 32-bit FAT (Partition Up to 2048GB)
0x0C Same as 0x0B, but uses LBA 0×13 extensions
0x0E Same as 0×06, but uses LBA 0×13 extensions
0x0F Same as 0×05, but uses LBA 0×13 extensions

The above values relate to Microsoft operating systems – there are others.

LBA = Logical Block Addressing which uses the Int 0×13 extensions built into newer BIOS’s to access data above the 8GB barrier, or to access strictly in LBA mode, instead of CHS (Cylinder, Head, Sector).

451 0x01C3 Offset 0×05 End of Partition – Head
452 0x01C4 Offset 0×06 End of Partition – Cylinder/Sector
453 0x01C5 Offset 0×07
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Cylinder Bits 7 to 0 Cylinder Bits 9+8 Sector Bits 5 to 0
454 0x01C6 Offset 0×08 Number of sectors between the master boot record and the first sector in the partition.
455 0x01C7 Offset 0×09
456 0x01C8 Offset 0x0A
457 0x01C9 Offset 0x0B
458 0x01CA Offset 0x0C Number of sectors in the partition
459 0x01CB Offset 0x0D
460 0x01CC Offset 0x0E
461 0x01CD Offset 0x0F
462 0x01CE Offset 0×00 PARTITION 2 START

Current State of Partition (00h=Inactive, 80h=Active)

463 0x01CF Offset 0×01 Beginning of Partition – Head
464 0x01D0 Offset 0×02 Beginning of Partition – Cylinder/Sector
465 0x01D1 Offset 0×03 (Format as per partition 1)
466 0x01D2 Offset 0×04 Type of Partition (Format as per partition 1)
467 0x01D3 Offset 0×05 End of Partition – Head
468 0x01D4 Offset 0×06 End of Partition – Cylinder/Sector
469 0x01D5 Offset 0×07 (Format as per partition 1)
470 0x01D6 Offset 0×08 Number of sectors between the master boot record and the first sector in the partition.
471 0x01D7 Offset 0×09
472 0x01D8 Offset 0x0A
473 0x01D9 Offset 0x0B
474 0x01DA Offset 0x0C Number of sectors in the partition
475 0x01DB Offset 0x0D
476 0x01DC Offset 0x0E
477 0x01DD Offset 0x0F
478 0x01DE Offset 0×00 PARTITION 3 START

Current State of Partition (00h=Inactive, 80h=Active)

479 0x01DF Offset 0×01 Beginning of Partition – Head
480 0x01E0 Offset 0×02 Beginning of Partition – Cylinder/Sector
481 0x01E1 Offset 0×03 (Format as per partition 1)
482 0x01E2 Offset 0×04 Type of Partition (Format as per partition 1)
483 0x01E3 Offset 0×05 End of Partition – Head
484 0x01E4 Offset 0×06 End of Partition – Cylinder/Sector
485 0x01E5 Offset 0×07 (Format as per partition 1)
486 0x01E6 Offset 0×08 Number of sectors between the master boot record and the first sector in the partition.
487 0x01E7 Offset 0×09
488 0x01E8 Offset 0x0A
489 0x01E9 Offset 0x0B
490 0x01EA Offset 0x0C Number of sectors in the partition
491 0x01EB Offset 0x0D
492 0x01EC Offset 0x0E
493 0x01ED Offset 0x0F
494 0x01EE Offset 0×00 PARTITION 4 START

Current State of Partition (00h=Inactive, 80h=Active)

495 0x01EF Offset 0×01 Beginning of Partition – Head
496 0x01F0 Offset 0×02 Beginning of Partition – Cylinder/Sector
497 0x01F1 Offset 0×03 (Format as per partition 1)
498 0x01F2 Offset 0×04 Type of Partition (Format as per partition 1)
499 0x01F3 Offset 0×05 End of Partition – Head
500 0x01F4 Offset 0×06 End of Partition – Cylinder/Sector
501 0x01F5 Offset 0×07 (Format as per partition 1)
502 0x01F6 Offset 0×08 Number of sectors between the master boot record and the first sector in the partition.
503 0x01F7 Offset 0×09
504 0x01F8 Offset 0x0A
505 0x01F9 Offset 0x0B
506 0x01FA Offset 0x0C Number of sectors in the partition
507 0x01FB Offset 0x0D
508 0x01FC Offset 0x0E
509 0x01FD Offset 0x0F
510 0x01FE Boot signature (= 0xAA55)
511 0x01FF

c) The Boot Record

The first sector of a partition contains a boot record. There are differences between the FAT16 and FAT32 boot records.

FAT16

Offset Description
0×0000 Jump Code + NOP
0×0001
0×0002
0×0003 8 byte OEM Name
||
0x000A
0x000B Bytes Per Sector
0x000C
0x000D Sectors Per Cluster (Restricted to powers of 2 (1, 2, 4, 8, 16, 32…))
0x000E Reserved Sectors
0x000F
0×0010 Number of Copies of FAT. (A value of 2 is recommended – values other than 2 are possible by are not recommended by Microsoft)
0×0011 Maximum Root Directory Entries
0×0012
0×0013 Number of Sectors in Partition Smaller than 32MB
0×0014
0×0015 Media Descriptor (F8h for Hard Disks)
0×0016 Sectors Per FAT
0×0017
0×0018 Sectors Per Track
0×0019
0x001A Number of Heads
0x001B
0x001C Number of Hidden Sectors in Partition
0x001D
0x001E
0x001F
0×0020 Number of Sectors in Partition
0×0021
0×0022
0×0023
0×0024 Logical Drive Number of Partition
0×0025
0×0026 Extended Signature (29h)
0×0027 Serial Number of Partition
0×0028
0×0029
0x002A
0x002B 11 bytes of volume name of the partition
||
0×0035
0×0036 FAT Name (FAT16)
0x003E 448 bytes of executable code and data
||
0x01FD
0x01FE Boot signature (= 0xAA55)
0x01FF

FAT32

Offset Description
0×0000 Jump Code + NOP
0×0001
0×0002
0×0003 8 byte OEM Name
||
0x000A
0x000B Bytes Per Sector
0x000C
0x000D Sectors Per Cluster (Restricted to powers of 2 (1, 2, 4, 8, 16, 32…))
0x000E Reserved Sectors
0x000F
0×0010 Number of Copies of FAT. (A value of 2 is recommended – values other than 2 are possible by are not recommended by Microsoft)
0×0011 Maximum Root Directory Entries (not applicable for FAT32)
0×0012
0×0013 Number of Sectors in Partition Smaller than 32MB (not applicable for FAT32)
0×0014
0×0015 Media Descriptor (F8h for Hard Disks)
0×0016 Sectors Per FAT (not applicable for FAT32 – bigger field below)
0×0017
0×0018 Sectors Per Track
0×0019
0x001A Number of Heads
0x001B
0x001C Number of Hidden Sectors in Partition
0x001D
0x001E
0x001F
0×0020 Number of Sectors in Partition
0×0021
0×0022
0×0023
0×0024 Number of Sectors Per FAT
0×0025
0×0026
0×0027
0×0028 Flags:
0×0029 Bits 15:8 – Reserved

Bit 7 – 1 = FAT Mirroring is Disabled, only 1 FAT is active as specified in bits 3:0

0 = FAT Mirroring is Enabled into all FATs

Bits 6:4 – Reserved

Bits 3:0 – Number of active FAT (0-#). Only valid if mirroring disabled.

0x002A Version of FAT32 Drive (high byte = major version, low byte = minor version)
0x002B
0x002C Cluster Number of the Start of the Root Directory
0x002D (Usually 2, but not required to be)
0x002E
0x002F
0×0030 Sector Number of the File System Information Sector (Referenced from the start of the partition)
0×0031
0×0032 Sector Number of the Backup Boot Sector (Referenced from the start of the partition)
0×0033
0×0034 Reserved (12 bytes)
||
0x003F
0×0040 Logical Drive Number of Partition
0×0041 Unused
0×0042 Extended Signature (29h)
0×0043 Serial Number of Partition
0×0044
0×0045
0×0046
0×0047 11 byte volume name of the partition
||
0×0051
0×0052 8 byte FAT Name (FAT32)
||
0×0059
0x005A 420 bytes of executable code and data
||
0x01FD
0x01FE Boot Signature (= 0xAA55)
0x01FF

d) The FAT Tables

The FAT table (whether FAT16 or FAT32) contains an entry for every cluster on the disk (or partition if the disk is partitioned). Each entry is either 16 bits in size for FAT16, or 32bits in size for FAT32. The contents of an entry may be as follows:-

FAT16 Table Entry Values:-

0×0000 The cluster is free.

0×0001 Reserved

0×0002 – 0xFFF0 This cluster is used. The value indicates the next cluster number for the file.

0xFFF7 Cluster is bad

0xFFF8 – 0xFFFF EOC (End Of Clusterchain) (typically you should use 0xFFFF)

FAT32 Table Entry Values:-

0x#0000000 The cluster is free.

0×0001 Reserved

0×0002 – 0xFFF0 This cluster is used. The value indicates the next cluster number for the file.

0x#FFFFFF7 Cluster is bad

0x#FFFFFF8 – 0x#FFFFFFF EOC (End Of Clusterchain) (typically you should use 0x#FFFFFFF

(The top 4 bits are reserved and will not necessarily be zero. They must be ignored when reading a cluster number but maintained when writing a new value to an entry)

When a file is stored the first available free cluster is found from the FAT table and stored in the files directory entry (see later in this manual). The file is written to the cluster. If it doesn’t fit within the cluster then the next free cluster is found and the new cluster number is written in the previous clusters FAT table entry. This continues until the last cluster that is required for the file (which may be the first cluster if the file will fit within one cluster). The EOC marker is written to the FAT tables for the last cluster to indicate that no further clusters are used.

Therefore when reading a file the start cluster number is determined from the files entry in the directory the file is located in. Then the FAT table is used to find the next cluster that holds the next block of the files data, then the next etc. Whilst the EOC marker indicates that a cluster is the last cluster used to store a file, the exact file size is stored in the files directory entry so that the last used byte number of the file can be determined.

FAT16 FAT Table

Byte FAT Entry Value
0 0×0000 1 Reserved.
1 0×0001 Contains the media type value in the low 8 bits and all other bits are set to 1
2 0×0002 2 Reserved – set on format to the EOC marker. The top 2 bits may be used as ‘dirty volume’ flags:
3 0×0003
Bit 15 1 = volume is ‘clean’. 0 = volume is ‘dirty’ (the file system driver did not complete its last task properly and it would be good idea to run a disk checking program.
Bit 14 1 =no disk read/write errors were encountered. 0 = the file system driver encountered a disk I/O error on the volume the last time it was used, which indicates that some sectors may have gone bad on the volume. It would be a good idea to run a disk checking program.
4 0×0004 3 The FAT entry for the 1st cluster in the data area of the disk / partition
5 0×0005
6 0×0006 4 The FAT entry for the 2nd cluster in the data area of the disk / partition
7 0×0007
|| ||
# 0x#### # The FAT entry for the last cluster in the data area of the disk / partition
# 0x####

Byte address is (Partition Start Address + 512 + #)

FAT32 FAT Table

Byte FAT Entry Value
0 0×0000 1 Reserved. Contains the media type value in the low 8 bits and all other bits are set to 1
1 0×0001
2 0×0002
3 0×0003
4 0×0004 2 Reserved – set on format to the EOC marker. The top 2 bits may be used as ‘dirty volume’ flags:
5 0×0005
Bit 27 1 = volume is ‘clean’. 0 = volume is ‘dirty’ (the file system driver did not complete its last task properly and it would be good idea to run a disk checking program.
Bit 26 1 =no disk read/write errors were encountered. 0 = the file system driver encountered a disk I/O error on the volume the last time it was used, which indicates that some sectors may have gone bad on the volume. It would be a good idea to run a disk checking program.
6 0×0006
7 0×0007
8 0×0008 3 The FAT entry for the 1st cluster in the data area of the disk / partition
9 0×0009
10 0x000A
11 0x000B
12 0x000C 4 The FAT entry for the 2nd cluster in the data area of the disk / partition
13 0x000D
14 0x000E
15 0x000F

||

||
# 0x#### # The FAT entry for the last cluster in the data area of the disk / partition
# 0x####
# 0x####
# 0x####

Byte address is (Partition Start Address + 512 + #)

FAT16 uses 2 FAT tables, one after the other, and FAT32 uses up to 4 FAT tables. This provides a backup in case of corruption of one of the tables. If you change the contents of the FAT table, ensure that all copies are updated (checking for FAT32 to see which tables should be updated).

Location & Size

The first FAT table starts straight after the Boot Record. Therefore the start address of the first FAT table:

= Start address of partition + No of reserved sectors

Each additional FAT table follows straight on after the last. The number of FAT tables is recommended to be 2 due to old systems that assume a value of 2. However the number of FAT tables does not have to be 2 and for flash drives where a backup of the FAT table is redundant only a single table may be used. It is also possible to have more than 2 FAT tables.

e) Root Directory & Other Directories

A FAT directory is simply a ‘file’ containing a linear list of 32 byte entries. The only special directory, which must always be present, is the root directory. For FAT16 volumes the root directory is located in a fixed location on the disk immediately following the last FAT and is a fixed size in sectors as specified in the Boot Record.

For FAT16 the first sector of the root directory is sector number relative to the first sector of the FAT volume:

For FAT32 the root directory can be of variable size and is a cluster chain just like any other directory. The first cluster of the root directory is specified in the Boot Record.

Each directory entry is 32 bytes and formatted as follows:

Byte Value
0 0×00 Name
1 0×01 (The 8 character filename)
2 0×02
3 0×03
4 0×04
5 0×05
6 0×06
7 0×07
8 0×08 Extension
9 0×09 (The 3 character filename extension)
10 0x0A
11 0x0B Attributes

Bit: 7 6 5 4 3 2 1 0
Value: 0 0 Archive Directory Volume Label System Hidden Read Only
12 0x0C NT

(Reserved for WindowsNT always 0)

13 0x0D Created time – mS (0 if not used)
14 0x0E Created time – hour and minute (0 if not used)
15 0x0F
16 0×10 Created date (0 if not used)
17 0×11
18 0×12 Last accessed date (0 if not used)
19 0×13
20 0×14 Extended Attribute (reserved for OS/2, always 0)
21 0×15 High word of cluster for FAT32 volumes
22 0×16 Time of last write to file
23 0×17
24 0×18 Date of last write to file
25 0×19
26 0x1A Start cluster (referenced from the start of the data area of the volume)
27 0x1B
28 0x1C File size
29 0x1D
30 0x1E
31 0x1F

Note that bytes 0x0C to 0×15 we’re unused in the original DOS specification and may still be left unused if desired.

Special Markers

If the first byte of a directory entry is 0xE5 then the entry has been erased. If the first byte is 0×00 then the entry has never been used (this can be used to detect the end of the table as all following entries will also be 0×00).

Location & Size

For FAT16 the root directory is located directly after the 2nd FAT table:

= Start address of partition + No of reserved sectors + (Number of FAT tables x FAT table size)

Its size is specified by the boot record:

= maximum number of root directory entries x 32 bytes per entry

The data area starts straight after the root directory. The only difference between the root folder and any other folders is that the root folder is at a specified location and has a fixed number of entries.

For FAT32 the root directory can be of variable size and is a cluster chain, just like any other directory is. The first cluster of the root directory on a FAT32 volume is stored in the sector specified in the boot record.

For both FAT16 and FAT23, unlike other directories, the root directory itself does not have any date or time stamps, does not have a file name (other than the implied file name “\”), and does not contain “.” and “..” files as the first two directory entries in the directory. The only other special aspect of the root directory is that it is the only directory on the FAT volume for which it is valid to have a file that has only the ‘Volume ID’ attribute bit set.

Date and Time Formats

If date and time are not supported then they should be written as zero. Bytes 22 – 25, time of last write and date of last write, must be supported according to the FAT specification but if a device has no real time clock then this isn’t possible.

Date field

A 16-bit field that is a date relative to 01/01/1980:-

Bits 15:9 Count of years from 1980, valid range 0 – 127 (=1980–2107).

Bits 8:5 Month of year, valid range 1–12 (1 = January)

Bits 4:0 Day of month, valid range 1-31

Time Format.

A 16-bit field with a valid range from Midnight 00:00:00 to 23:59:58:-

Bits 15:11 Hours, valid range 0 – 23

Bits 10:5 Minutes, valid range 0 – 59

Bits 4:0 2-second count, valid range 0–29 (= 0 – 58 seconds)

f) Data Area

The remainder of the volume is the data area, which may contain files and directories. It is this area that the FAT tables relate to.

Start Address

For FAT16 the start address of the data area is:-

Start address of partition + Number of reserved sectors + (Number of FAT tables x FAT table size) + Number of root directory sectors

For FAT32 the start address of the data area is:-

Start address of partition + Number of reserved sectors + (Number of FAT tables x FAT table size)

For a given cluster number in the FAT table, the start address of that sector is:-

data area start address + ((FAT table cluster number – 2) x sectors per cluster)

Because sectors per cluster is restricted to powers of 2 (1, 2, 4, 8, 16, 32…), division and multiplication by sectors per cluster can actually be performed via shift operations which is often faster than multiply or divide instructions

g) FAT32 File System Information Sector

(Not applicable to FAT16)

The partition boot record specifies the sector that contains this information block, which can be utilised by a FAT driver to speed up write operations.

Byte Value
0 0×0000 Signature = 0×41615252.
1 0×0001 This validates that this is a File System Information Sector.
2 0×0002
3 0×0003
4 0×0004 480 reserved bytes
|| ||
483 0x01E3
484 0x01E4 Signature = 0×61417272
485 0x01E5 Another signature that is more localized in the sector to the location of the fields that are used.
486 0x01E6
487 0x01E7
488 0x01E8 Number of Free Clusters on the volume.
489 0x01E9 Set to 0xFFFFFFFF if unknown and needs computing.
490 0x01EA This should be range checked at least to make sure it is <= volume cluster count.
491 0x01EB
492 0x01EC It indicates the cluster number at which the driver should start looking for free clusters – it is a hint for the FAT driver. Because a FAT32 FAT is large, it can be rather time consuming if there are a lot of allocated clusters at the start of the FAT and the driver starts looking for a free cluster starting at cluster 2. Typically this value is set to the last cluster number that the driver allocated. If the value is 0xFFFFFFFF, then there is no hint and the driver should start looking at cluster 2. Any other value can be used, but should be checked first to make sure it is a valid cluster number for the volume.
493 0x01ED
494 0x01EE
495 0x01EF
496 0x01F0 12 reserved bytes
|| ||
507 0x01FB
508 0x01FC Trailing signature = 0x000055AA
509 0x01FD Used to validate that this is a File System Information Sector.
510 0x01FE
511 0x01FF

Byte address is (Sector Start + #)