struggling with drives PIC hardware interrupts
continuous-integration/drone/push Build is passing

Signed-off-by: Julien CLEMENT <julien.clement@epita.fr>
This commit is contained in:
juju committed 2022-12-13 21:38:09 +01:00
1 parent 5e41662c09
commit 8e0fbfe263
5 files changed
+47 -8

No files matched your search

+6 -6
View File
@@ -54,7 +54,7 @@ static ATAPI_SIG: [u8; 4] = [
];
lazy_static! {
static ref DRIVE: Mutex<Option<ATABus>> = {
pub static ref DRIVE: Mutex<Option<ATABus>> = {
Mutex::new(ATABus::discover_atapi_drive())
};
}
@@ -80,7 +80,7 @@ pub fn init() {
}
#[derive(Debug)]
struct ATABus {
pub struct ATABus {
base_port: u16,
// IO ports
@@ -99,7 +99,7 @@ struct ATABus {
current_drive: u8,
block: [u8; CD_SECTOR_SIZE],
pub block: [u8; CD_SECTOR_SIZE],
}
impl ATABus {
@@ -108,7 +108,7 @@ impl ATABus {
unsafe {
primary_bus.dcr.write(ATA_SRST);
primary_bus.dcr.write(ATA_INTERRUPT_DISABLE);
primary_bus.dcr.write(0);
}
primary_bus.select_drive(ATA_DRIVE_MASTER);
@@ -125,7 +125,7 @@ impl ATABus {
unsafe {
secondary_bus.dcr.write(ATA_SRST);
primary_bus.dcr.write(ATA_INTERRUPT_DISABLE);
primary_bus.dcr.write(0);
}
secondary_bus.select_drive(ATA_DRIVE_MASTER);
@@ -204,7 +204,7 @@ impl ATABus {
}
}
fn read_block(&mut self, lba: u32) {
pub fn read_block(&mut self, lba: u32) {
let mut packet = SCSIPacket::new();
packet.op_code = SCSI_READ_12;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.