Code: Select all
struct FATBootSector
{
unsigned char BootStrapCode[3]; // code to jump to the bootstrap code
unsigned char OEMID[8]; // name of the formatting OS
unsigned short BytesPerSector;
unsigned char SectorsPerCluster;
unsigned short ReservedSectors;
unsigned char FATCopies;
unsigned short NumberOfPossibleRootEntries;
unsigned short TotalSectors;
unsigned char MediaDescriptor;
unsigned short SectorsPerFAT;
unsigned short SectorsPerTrack;
unsigned short NumberOfHeads;
unsigned int HiddenSectors;
unsigned int LargeNumberOfSectors;
union
{
struct
{
unsigned char FATDriveNumber;
unsigned char FAT_Reserved;
unsigned char FATExtendedBootSignature;
unsigned int FATVolumeSerialNumber;
unsigned char FATVolumeLabel[11];
unsigned char FATFileSystemType[8];
unsigned char FATBootstrapCode[448];
};
struct
{
unsigned int FAT32SectorsPerFAT;
unsigned short FAT32FATFlags;
unsigned short FAT32Version;
unsigned int FAT32ClusterNumberOfRootDirectoryStart;
unsigned short FAT32SectorNumberOfFSInformationSector;
unsigned short FAT32SectorNumberOfFSInformationSectorCopy;
unsigned char FAT32_Reserved[12];
unsigned char FAT32DriveNumber;
unsigned char FAT32_Reserved1;
unsigned char FAT32ExtendedBootSignature;
unsigned int FAT32ID;
unsigned char FAT32VolumeLabel[11];
unsigned char FAT32FileSystemType[8];
unsigned char FAT32BootstrapCode[420];
};
};
unsigned char FAT32BootSectorSignature;
};