-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Feat: Create an ext4 file system compatible program entry.
- Loading branch information
Showing
12 changed files
with
147 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ name = "canicula_ext4" | |
path = "src/ext4.rs" | ||
|
||
[dependencies] | ||
canicula-common = { path = "../canicula-common" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,30 @@ | ||
#![no_std] | ||
#![no_main] | ||
|
||
use canicula_common::fs::OperateError; | ||
use types::super_block::SuperBlock; | ||
|
||
mod types; | ||
|
||
#[allow(unused)] | ||
struct Ext4FS<const SIZE: usize> { | ||
read_byte: fn(usize) -> Result<u8, OperateError>, | ||
write_byte: fn(u8, usize) -> Result<usize, OperateError>, | ||
super_block: Option<SuperBlock>, | ||
} | ||
|
||
#[allow(unused)] | ||
impl<const SIZE: usize> Ext4FS<SIZE> { | ||
pub fn new( | ||
read_byte: fn(usize) -> Result<u8, OperateError>, | ||
write_byte: fn(u8, usize) -> Result<usize, OperateError>, | ||
) -> Self { | ||
Ext4FS { | ||
read_byte, | ||
write_byte, | ||
super_block: None, | ||
} | ||
} | ||
|
||
pub fn init() {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
pub mod data_block; | ||
pub mod data_block_bitmap; | ||
pub mod group_descriptors; | ||
pub mod inode_bitmap; | ||
pub mod inode_table; | ||
pub mod super_block; |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
#[repr(C)] | ||
#[derive(Debug, Clone, Copy, PartialEq, Eq)] | ||
pub struct SuperBlock { | ||
s_inodes_count: u32, | ||
s_blocks_count_lo: u32, | ||
s_r_blocks_count_lo: u32, | ||
s_free_blocks_count_lo: u32, | ||
s_free_inodes_count: u32, | ||
s_first_data_block: u32, | ||
s_log_block_size: u32, | ||
s_log_cluster_size: u32, | ||
s_blocks_per_group: u32, | ||
s_clusters_per_group: u32, | ||
s_inodes_per_group: u32, | ||
s_mtime: u32, | ||
s_wtime: u32, | ||
s_mnt_count: u16, | ||
s_max_mnt_count: u16, | ||
s_magic: u16, | ||
s_state: u16, | ||
s_errors: u16, | ||
s_minor_rev_level: u16, | ||
s_lastcheck: u32, | ||
s_checkinterval: u32, | ||
s_creator_os: u32, | ||
s_rev_level: u32, | ||
s_def_resuid: u16, | ||
s_def_resgid: u16, | ||
s_first_ino: u32, | ||
s_inode_size: u16, | ||
s_block_group_nr: u16, | ||
s_feature_compat: u32, | ||
s_feature_incompat: u32, | ||
s_feature_ro_compat: u32, | ||
s_uuid: [u8; 16], | ||
s_volume_name: [char; 16], | ||
s_last_mounted: [char; 64], | ||
s_algorithm_usage_bitmap: u32, | ||
s_prealloc_blocks: u8, | ||
s_prealloc_dir_blocks: u8, | ||
s_reserved_gdt_blocks: u16, | ||
s_journal_uuid: [u8; 16], | ||
s_journal_inum: u32, | ||
s_journal_dev: u32, | ||
s_last_orphan: u32, | ||
s_hash_seed: [u32; 4], | ||
s_def_hash_version: u8, | ||
s_jnl_backup_type: u8, | ||
s_desc_size: u16, | ||
s_default_mount_opts: u32, | ||
s_first_meta_bg: u32, | ||
s_mkfs_time: u32, | ||
s_jnl_blocks: [u32; 17], | ||
s_blocks_count_hi: u32, | ||
s_r_blocks_count_hi: u32, | ||
s_free_blocks_count_hi: u32, | ||
s_min_extra_isize: u16, | ||
s_want_extra_isize: u16, | ||
s_flags: u32, | ||
s_raid_stride: u16, | ||
s_mmp_interval: u16, | ||
s_mmp_block: u64, | ||
s_raid_stripe_width: u32, | ||
s_log_groups_per_flex: u8, | ||
s_checksum_type: u8, | ||
s_reserved_pad: u16, | ||
s_kbytes_written: u64, | ||
s_snapshot_inum: u32, | ||
s_snapshot_id: u32, | ||
s_snapshot_r_blocks_count: u64, | ||
s_snapshot_list: u32, | ||
s_error_count: u32, | ||
s_first_error_time: u32, | ||
s_first_error_ino: u32, | ||
s_first_error_block: u64, | ||
s_first_error_func: [u8; 32], | ||
s_first_error_line: u32, | ||
s_last_error_time: u32, | ||
s_last_error_ino: u32, | ||
s_last_error_line: u32, | ||
s_last_error_block: u64, | ||
s_last_error_func: [u8; 32], | ||
s_mount_opts: [u8; 64], | ||
s_usr_quota_inum: u32, | ||
s_grp_quota_inum: u32, | ||
s_overhead_blocks: u32, | ||
s_backup_bgs: [u32; 2], | ||
s_encrypt_algos: [u8; 4], | ||
s_encrypt_pw_salt: [u8; 16], | ||
s_lpf_ino: u32, | ||
s_prj_quota_inum: u32, | ||
s_checksum_seed: u32, | ||
s_reserved: [u32; 98], | ||
s_checksum: u32, | ||
} | ||
|
||
impl SuperBlock {} |