This repository has been archived by the owner on Mar 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor(error): begin use of anyhow * feat(dev): begin of devices implementations * refactor(error): remove anyhow * feat: continue implementation of devices * feat: add `from` method for Slice and remove unused starting address * feat: continue implementation of device * feat: add Commit object + end test for generic implemented devices * test(dev): add file test * chore: update `flush` function to `commit` * feat(dev): `read_at` and `write_at` given functions * chore(dev): change `u32` in `Address` implementation to `usize` * feat(ext2): begin parsing of superblock * feat(ext2): complete superblock parsing * feat(ext2): end implementation superblock * feat(ext2): block group descriptors + beginning of inodes * test(ext2): add bad parsing tests * feat(ext2): add Osd2 struct for inodes * feat(ext2): add read data from inodes * refactor(dev): change Address implementation * feat(ext2): add directory parsing * feat(ext2): implementation of regular files * refactor(ext2): structure parsing * refactor(ext2): change Rc to simple borrow * refactor(fs): delete Box to use type parameters * refactor(ext2): celled implementation * feat(ext2): end of directory and symlinks implementation * refactor: split efs into crates * revert: merge all crates into one * feat(ext2): free block allocation * feat(ext2): minimal version of file write * fix(ext2): add tests for I/O operations + fix block writing * feat(io): add connections with std * test(ext2): add basic file write tests * fix(ext2): fully tested and correct inode write * refactor(fs): move generics to placeholders * feat(ext2): Celled<Ext2> implements FileSystem * fix(ext2): symlink stored path resolution for path with length <= 60 --------- Co-authored-by: Rat Cornu <ratcornu@skaven.org>
- Loading branch information
Showing
34 changed files
with
5,508 additions
and
202 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
*.ext2 filter=lfs diff=lfs merge=lfs -text | ||
*.ext3 filter=lfs diff=lfs merge=lfs -text | ||
*.ext4 filter=lfs diff=lfs merge=lfs -text |
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
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 |
---|---|---|
|
@@ -3,8 +3,6 @@ name: Release | |
on: | ||
release: | ||
types: [created] | ||
push: | ||
|
||
|
||
jobs: | ||
release: | ||
|
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
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
//! Interface to use celled objects. | ||
//! | ||
//! It provides an interface to contenerize objects with the guarantee that the `clone` method is not expansive and the new celled | ||
//! object point to the same initial one; | ||
use alloc::rc::Rc; | ||
use core::cell::RefCell; | ||
|
||
use derive_more::{Deref, DerefMut}; | ||
|
||
/// Type alias for celled objects. | ||
#[derive(Deref, DerefMut)] | ||
pub struct Celled<T>(Rc<RefCell<T>>); | ||
|
||
impl<T> Clone for Celled<T> { | ||
#[inline] | ||
fn clone(&self) -> Self { | ||
Self(Rc::clone(&self.0)) | ||
} | ||
} | ||
|
||
impl<T> Celled<T> { | ||
/// Creates a new celled object. | ||
#[inline] | ||
pub fn new(obj: T) -> Self { | ||
Self(Rc::new(RefCell::new(obj))) | ||
} | ||
} |
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,29 @@ | ||
//! Errors related to device manipulation. | ||
use alloc::fmt; | ||
use core::error; | ||
use core::fmt::Display; | ||
|
||
/// Enumeration of possible errors encountered with device's manipulation. | ||
#[allow(clippy::module_name_repetitions)] | ||
#[derive(Debug, PartialEq, Eq)] | ||
pub enum DevError { | ||
/// `OutOfBounds(structure, value, (lower_bound, upper_bound))`: the given `struct` has a `value` not between the given bounds | ||
OutOfBounds(&'static str, i128, (i128, i128)), | ||
} | ||
|
||
impl Display for DevError { | ||
#[inline] | ||
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
match self { | ||
Self::OutOfBounds(structure, value, (lower_bound, upper_bound)) => { | ||
write!( | ||
formatter, | ||
"Out of Bounds: the {structure} has a value {value} not between the lower bound {lower_bound} and the upper bound {upper_bound}" | ||
) | ||
}, | ||
} | ||
} | ||
} | ||
|
||
impl error::Error for DevError {} |
Oops, something went wrong.