diff options
| author | marcel.braun <marcel.braun@ost.ch> | 2026-03-29 16:57:19 +0200 |
|---|---|---|
| committer | marcel.braun <marcel.braun@ost.ch> | 2026-03-29 16:57:19 +0200 |
| commit | a64b9daefeee0f91fe74d6df394944b71ecc7d80 (patch) | |
| tree | 8e917c48f51ae37442041aee40c991fb99bb4a2b /kernel/include | |
| parent | fd6e5899f6e0dc238a7944772e35d0ec6b738a38 (diff) | |
| download | teachos-a64b9daefeee0f91fe74d6df394944b71ecc7d80.tar.xz teachos-a64b9daefeee0f91fe74d6df394944b71ecc7d80.zip | |
Add ext2_superblock definiton
Diffstat (limited to 'kernel/include')
| -rw-r--r-- | kernel/include/kernel/filesystem/ext2/ext2_superblock.hpp | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/kernel/include/kernel/filesystem/ext2/ext2_superblock.hpp b/kernel/include/kernel/filesystem/ext2/ext2_superblock.hpp new file mode 100644 index 0000000..cd77cd4 --- /dev/null +++ b/kernel/include/kernel/filesystem/ext2/ext2_superblock.hpp @@ -0,0 +1,76 @@ +#ifndef EXT2_SUPERBLOCK_HPP +#define EXT2_SUPERBLOCK_HPP + +#include <array> +#include <cstdint> + +namespace filesystem::ext2 +{ + struct ext2_superblock + { + uint32_t inodes_count; + uint32_t blocks_count; + uint32_t reserved_blocks_count; + uint32_t free_blocks_count; + uint32_t free_inodes_count; + uint32_t first_data_block; + uint32_t log_block_size; + uint32_t log_frag_size; + uint32_t blocks_per_group; + uint32_t frags_per_group; + uint32_t inodes_per_group; + uint32_t mtime; + uint32_t wtime; + uint16_t mnt_count; + uint16_t max_mnt_count; + uint16_t magic; + uint16_t state; + uint16_t errors; + uint16_t minor_rev_level; + uint32_t lastcheck; + uint32_t checkinterval; + uint32_t creator_os; + uint32_t rev_level; + uint16_t def_resuid; + uint16_t def_resgid; + + // EXT2_DYNAMIC_REV superblock only + uint32_t first_ino; + uint16_t inode_size; + uint16_t block_group_nr; + uint32_t feature_compat; + uint32_t feature_incompat; + uint32_t feature_ro_compat; + // uint8_t uuid[16]; // TODO BA-FS26 really correct? + std::array<uint8_t, 16> uuid; + // uint8_t volume_name[16]; // TODO BA-FS26 really correct? + std::array<uint8_t, 16> volume_name; + // uint8_t last_mounted[64]; // TODO BA-FS26 really correct? + std::array<uint8_t, 64> last_mounted; + uint32_t algorithm_usage_bitmap; + + // Performance Hints + uint8_t prealloc_blocks; + uint8_t prealloc_dir_blocks; + uint16_t padding1; + + // Journaling Support + // uint8_t journal_uuid[16]; // TODO BA-FS26 really correct? + std::array<uint8_t, 16> journal_uuid; + uint32_t journal_inum; + uint32_t journal_dev; + uint32_t last_orphan; + + // Directory Indexing Support + // uint32_t hash_seed[4]; // TODO BA-FS26 really correct? + std::array<uint32_t, 4> hash_seed; + uint8_t def_hash_version; + std::array<uint8_t, 3> padding2; + + // Other options + uint32_t default_mount_options; + uint32_t first_meta_bg; + std::array<uint8_t, 760> unused; // NOLINT(readability-magic-numbers) + }; +} // namespace filesystem::ext2 +#endif
\ No newline at end of file |
