Remove second await in read block because it somehow works now
All checks were successful
continuous-integration/drone/push Build is passing

Signed-off-by: Julien CLEMENT <julien.clement@epita.fr>
This commit is contained in:
Julien CLEMENT 2022-12-16 21:12:28 +01:00
parent f44b808f67
commit e84a2e5727
3 changed files with 5 additions and 9 deletions

@ -1,3 +1,4 @@
use crate::println;
use core::future::Future; use core::future::Future;
use core::pin::Pin; use core::pin::Pin;

@ -245,6 +245,7 @@ impl ATABus {
complete = self.sector_count.read(); complete = self.sector_count.read();
} }
} }
self.wait_command_end();
} }
pub async fn read_block(&mut self, lba: u32) { pub async fn read_block(&mut self, lba: u32) {
@ -256,13 +257,9 @@ impl ATABus {
self.send_packet(packet); self.send_packet(packet);
println!("Waiting packet send");
// Wait packet is transmitted // Wait packet is transmitted
(*INTERRUPT_FUTURE).await; (*INTERRUPT_FUTURE).await;
println!("Packet sent");
let mut _size: usize = 0; let mut _size: usize = 0;
unsafe { unsafe {
_size = ((self.address3.read() as usize) << 8) | self.address2.read() as usize; _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 // Wait command end
(*INTERRUPT_FUTURE).await; //(*INTERRUPT_FUTURE).await;
println!("Command sent");
self.wait_command_end(); self.wait_command_end();
} }
@ -325,6 +320,6 @@ impl ATABus {
pub async fn print_block() { 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); serial_println!("{:x?}", DRIVE.lock().as_mut().unwrap().block);
} }

@ -5,7 +5,7 @@ use x86_64::structures::idt::InterruptStackFrame;
fn disk_interrupt_handler(disk: u16) { fn disk_interrupt_handler(disk: u16) {
crate::drivers::atapi::interrupt::mark_interrupt(); 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) { pub extern "x86-interrupt" fn disk1_interrupt_handler(_stack_frame: InterruptStackFrame) {