23 #define MBR_PARTITION_TYPE_FAT16 0x06
24 #define MBR_PARTITION_TYPE_FAT32 0x0B
25 #define MBR_PARTITION_TYPE_FAT32_LBA 0x0C
26 #define MBR_PARTITION_TYPE_FAT16_LBA 0x0E
29 #define FAT_VOLUME_ID_SIGNATURE_1 0x55
30 #define FAT_VOLUME_ID_SIGNATURE_2 0xAA
32 #define FAT_DIRECTORY_ENTRY_SIZE 32
33 #define FAT_SMALLEST_LEGAL_CLUSTER_NUMBER 2
35 #define FAT_MAXIMUM_FILESIZE 0xFFFFFFFF
37 #define FAT12_MAX_CLUSTERS 4084
38 #define FAT16_MAX_CLUSTERS 65524
40 #define FAT_FILE_ATTRIBUTE_READ_ONLY 0x01
41 #define FAT_FILE_ATTRIBUTE_HIDDEN 0x02
42 #define FAT_FILE_ATTRIBUTE_SYSTEM 0x04
43 #define FAT_FILE_ATTRIBUTE_VOLUME_ID 0x08
44 #define FAT_FILE_ATTRIBUTE_DIRECTORY 0x10
45 #define FAT_FILE_ATTRIBUTE_ARCHIVE 0x20
47 #define FAT_FILENAME_LENGTH 11
48 #define FAT_DELETED_FILE_MARKER 0xE5
50 #define FAT_MAKE_DATE(year, month, day) (day | (month << 5) | ((year - 1980) << 9))
51 #define FAT_MAKE_TIME(hour, minute, second) ((second / 2) | (minute << 5) | (hour << 11))
uint8_t creationTimeTenths
Definition: fat_standard.h:119
uint32_t lbaBegin
Definition: fat_standard.h:65
uint8_t sectorsPerCluster
Definition: fat_standard.h:98
uint16_t lastAccessDate
Definition: fat_standard.h:122
uint16_t rootEntryCount
Definition: fat_standard.h:101
uint16_t firstClusterHigh
Definition: fat_standard.h:123
uint8_t attrib
Definition: fat_standard.h:117
uint16_t fsVer
Definition: fat_standard.h:67
Definition: fat_standard.h:78
bool fat_isDirectoryEntryTerminator(fatDirectoryEntry_t *entry)
Definition: fat_standard.c:49
uint32_t FATSize32
Definition: fat_standard.h:79
uint16_t fsInfo
Definition: fat_standard.h:83
uint16_t reservedSectorCount
Definition: fat_standard.h:99
uint16_t lastWriteTime
Definition: fat_standard.h:124
uint8_t ntReserved
Definition: fat_standard.h:118
uint16_t backupBootSector
Definition: fat_standard.h:84
uint16_t firstClusterLow
Definition: fat_standard.h:126
Definition: fat_standard.h:115
uint16_t totalSectors16
Definition: fat_standard.h:102
Definition: fat_standard.h:94
bool fat32_isEndOfChainMarker(uint32_t clusterNumber)
Definition: fat_standard.c:28
uint8_t bootSignature
Definition: fat_standard.h:67
uint16_t creationTime
Definition: fat_standard.h:120
uint32_t fileSize
Definition: fat_standard.h:127
uint8_t jmpBoot[3]
Definition: fat_standard.h:65
uint8_t type
Definition: fat_standard.h:63
uint32_t rootCluster
Definition: fat_standard.h:82
char fileSystemType[8]
Definition: fat_standard.h:70
uint8_t bootSignature
Definition: fat_standard.h:88
uint16_t bytesPerSector
Definition: fat_standard.h:97
bool fat16_isEndOfChainMarker(uint16_t clusterNumber)
Definition: fat_standard.c:22
char oemName[8]
Definition: fat_standard.h:66
#define FAT_FILENAME_LENGTH
Definition: fat_standard.h:47
uint16_t FATSize16
Definition: fat_standard.h:104
char filename[FAT_FILENAME_LENGTH]
Definition: fat_standard.h:65
uint8_t numFATs
Definition: fat_standard.h:100
uint8_t reserved1
Definition: fat_standard.h:66
char volumeLabel[11]
Definition: fat_standard.h:69
uint32_t totalSectors32
Definition: fat_standard.h:108
uint32_t volumeID
Definition: fat_standard.h:89
uint16_t extFlags
Definition: fat_standard.h:66
fat16Descriptor_t fat16
Definition: fat_standard.h:110
uint16_t lastWriteDate
Definition: fat_standard.h:125
uint8_t reserved[12]
Definition: fat_standard.h:71
uint32_t volumeID
Definition: fat_standard.h:68
bool fat_isFreeSpace(uint32_t clusterNumber)
Definition: fat_standard.c:44
uint16_t sectorsPerTrack
Definition: fat_standard.h:105
uint8_t bootFlag
Definition: fat_standard.h:61
struct mbrPartitionEntry_t __attribute__((packed)) mbrPartitionEntry_t
Definition: fat_standard.h:57
uint8_t media
Definition: fat_standard.h:103
Definition: fat_standard.h:56
uint8_t chsBegin[3]
Definition: fat_standard.h:62
uint16_t numHeads
Definition: fat_standard.h:106
Definition: fat_standard.h:55
uint8_t chsEnd[3]
Definition: fat_standard.h:64
bool fat_isDirectoryEntryEmpty(fatDirectoryEntry_t *entry)
Definition: fat_standard.c:54
uint32_t hiddenSectors
Definition: fat_standard.h:107
fat32Descriptor_t fat32
Definition: fat_standard.h:111
uint32_t numSectors
Definition: fat_standard.h:66
fatFilesystemType_e
Definition: fat_standard.h:53
uint8_t driveNumber
Definition: fat_standard.h:65
uint8_t driveNumber
Definition: fat_standard.h:86
Definition: fat_standard.h:60
uint32_t fat32_decodeClusterNumber(uint32_t clusterNumber)
Definition: fat_standard.c:38
Definition: fat_standard.h:69
uint8_t reserved1
Definition: fat_standard.h:87
void fat_convertFilenameToFATStyle(const char *filename, uint8_t *fatFilename)
Definition: fat_standard.c:64
uint16_t creationDate
Definition: fat_standard.h:121
Definition: fat_standard.h:54