diff --git a/src/drivers/atapi/interrupt.rs b/src/drivers/atapi/interrupt.rs
index 80ea515..8cbb063 100644
--- a/src/drivers/atapi/interrupt.rs
+++ b/src/drivers/atapi/interrupt.rs
@@ -3,26 +3,24 @@ use core::pin::Pin;
use core::sync::atomic::{AtomicBool, Ordering};
use core::task::{Context, Poll};
-use lazy_static::lazy_static;
use futures_util::task::AtomicWaker;
+use lazy_static::lazy_static;
lazy_static! {
pub static ref INTERRUPT_FUTURE: InterruptFuture = InterruptFuture::new();
-
static ref INTERRUPT: AtomicBool = AtomicBool::new(false);
}
static WAKER: AtomicWaker = AtomicWaker::new();
-
pub(crate) fn mark_interrupt() {
INTERRUPT.store(true, Ordering::Relaxed);
WAKER.wake();
}
-#[derive(Copy,Clone)]
+#[derive(Copy, Clone)]
pub struct InterruptFuture {
- _private:(),
+ _private: (),
}
impl InterruptFuture {
@@ -51,8 +49,8 @@ impl Future for InterruptFuture {
true => {
WAKER.take();
Poll::Ready(())
- },
+ }
false => Poll::Pending,
}
}
-}
\ No newline at end of file
+}
diff --git a/src/drivers/atapi/mod.rs b/src/drivers/atapi/mod.rs
index 6614374..6a50729 100644
--- a/src/drivers/atapi/mod.rs
+++ b/src/drivers/atapi/mod.rs
@@ -1,20 +1,20 @@
-mod scsi;
pub mod interrupt;
+mod scsi;
use crate::{println, serial_println};
-use scsi::{SCSIPacket};
-use interrupt::{INTERRUPT_FUTURE};
+use interrupt::INTERRUPT_FUTURE;
+use scsi::SCSIPacket;
use core::convert::TryInto;
-use lazy_static::lazy_static;
use crate::utils::AsyncMutex;
+use lazy_static::lazy_static;
use x86_64::instructions::port::Port;
const CD_SECTOR_SIZE: usize = 2048;
// Data buses
-const ATA_BUS_PRIMARY: u16= 0x1f0;
+const ATA_BUS_PRIMARY: u16 = 0x1f0;
const ATA_BUS_SECONDARY: u16 = 0x170;
// Drives
@@ -54,16 +54,14 @@ static ATAPI_SIG: [u8; 4] = [
ATAPI_SIG_SC,
ATAPI_SIG_LBA_LO,
ATAPI_SIG_LBA_MI,
- ATAPI_SIG_LBA_HI
+ ATAPI_SIG_LBA_HI,
];
lazy_static! {
- pub static ref DRIVE: AsyncMutex