SdFat: fat32_boot Struct Reference

SdFat

Public Attributes | List of all members
fat32_boot Struct Reference

Boot sector for a FAT32 volume. More...

`#include <FatStructs.h>`

## Public Attributes

uint8_t | bootCode [420]
uint8_t | bootSectorSig0
uint8_t | bootSectorSig1
uint8_t | bootSignature
uint16_t | bytesPerSector
uint8_t | driveNumber
uint16_t | fat32BackBootBlock
uint16_t | fat32Flags
uint16_t | fat32FSInfo
uint8_t | fat32Reserved [12]
uint32_t | fat32RootCluster
uint16_t | fat32Version
uint8_t | fatCount
char | fileSystemType [8]
uint16_t | headCount
uint32_t | hidddenSectors
uint8_t | jump [3]
uint8_t | mediaType
char | oemId [8]
uint8_t | reserved1
uint16_t | reservedSectorCount
uint16_t | rootDirEntryCount
uint8_t | sectorsPerCluster
uint16_t | sectorsPerFat16
uint32_t | sectorsPerFat32
uint16_t | sectorsPerTrack
uint16_t | totalSectors16
uint32_t | totalSectors32
char | volumeLabel [11]
uint32_t | volumeSerialNumber

## Detailed Description

Boot sector for a FAT32 volume.

## Member Data Documentation

## ◆ bootCode

uint8_t fat32_boot::bootCode[420]

X86 boot code

## ◆ bootSectorSig0

uint8_t fat32_boot::bootSectorSig0

must be 0X55

## ◆ bootSectorSig1

uint8_t fat32_boot::bootSectorSig1

must be 0XAA

## ◆ bootSignature

uint8_t fat32_boot::bootSignature

0X29 if next three fields are valid

## ◆ bytesPerSector

uint16_t fat32_boot::bytesPerSector

The size of a hardware sector. Valid decimal values for this field are 512, 1024, 2048, and 4096. For most disks used in the United States, the value of this field is 512.

## ◆ driveNumber

uint8_t fat32_boot::driveNumber

Related to the BIOS physical drive number. Floppy drives are identified as 0x00 and physical hard disks are identified as 0x80, regardless of the number of physical disk drives. Typically, this value is set prior to issuing an INT 13h BIOS call to specify the device to access. The value is only relevant if the device is a boot device.

## ◆ fat32BackBootBlock

uint16_t fat32_boot::fat32BackBootBlock

If non-zero, indicates the sector number in the reserved area of the volume of a copy of the boot record. Usually 6. No value other than 6 is recommended.

## ◆ fat32Flags

uint16_t fat32_boot::fat32Flags

This field is only defined for FAT32 media and does not exist on FAT12 and FAT16 media. Bits 0-3 – Zero-based number of active FAT. Only valid if mirroring is disabled. Bits 4-6 – Reserved. Bit 7 – 0 means the FAT is mirrored at runtime into all FATs. – 1 means only one FAT is active; it is the one referenced in bits 0-3. Bits 8-15 – Reserved.

## ◆ fat32FSInfo

uint16_t fat32_boot::fat32FSInfo

Sector number of FSINFO structure in the reserved area of the FAT32 volume. Usually 1.

## ◆ fat32Reserved

uint8_t fat32_boot::fat32Reserved[12]

Reserved for future expansion. Code that formats FAT32 volumes should always set all of the bytes of this field to 0.

## ◆ fat32RootCluster

uint32_t fat32_boot::fat32RootCluster

Cluster number of the first cluster of the root directory for FAT32. This usually 2 but not required to be 2.

## ◆ fat32Version

uint16_t fat32_boot::fat32Version

FAT32 version. High byte is major revision number. Low byte is minor revision number. Only 0.0 define.

## ◆ fatCount

uint8_t fat32_boot::fatCount

The number of copies of the FAT on the volume. The value of this field is always 2.

## ◆ fileSystemType

char fat32_boot::fileSystemType[8]

A text field with a value of FAT32.

## ◆ headCount

uint16_t fat32_boot::headCount

Number of heads for interrupt 0x13. Not used otherwise.

## ◆ hidddenSectors

uint32_t fat32_boot::hidddenSectors

Count of hidden sectors preceding the partition that contains this FAT volume. This field is generally only relevant for media visible on interrupt 0x13.

## ◆ jump

uint8_t fat32_boot::jump[3]

The first three bytes of the boot sector must be valid, executable x 86-based CPU instructions. This includes a jump instruction that skips the next non-executable bytes.

## ◆ mediaType

uint8_t fat32_boot::mediaType

This dates back to the old MS-DOS 1.x media determination and is no longer usually used for anything. 0xF8 is the standard value for fixed (non-removable) media. For removable media, 0xF0 is frequently used. Legal values are 0xF0 or 0xF8-0xFF.

## ◆ oemId

char fat32_boot::oemId[8]

This is typically a string of characters that identifies the operating system that formatted the volume.

## ◆ reserved1

uint8_t fat32_boot::reserved1

used by Windows NT - should be zero for FAT

## ◆ reservedSectorCount

uint16_t fat32_boot::reservedSectorCount

The number of sectors preceding the start of the first FAT, including the boot sector. Must not be zero

## ◆ rootDirEntryCount

uint16_t fat32_boot::rootDirEntryCount

FAT12/FAT16 only. For FAT32 volumes, this field must be set to 0.

## ◆ sectorsPerCluster

uint8_t fat32_boot::sectorsPerCluster

Number of sectors per allocation unit. This value must be a power of 2 that is greater than 0. The legal values are 1, 2, 4, 8, 16, 32, 64, and 128. 128 should be avoided.

## ◆ sectorsPerFat16

uint16_t fat32_boot::sectorsPerFat16

On FAT32 volumes this field must be 0, and sectorsPerFat32 contains the FAT size count.

## ◆ sectorsPerFat32

uint32_t fat32_boot::sectorsPerFat32

Count of sectors occupied by one FAT on FAT32 volumes.

## ◆ sectorsPerTrack

uint16_t fat32_boot::sectorsPerTrack

Sectors per track for interrupt 0x13. Not used otherwise.

## ◆ totalSectors16

uint16_t fat32_boot::totalSectors16

For FAT32 volumes, this field must be 0.

## ◆ totalSectors32

uint32_t fat32_boot::totalSectors32

Contains the total number of sectors in the FAT32 volume.

## ◆ volumeLabel

char fat32_boot::volumeLabel[11]

A field once used to store the volume label. The volume label is now stored as a special file in the root directory.

## ◆ volumeSerialNumber

uint32_t fat32_boot::volumeSerialNumber

A random serial number created when formatting a disk, which helps to distinguish between disks. Usually generated by combining date and time.

The documentation for this struct was generated from the following file:

- Arduino/libraries/SdFat/src/FatLib/FatStructs.h