From 1eac97eea4ec0bcef0be061a2cba93a584355283 Mon Sep 17 00:00:00 2001 From: Chuyan Zhang Date: Thu, 30 Nov 2023 02:15:06 -0800 Subject: Add real disk i/o, add mkfs.aya (not yet implemented) --- ayafs/src/block_device/mod.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 ayafs/src/block_device/mod.rs (limited to 'ayafs/src/block_device/mod.rs') 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]); +} -- cgit v1.2.3-70-g09d2