2 FAT format data structures
4 Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
16 #define FAT_ATTR_READ_ONLY 0x01
17 #define FAT_ATTR_HIDDEN 0x02
18 #define FAT_ATTR_SYSTEM 0x04
19 #define FAT_ATTR_VOLUME_ID 0x08
20 #define FAT_ATTR_DIRECTORY 0x10
21 #define FAT_ATTR_ARCHIVE 0x20
22 #define FAT_ATTR_LFN (FAT_ATTR_READ_ONLY | FAT_ATTR_HIDDEN | FAT_ATTR_SYSTEM | FAT_ATTR_VOLUME_ID)
24 #define FAT_CLUSTER_SPECIAL ((MAX_UINT32 &~0xF) | 0x7)
25 #define FAT_CLUSTER_FREE 0
26 #define FAT_CLUSTER_RESERVED (FAT_CLUSTER_SPECIAL)
27 #define FAT_CLUSTER_BAD (FAT_CLUSTER_SPECIAL)
28 #define FAT_CLUSTER_LAST (-1)
30 #define DELETE_ENTRY_MARK 0xE5
31 #define EMPTY_ENTRY_MARK 0x00
33 #define FAT_CLUSTER_FUNCTIONAL(Cluster) (((Cluster) == 0) || ((Cluster) >= FAT_CLUSTER_SPECIAL))
34 #define FAT_CLUSTER_END_OF_CHAIN(Cluster) ((Cluster) > (FAT_CLUSTER_SPECIAL))
44 UINT16 Year
: 7; // From 1980
48 UINT16 DoubleSecond
: 5;
59 CHAR8 FileName
[11]; // 8.3 filename
62 UINT8 CreateMillisecond
; // (creation milliseconds - ignored)
63 FAT_DATE_TIME FileCreateTime
;
64 FAT_DATE FileLastAccess
;
65 UINT16 FileClusterHigh
; // >= FAT32
66 FAT_DATE_TIME FileModificationTime
;
69 } FAT_DIRECTORY_ENTRY
;
83 UINT8 SectorsPerCluster
;
84 UINT16 ReservedSectors
;
86 UINT16 RootEntries
; // < FAT32, root dir is fixed size
88 UINT8 Media
; // (ignored)
89 UINT16 SectorsPerFat
; // < FAT32
90 UINT16 SectorsPerTrack
; // (ignored)
91 UINT16 Heads
; // (ignored)
92 UINT32 HiddenSectors
; // (ignored)
93 UINT32 LargeSectors
; // => FAT32
94 UINT8 PhysicalDriveNumber
; // (ignored)
95 UINT8 CurrentHead
; // holds boot_sector_dirty bit
96 UINT8 Signature
; // (ignored)
101 } PEI_FAT_BOOT_SECTOR
;
109 UINT8 SectorsPerCluster
;
110 UINT16 ReservedSectors
;
112 UINT16 RootEntries
; // < FAT32, root dir is fixed size
114 UINT8 Media
; // (ignored)
115 UINT16 SectorsPerFat
; // < FAT32
116 UINT16 SectorsPerTrack
; // (ignored)
117 UINT16 Heads
; // (ignored)
118 UINT32 HiddenSectors
; // (ignored)
119 UINT32 LargeSectors
; // Used if Sectors==0
120 UINT32 LargeSectorsPerFat
; // FAT32
121 UINT16 ExtendedFlags
; // FAT32 (ignored)
122 UINT16 FsVersion
; // FAT32 (ignored)
123 UINT32 RootDirFirstCluster
; // FAT32
124 UINT16 FsInfoSector
; // FAT32
125 UINT16 BackupBootSector
; // FAT32
126 UINT8 Reserved
[12]; // FAT32 (ignored)
127 UINT8 PhysicalDriveNumber
; // (ignored)
128 UINT8 CurrentHead
; // holds boot_sector_dirty bit
129 UINT8 Signature
; // (ignored)
134 } PEI_FAT_BOOT_SECTOR_EX
;