2 FAT format data structures
4 Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials are licensed and made available
7 under the terms and conditions of the BSD License which accompanies this
8 distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
22 #define FAT_ATTR_READ_ONLY 0x01
23 #define FAT_ATTR_HIDDEN 0x02
24 #define FAT_ATTR_SYSTEM 0x04
25 #define FAT_ATTR_VOLUME_ID 0x08
26 #define FAT_ATTR_DIRECTORY 0x10
27 #define FAT_ATTR_ARCHIVE 0x20
28 #define FAT_ATTR_LFN (FAT_ATTR_READ_ONLY | FAT_ATTR_HIDDEN | FAT_ATTR_SYSTEM | FAT_ATTR_VOLUME_ID)
30 #define FAT_CLUSTER_SPECIAL ((MAX_UINT32 &~0xF) | 0x7)
31 #define FAT_CLUSTER_FREE 0
32 #define FAT_CLUSTER_RESERVED (FAT_CLUSTER_SPECIAL)
33 #define FAT_CLUSTER_BAD (FAT_CLUSTER_SPECIAL)
34 #define FAT_CLUSTER_LAST (-1)
36 #define DELETE_ENTRY_MARK 0xE5
37 #define EMPTY_ENTRY_MARK 0x00
39 #define FAT_CLUSTER_FUNCTIONAL(Cluster) (((Cluster) == 0) || ((Cluster) >= FAT_CLUSTER_SPECIAL))
40 #define FAT_CLUSTER_END_OF_CHAIN(Cluster) ((Cluster) > (FAT_CLUSTER_SPECIAL))
50 UINT16 Year
: 7; // From 1980
54 UINT16 DoubleSecond
: 5;
65 CHAR8 FileName
[11]; // 8.3 filename
68 UINT8 CreateMillisecond
; // (creation milliseconds - ignored)
69 FAT_DATE_TIME FileCreateTime
;
70 FAT_DATE FileLastAccess
;
71 UINT16 FileClusterHigh
; // >= FAT32
72 FAT_DATE_TIME FileModificationTime
;
75 } FAT_DIRECTORY_ENTRY
;
89 UINT8 SectorsPerCluster
;
90 UINT16 ReservedSectors
;
92 UINT16 RootEntries
; // < FAT32, root dir is fixed size
94 UINT8 Media
; // (ignored)
95 UINT16 SectorsPerFat
; // < FAT32
96 UINT16 SectorsPerTrack
; // (ignored)
97 UINT16 Heads
; // (ignored)
98 UINT32 HiddenSectors
; // (ignored)
99 UINT32 LargeSectors
; // => FAT32
100 UINT8 PhysicalDriveNumber
; // (ignored)
101 UINT8 CurrentHead
; // holds boot_sector_dirty bit
102 UINT8 Signature
; // (ignored)
107 } PEI_FAT_BOOT_SECTOR
;
115 UINT8 SectorsPerCluster
;
116 UINT16 ReservedSectors
;
118 UINT16 RootEntries
; // < FAT32, root dir is fixed size
120 UINT8 Media
; // (ignored)
121 UINT16 SectorsPerFat
; // < FAT32
122 UINT16 SectorsPerTrack
; // (ignored)
123 UINT16 Heads
; // (ignored)
124 UINT32 HiddenSectors
; // (ignored)
125 UINT32 LargeSectors
; // Used if Sectors==0
126 UINT32 LargeSectorsPerFat
; // FAT32
127 UINT16 ExtendedFlags
; // FAT32 (ignored)
128 UINT16 FsVersion
; // FAT32 (ignored)
129 UINT32 RootDirFirstCluster
; // FAT32
130 UINT16 FsInfoSector
; // FAT32
131 UINT16 BackupBootSector
; // FAT32
132 UINT8 Reserved
[12]; // FAT32 (ignored)
133 UINT8 PhysicalDriveNumber
; // (ignored)
134 UINT8 CurrentHead
; // holds boot_sector_dirty bit
135 UINT8 Signature
; // (ignored)
140 } PEI_FAT_BOOT_SECTOR_EX
;