uint8_tjump_code[3];///< Assembly instruction to jump to boot code.
uint8_toem_name[8];///< OEM Name in ASCII.
uint16_tbyte_per_sector;///< Bytes per sector. Allowed values include 512, 1024, 2048, and 4096.
uint8_tsector_per_cluster;///< Sectors per cluster (data unit). Allowed values are powers of 2, but the cluster size must be 32KB or smaller.
uint16_treserved_sectors;///< Size in sectors of the reserved area.
uint8_tfat_num;///< Number of FATs. Typically two for redundancy, but according to Microsoft it can be one for some small storage devices.
uint16_tfat12_root_entry_num;///< Maximum number of files in the root directory for FAT12 and FAT16. This is 0 for FAT32 and typically 512 for FAT16.
uint16_tfat12_sector_num_16;///< 16-bit number of sectors in file system. If the number of sectors is larger than can be represented in this 2-byte value, a 4-byte value exists later in the data structure and this should be 0.
uint8_tmedia_type;///< 0xf8 should be used for fixed disks and 0xf0 for removable.
uint16_tsector_per_fat;///< 16-bit size in sectors of each FAT for FAT12 and FAT16. For FAT32, this field is 0.
uint16_tsector_per_track;///< Sectors per track of storage device.
uint16_thead_num;///< Number of heads in storage device.
uint32_thidden_sectors;///< Number of sectors before the start of partition.
uint32_tsector_num_32;///< 32-bit value of number of sectors in file system. Either this value or the 16-bit value above must be 0.
//------------- FAT32 -------------//
uint8_tdrive_number;///< Physical drive number (0x00 for (first) removable media, 0x80 for (first) fixed disk
uint8_treserved;
uint8_textended_boot_signature;///< should be 0x29
uint32_tvolume_serial_number;///< Volume serial number, which some versions of Windows will calculate based on the creation date and time.
uint8_tvolume_label[11];
uint8_tfilesystem_type[8];///< File system type label in ASCII, padded with blank (0x20). Standard values include "FAT," "FAT12," and "FAT16," but nothing is required.
uint8_treserved2[448];
uint16_tfat_signature;///< Signature value (0xAA55).
}fat12_boot_sector_t;
STATIC_ASSERT(sizeof(fat12_boot_sector_t)==512,"size is not correct");
typedefATTR_PACKED_STRUCT(struct){
uint8_tname[11];
ATTR_PACKED_STRUCT(struct){
uint8_treadonly:1;
uint8_thidden:1;
uint8_tsystem:1;
uint8_tvolume_label:1;
uint8_tdirectory:1;
uint8_tarchive:1;
}attr;// Long File Name = 0x0f
uint8_treserved;
uint8_tcreated_time_tenths_of_seconds;
uint16_tcreated_time;
uint16_tcreated_date;
uint16_taccessed_date;
uint16_tcluster_high;
uint16_twritten_time;
uint16_twritten_date;
uint16_tcluster_low;
uint32_tfile_size;
}fat_directory_t;
STATIC_ASSERT(sizeof(fat_directory_t)==32,"size is not correct");