possibilité d'écrire et de lire plusieurs secteurs d'un coup

This commit is contained in:
Moysan Gabriel
2023-04-19 00:55:53 +02:00
parent 153c3d6618
commit 8b19189689
2 changed files with 84 additions and 6 deletions

View File

@ -38,6 +38,34 @@ impl DrvDisk {
_ => (),
}
}
/// read inside the disk
///
/// ### Parameters
///
/// - **self** driver disk
/// - **sector_number** sector where to read the data
/// - **data** where the readed data will be stored
pub fn read_multiple_sector(&mut self, sector_number: i32, data: &mut [u8]) {
match Disk::read_multiple_request(&mut self.disk, sector_number, data) {
Err(e) => println!("{:?}", e),
_ => (),
}
}
/// write inside the disk
///
/// ### Parameters
///
/// - **self** driver disk
/// - **sector_number** sector where to write the data
/// - **data** where the data to write is stored
pub fn write_multiple_sector(&mut self, sector_number: i32, data: &[u8]) {
match Disk::write_multiple_request(&mut self.disk, sector_number, data) {
Err(e) => println!("{:?}", e),
_ => (),
}
}
}
#[cfg(test)]