diff --git a/src/drivers/atapi/interrupt.rs b/src/drivers/atapi/interrupt.rs index d2ab98d..3c8768d 100644 --- a/src/drivers/atapi/interrupt.rs +++ b/src/drivers/atapi/interrupt.rs @@ -1,3 +1,4 @@ +use crate::println; use core::future::Future; use core::pin::Pin; diff --git a/src/drivers/atapi/mod.rs b/src/drivers/atapi/mod.rs index 7708c3c..e3ff635 100644 --- a/src/drivers/atapi/mod.rs +++ b/src/drivers/atapi/mod.rs @@ -245,6 +245,7 @@ impl ATABus { complete = self.sector_count.read(); } } + self.wait_command_end(); } pub async fn read_block(&mut self, lba: u32) { @@ -256,13 +257,9 @@ impl ATABus { self.send_packet(packet); - println!("Waiting packet send"); - // Wait packet is transmitted (*INTERRUPT_FUTURE).await; - println!("Packet sent"); - let mut _size: usize = 0; unsafe { _size = ((self.address3.read() as usize) << 8) | self.address2.read() as usize; @@ -276,10 +273,8 @@ impl ATABus { } } - println!("Waiting command send"); // Wait command end - (*INTERRUPT_FUTURE).await; - println!("Command sent"); + //(*INTERRUPT_FUTURE).await; self.wait_command_end(); } @@ -325,6 +320,6 @@ impl ATABus { pub async fn print_block() { - DRIVE.lock().as_mut().unwrap().read_block(0).await; + DRIVE.lock().as_mut().unwrap().read_block(500).await; serial_println!("{:x?}", DRIVE.lock().as_mut().unwrap().block); } \ No newline at end of file diff --git a/src/interrupts/pic/disk.rs b/src/interrupts/pic/disk.rs index 405a5cf..f2d91dc 100644 --- a/src/interrupts/pic/disk.rs +++ b/src/interrupts/pic/disk.rs @@ -5,7 +5,7 @@ use x86_64::structures::idt::InterruptStackFrame; fn disk_interrupt_handler(disk: u16) { crate::drivers::atapi::interrupt::mark_interrupt(); - println!("Received disk {} interrupt", disk); + // println!("Received disk {} interrupt", disk); } pub extern "x86-interrupt" fn disk1_interrupt_handler(_stack_frame: InterruptStackFrame) {