diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-04-13 09:06:24 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-13 09:06:24 +0200 |
| commit | 44278e2466780e1a014fcb51f0c68cb8a89a48c4 (patch) | |
| tree | 6208a15a0ae7af2ca15300a5ea4f0cf3ec342117 /lib | |
| parent | 6dd868e57f32905e5e553f6e3ed5ef35ae5cae77 (diff) | |
| parent | 103a1ae6157bc3216e5b141f72f2621fefb8a485 (diff) | |
Merge pull request #2 from amlel-el-mahrouss/dev
embdfs: add filesystem structure + tex files.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/astdx/embdfs.hpp | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/lib/astdx/embdfs.hpp b/lib/astdx/embdfs.hpp index 6b018cf..dbb0042 100644 --- a/lib/astdx/embdfs.hpp +++ b/lib/astdx/embdfs.hpp @@ -15,7 +15,7 @@ /// @brief A Filesystem designed for tiny storage medias. /// @author Amlal EL Mahrouss (amlal@nekernel.org) -namespace astdx::freestanding +namespace astdx::embdfs { namespace details { @@ -24,6 +24,9 @@ namespace astdx::freestanding inline constexpr const size_t _superblock_name_len = 16; inline constexpr const size_t _superblock_reserve_len = 462; + inline constexpr const size_t _inode_name_len = 128; + inline constexpr const size_t _inode_arr_len = 12; + inline constexpr const size_t _inode_lookup_len = 8; #ifdef EMBDFS_28BIT_LBA typedef std::uint32_t lba_t; @@ -50,21 +53,26 @@ namespace astdx::freestanding utf8_char_t s_name[_superblock_name_len]; utf8_char_t s_reserved[_superblock_reserve_len]; }; - } // namespace details - /// @brief Creates the library context. - /// @return Whether it suceeded or not. - inline int32_t embdfs_create_context() - { - return 0; - } + /// @brief Indexed node structure. + /// @brief i_name file name + /// @brief i_size_virt, i_size_phys: virtual and physical (sector count) size. + /// @brief i_offset direct block pointer. + /// @brief i_checksum crc32 checksum. + /// @brief i_flags_perms flags and permissions + /// @brief i_acl_* ACL to keep track of inode allocation status. + struct embdfs_inode + { + utf8_char_t i_name[_inode_name_len]; + sword_t i_size_virt, i_size_phys; + lba_t i_offset[_inode_lookup_len]; + sword_t i_checksum, i_flags_perms; + lba_t i_acl_creat, i_acl_edit, i_acl_delet; + }; - /// @brief Destroys the library context. - /// @return Whether it suceeded or not. - inline int32_t embdfs_destroy_context() - { - return 0; - } -} // namespace astdx::freestanding + /// @brief Indexed node linear array. + typedef embdfs_inode embdfs_inode_arr_t[_inode_arr_len]; + } // namespace details +} // namespace astdx::embdfs #endif // ifndef _STDX_EMBDFS_HPP
\ No newline at end of file |
