diff options
author | Chuyan Zhang <me@zcy.moe> | 2023-11-30 02:15:06 -0800 |
---|---|---|
committer | Chuyan Zhang <me@zcy.moe> | 2023-11-30 02:15:06 -0800 |
commit | 1eac97eea4ec0bcef0be061a2cba93a584355283 (patch) | |
tree | d98fb1f6e3811286a0733c9df21e467590635ad2 /ayafs/src/block_device/mod.rs | |
parent | b3db8a5a710aa0890c80241ffb3fd9792bf1cbe7 (diff) | |
download | myfs-1eac97eea4ec0bcef0be061a2cba93a584355283.tar.gz myfs-1eac97eea4ec0bcef0be061a2cba93a584355283.zip |
Add real disk i/o, add mkfs.aya (not yet implemented)
Diffstat (limited to 'ayafs/src/block_device/mod.rs')
-rw-r--r-- | ayafs/src/block_device/mod.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ayafs/src/block_device/mod.rs b/ayafs/src/block_device/mod.rs new file mode 100644 index 0000000..a1e6544 --- /dev/null +++ b/ayafs/src/block_device/mod.rs @@ -0,0 +1,10 @@ +/// Abstracts for block devices. +/// Currently only a mock memory disk. +pub mod memory_disk; +pub mod disk; + +pub const BLOCK_SIZE: usize = 4096; +pub trait BlockDevice { + fn read(&self, block_id: usize, buffer: &mut [u8]); + fn write(&self, block_id: usize, buffer: &[u8]); +} |