Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

131 lines
3.7 KiB

  1. /*++
  2. Copyright (c) 1998 Intel Corporation
  3. Module Name:
  4. fat.h
  5. Abstract:
  6. On disk fat structures
  7. Revision History
  8. --*/
  9. typedef enum {
  10. FAT12,
  11. FAT16,
  12. FAT32,
  13. FatUndefined
  14. } FAT_VOLUME_TYPE;
  15. #pragma pack(1)
  16. /*
  17. * Used for fat12 & fat16
  18. */
  19. typedef struct {
  20. UINT8 Ia32Jump[3];
  21. CHAR8 OemId[8];
  22. UINT16 SectorSize;
  23. UINT8 SectorsPerCluster;
  24. UINT16 ReservedSectors;
  25. UINT8 NoFats;
  26. UINT16 RootEntries; /* < FAT32, root dir is fixed size */
  27. UINT16 Sectors;
  28. UINT8 Media; /* (ignored) */
  29. UINT16 SectorsPerFat; /* < FAT32 */
  30. UINT16 SectorsPerTrack; /* (ignored) */
  31. UINT16 Heads; /* (ignored) */
  32. UINT32 HiddenSectors; /* (ignored) */
  33. UINT32 LargeSectors; /* => FAT32 */
  34. UINT8 PhysicalDriveNumber; /* (ignored) */
  35. UINT8 CurrentHead; /* holds boot_sector_dirty bit */
  36. UINT8 Signature; /* (ignored) */
  37. CHAR8 Id[4];
  38. CHAR8 FatLabel[11];
  39. CHAR8 SystemId[8];
  40. } FAT_BOOT_SECTOR;
  41. typedef struct {
  42. UINT8 Ia32Jump[3];
  43. CHAR8 OemId[8];
  44. UINT16 SectorSize;
  45. UINT8 SectorsPerCluster;
  46. UINT16 ReservedSectors;
  47. UINT8 NoFats;
  48. UINT16 RootEntries; /* < FAT32, root dir is fixed size */
  49. UINT16 Sectors;
  50. UINT8 Media; /* (ignored) */
  51. UINT16 SectorsPerFat; /* < FAT32 */
  52. UINT16 SectorsPerTrack; /* (ignored) */
  53. UINT16 Heads; /* (ignored) */
  54. UINT32 HiddenSectors; /* (ignored) */
  55. UINT32 LargeSectors; /* Used if Sectors==0 */
  56. UINT32 LargeSectorsPerFat; /* FAT32 */
  57. UINT16 ExtendedFlags; /* FAT32 (ignored) */
  58. UINT16 FsVersion; /* FAT32 (ignored) */
  59. UINT32 RootDirFirstCluster; /* FAT32 */
  60. UINT16 FsInfoSector; /* FAT32 */
  61. UINT16 BackupBootSector; /* FAT32 */
  62. UINT8 Reserved[12]; /* FAT32 (ignored) */
  63. UINT8 PhysicalDriveNumber; /* (ignored) */
  64. UINT8 CurrentHead; /* holds boot_sector_dirty bit */
  65. UINT8 Signature; /* (ignored) */
  66. CHAR8 Id[4];
  67. CHAR8 FatLabel[11];
  68. CHAR8 SystemId[8];
  69. } FAT_BOOT_SECTOR_EX;
  70. /*
  71. * ignored - means not used in the EFI driver
  72. *
  73. * For <Fat32 RootEntries indicates the number of entries in the root directory,
  74. * and SectorsPerFat is used to size the fact table
  75. */
  76. typedef struct {
  77. UINT16 Day:5;
  78. UINT16 Month:4;
  79. UINT16 Year:7; /* From 1980 */
  80. } FAT_DATE;
  81. typedef struct {
  82. UINT16 DoubleSecond:5;
  83. UINT16 Minute:6;
  84. UINT16 Hour:5;
  85. } FAT_TIME;
  86. typedef struct {
  87. FAT_TIME Time;
  88. FAT_DATE Date;
  89. } FAT_DATE_TIME;
  90. typedef struct {
  91. CHAR8 FileName[11]; /* 8.3 filename */
  92. UINT8 Attributes;
  93. UINT8 CaseFlag;
  94. UINT8 CreateMillisecond; /* (creation milliseconds - ignored) */
  95. FAT_DATE_TIME FileCreateTime;
  96. FAT_DATE FileLastAccess;
  97. UINT16 FileClusterHigh; /* >= FAT32 */
  98. FAT_DATE_TIME FileModificationTime;
  99. UINT16 FileCluster;
  100. UINT32 FileSize;
  101. } FAT_DIRECTORY_ENTRY;
  102. #pragma pack()