User`s manual

164 digi.com File Systems
10.2.5 More FAT Information
The FAT file system stores and organizes files on a storage device such as a hard drive or a memory
device.
10.2.5.1 Clusters and Sectors
Every file is stored on one or more clusters. A cluster is made up of a contiguous number of bytes called
sectors and is the smallest unit of allocation for files. The Dynamic C FAT implementation supports a sec-
tor size of 512 bytes. Cluster sizes depend on the media. The table below gives the cluster sizes used for
some of our RabbitCore modules.
The cluster size for a NAND device corresponds to its page size. Note that a file or directory takes at mini-
mum one cluster. On a NAND device the page size is 16K bytes; therefore, while it is allowable to write
very small files to the FAT file system on a NAND device, it is not space efficient. Even the smallest file
takes at least 16,000 bytes of storage. Cluster sizes for SD cards vary with the size of the card inserted. To
determine the number of sectors per cluster on an SD card, divide the size of the card by 32MB.
10.2.5.2 The Master Boot Record
The master boot record (MBR) is located on one or more sectors at the physical start of the device. Its
basic structure is illustrated in Figure 3. The boot region of the MBR contains DOS boot loader code,
which is written when the device is formatted (but is not otherwise used by the Dynamic C FAT file sys-
tem). The partition table follows the boot region. It contains four 16-byte entries, which allows up to four
partitions on the device. Partition table entries contain some critical information: the partition type
(Dynamic C FAT recognizes partition types FAT12 and FAT16) and the partition’s starting and ending sec-
tor numbers. There is also a field denoting the total number of sectors in the partition. If this number is
zero, the corresponding partition is empty and available.
Table 13. Cluster Sizes on Flash Devices
RabbitCore Model Flash Device
Number of Sectors
per Cluster
RCM 3700
1 MB Serial Flash 1
RCM 3300
4 and 8 MB Serial Flash 2
RCM3360/70
NAND Flash 32