1
0
mirror of https://github.com/sgmarz/osblog.git synced 2024-11-24 02:16:19 +04:00

Add fs and minix

This commit is contained in:
Stephen Marz 2020-03-18 10:40:27 -04:00
parent d6bf3d2685
commit b39db75cf4
3 changed files with 29 additions and 0 deletions

16
risc_v/src/fs.rs Executable file
View File

@ -0,0 +1,16 @@
// fs.rs
// Filesystem for SOS
// Stephen Marz
// 16 March 2020
use alloc::string::String;
pub trait FileSystem {
fn open(path: &String) -> Option<Descriptor>;
fn read(desc: &Descriptor, buffer: *mut u8, offset: u32, size: u32) -> u32;
}
/// A file descriptor
pub struct Descriptor {
}

View File

@ -164,7 +164,9 @@ extern "C" fn kinit_hart(_hartid: usize) {
pub mod block;
pub mod cpu;
pub mod fs;
pub mod kmem;
pub mod minixfs;
pub mod page;
pub mod plic;
pub mod process;

11
risc_v/src/minixfs.rs Executable file
View File

@ -0,0 +1,11 @@
// minixfs.rs
// Minix 3 Filesystem Implementation
// Stephen Marz
// 16 March 2020
use crate::fs::{Descriptor, FileSystem};
pub struct MinixFileSystem {
}