Add comments in ch6

This commit is contained in:
hypocrasy 2022-04-30 16:04:58 +08:00
parent cea2febe35
commit f9346edad1
35 changed files with 374 additions and 116 deletions

View file

@ -1,6 +1,9 @@
use core::any::Any;
/// Trait for block devices
/// which reads and writes data in the unit of blocks
pub trait BlockDevice: Send + Sync + Any {
///Read data form block to buffer
fn read_block(&self, block_id: usize, buf: &mut [u8]);
///Write data from buffer to block
fn write_block(&self, block_id: usize, buf: &[u8]);
}