
5
The first sector, the Master Boot Record (MBR), is reserved and contains the partition
table and other vital information concerning how the memory is organized. It reserves
the entire first sector of the card and typically includes information such as bytes per
sector, sectors per cluster, reserved sectors, File Allocation Table (FAT) entries,
number of root entries, and number of small sectors. This sector, too, is written only
by the internal microcontroller as it keeps the organization of the card. Writing to this
sector using the SPI interface will cause errors and possibly disable the card from
working altogether.
The next sector is the first FAT. In this area there are different entries for each file
which show how many clusters are used for that particular file. In figure 3 it can be
seen that offset 400 is the beginning of the file allocation table in sector 2.
Figure 3: Screenshot of File Allocation Table Using HxD Hex Editor. Screenshot [1].
Each cluster here is represented by two bytes. As can be seen in the figure, there are
ten clusters available for this specific file. The FAT entry shown starts with the byte
0xF8 and ends with the byte 0xFF. This is kept for the purpose of referencing the size
of the file. The FAT 16 format also needs an exact copy of this file allocation table in a
second FAT entry on the disk for data safety reasons. In the case of data corruption on
one entry, the second is still intact and can be used by the host device. The location of
the second FAT entry can vary depending on the size and make of the card.
Komentáře k této Příručce