Ext4Dxe.inf 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. ## @file
  2. # Ext4 Package
  3. #
  4. # UEFI Driver that produces the Simple File System Protocol for a partition that is formatted
  5. # with the EXT4 file system.
  6. # More details are available at: https://www.kernel.org/doc/html/v5.4/filesystems/ext4/index.html
  7. #
  8. # Copyright (c) 2021 Pedro Falcato
  9. # SPDX-License-Identifier: BSD-2-Clause-Patent
  10. #
  11. # Layout of an EXT2/3/4 filesystem:
  12. # (note: this driver has been developed using
  13. # https://www.kernel.org/doc/html/latest/filesystems/ext4/index.html as
  14. # documentation).
  15. #
  16. # An ext2/3/4 filesystem (here on out referred to as simply an ext4 filesystem,
  17. # due to the similarities) is composed of various concepts:
  18. #
  19. # 1) Superblock
  20. # The superblock is the structure near (1024 bytes offset from the start)
  21. # the start of the partition, and describes the filesystem in general.
  22. # Here, we get to know the size of the filesystem's blocks, which features
  23. # it supports or not, whether it's been cleanly unmounted, how many blocks
  24. # we have, etc.
  25. #
  26. # 2) Block groups
  27. # EXT4 filesystems are divided into block groups, and each block group covers
  28. # s_blocks_per_group(8 * Block Size) blocks. Each block group has an
  29. # associated block group descriptor; these are present directly after the
  30. # superblock. Each block group descriptor contains the location of the
  31. # inode table, and the inode and block bitmaps (note these bitmaps are only
  32. # a block long, which gets us the 8 * Block Size formula covered previously).
  33. #
  34. # 3) Blocks
  35. # The ext4 filesystem is divided in blocks, of size s_log_block_size ^ 1024.
  36. # Blocks can be allocated using individual block groups's bitmaps. Note
  37. # that block 0 is invalid and its presence on extents/block tables means
  38. # it's part of a file hole, and that particular location must be read as
  39. # a block full of zeros.
  40. #
  41. # 4) Inodes
  42. # The ext4 filesystem divides files/directories into inodes (originally
  43. # index nodes). Each file/socket/symlink/directory/etc (here on out referred
  44. # to as a file, since there is no distinction under the ext4 filesystem) is
  45. # stored as a /nameless/ inode, that is stored in some block group's inode
  46. # table. Each inode has s_inode_size size (or GOOD_OLD_INODE_SIZE if it's
  47. # an old filesystem), and holds various metadata about the file. Since the
  48. # largest inode structure right now is ~160 bytes, the rest of the inode
  49. # contains inline extended attributes. Inodes' data is stored using either
  50. # data blocks (under ext2/3) or extents (under ext4).
  51. #
  52. # 5) Extents
  53. # Ext4 inodes store data in extents. These let N contiguous logical blocks
  54. # that are represented by N contiguous physical blocks be represented by a
  55. # single extent structure, which minimizes filesystem metadata bloat and
  56. # speeds up block mapping (particularly due to the fact that high-quality
  57. # ext4 implementations like linux's try /really/ hard to make the file
  58. # contiguous, so it's common to have files with almost 0 fragmentation).
  59. # Inodes that use extents store them in a tree, and the top of the tree
  60. # is stored on i_data. The tree's leaves always start with an
  61. # EXT4_EXTENT_HEADER and contain EXT4_EXTENT_INDEX on eh_depth != 0 and
  62. # EXT4_EXTENT on eh_depth = 0; these entries are always sorted by logical
  63. # block.
  64. #
  65. # 6) Directories
  66. # Ext4 directories are files that store name -> inode mappings for the
  67. # logical directory; this is where files get their names, which means ext4
  68. # inodes do not themselves have names, since they can be linked (present)
  69. # multiple times with different names. Directories can store entries in two
  70. # different ways:
  71. # 1) Classical linear directories: They store entries as a mostly-linked
  72. # mostly-list of EXT4_DIR_ENTRY.
  73. # 2) Hash tree directories: These are used for larger directories, with
  74. # hundreds of entries, and are designed in a backwards compatible way.
  75. # These are not yet implemented in the Ext4Dxe driver.
  76. #
  77. # 7) Journal
  78. # Ext3/4 filesystems have a journal to help protect the filesystem against
  79. # system crashes. This is not yet implemented in Ext4Dxe but is described
  80. # in detail in the Linux kernel's documentation.
  81. ##
  82. [Defines]
  83. INF_VERSION = 0x00010005
  84. BASE_NAME = Ext4Dxe
  85. MODULE_UNI_FILE = Ext4Dxe.uni
  86. FILE_GUID = 75F2B676-D73B-45CB-B7C1-303C7F4E6FD6
  87. MODULE_TYPE = UEFI_DRIVER
  88. VERSION_STRING = 1.0
  89. ENTRY_POINT = Ext4EntryPoint
  90. UNLOAD_IMAGE = Ext4Unload
  91. #
  92. # The following information is for reference only and not required by the build tools.
  93. #
  94. # VALID_ARCHITECTURES = IA32 X64 EBC
  95. #
  96. [Sources]
  97. Ext4Dxe.c
  98. Partition.c
  99. DiskUtil.c
  100. Superblock.c
  101. BlockGroup.c
  102. Inode.c
  103. Directory.c
  104. Extents.c
  105. File.c
  106. Symlink.c
  107. Collation.c
  108. Ext4Disk.h
  109. Ext4Dxe.h
  110. BlockMap.c
  111. [Packages]
  112. MdePkg/MdePkg.dec
  113. RedfishPkg/RedfishPkg.dec
  114. [LibraryClasses]
  115. UefiRuntimeServicesTableLib
  116. UefiBootServicesTableLib
  117. MemoryAllocationLib
  118. BaseMemoryLib
  119. BaseLib
  120. UefiLib
  121. UefiDriverEntryPoint
  122. DebugLib
  123. PcdLib
  124. OrderedCollectionLib
  125. BaseUcs2Utf8Lib
  126. [Guids]
  127. gEfiFileInfoGuid ## SOMETIMES_CONSUMES ## UNDEFINED
  128. gEfiFileSystemInfoGuid ## SOMETIMES_CONSUMES ## UNDEFINED
  129. gEfiFileSystemVolumeLabelInfoIdGuid ## SOMETIMES_CONSUMES ## UNDEFINED
  130. [Protocols]
  131. gEfiDiskIoProtocolGuid ## TO_START
  132. gEfiDiskIo2ProtocolGuid ## TO_START
  133. gEfiBlockIoProtocolGuid ## TO_START
  134. gEfiSimpleFileSystemProtocolGuid ## BY_START
  135. gEfiUnicodeCollationProtocolGuid ## TO_START
  136. gEfiUnicodeCollation2ProtocolGuid ## TO_START
  137. [Pcd]
  138. gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang ## SOMETIMES_CONSUMES
  139. gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang ## SOMETIMES_CONSUMES