[VFS] Skeleton for moving victoria falls to rust.
This commit is contained in:
parent
59efb1659a
commit
a806e41af0
11 changed files with 130 additions and 3 deletions
19
rust/lib/fs/ext2/src/ext2_driver.rs
Normal file
19
rust/lib/fs/ext2/src/ext2_driver.rs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
use denali_client::DiskReader;
|
||||
use mammoth::mem::MemoryRegion;
|
||||
|
||||
use crate::types::Superblock;
|
||||
|
||||
pub struct Ext2Driver {
|
||||
reader: DiskReader,
|
||||
}
|
||||
|
||||
impl Ext2Driver {
|
||||
pub fn new(mut reader: DiskReader) -> Self {
|
||||
let super_block_mem = MemoryRegion::from_cap(reader.read(2, 2).unwrap()).unwrap();
|
||||
let super_block: &Superblock = super_block_mem.as_ref();
|
||||
let inodes = super_block.inodes_count;
|
||||
let magic = super_block.magic;
|
||||
mammoth::debug!("Superblock ({:#x}): inodes: {:#x}", magic, inodes);
|
||||
Self { reader }
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue