int FDD_ReadSector(Uint32 disk, Uint64 lba, void *Buffer);
int FDD_WriteSector(Uint32 Disk, Uint64 LBA, void *Buffer);
// --- Helpers
-void FDD_IRQHandler(int Num);
+void FDD_IRQHandler(int Num, void *Ptr);
inline void FDD_WaitIRQ();
void FDD_SensInt(int base, Uint8 *sr0, Uint8 *cyl);
int FDD_int_SendByte(int base, Uint8 Byte);
}
// Install IRQ6 Handler
- IRQ_AddHandler(6, FDD_IRQHandler);
+ IRQ_AddHandler(6, FDD_IRQHandler, NULL);
// Ensure the FDD version is 0x90
{
* \fn void FDD_IRQHandler(int Num)
* \brief Handles IRQ6
*/
-void FDD_IRQHandler(int Num)
+void FDD_IRQHandler(int Num, void *Ptr)
{
gbFDD_IrqFired = 1;
}
if( inb(base + PORT_MAINSTATUS) & 0x40 ) {
Log_Warning("FDD", "FDD_int_SendByte: DIO set, is this ok?");
+ return -2;
}
if( now() < end )
if( !(inb(base + PORT_MAINSTATUS) & 0x40) ) {
Log_Warning("FDD", "FDD_int_GetByte: DIO unset, is this ok?");
+ return -2;
}
if( now() < end )
// Recalibrate disks
LOG("Recalibrate disks (16x seek)");
retries = 16;
- while(FDD_int_SeekTrack(0, 0, 1) == 0 && retries --); // set track
+ while(FDD_int_SeekTrack(0, 0, 1) == 0 && retries --)
+ Threads_Yield(); // set track
if(retries < 0) LEAVE_RET('i', -1);
retries = 16;
- while(FDD_int_SeekTrack(0, 1, 1) == 0 && retries --); // set track
+ while(FDD_int_SeekTrack(0, 1, 1) == 0 && retries --)
+ Threads_Yield(); // set track
if(retries < 0) LEAVE_RET('i', -1);
LOG("Recalibrating Disk");