From: John Hodge Date: Tue, 4 Oct 2011 04:04:35 +0000 (+0800) Subject: Modules/FDD - Trying to fix fdd behavior X-Git-Tag: rel0.11~32 X-Git-Url: https://git.ucc.asn.au/?p=tpg%2Facess2.git;a=commitdiff_plain;h=3d32104f6c0a562fb22bdbdb72d30787d1854980 Modules/FDD - Trying to fix fdd behavior --- diff --git a/Modules/Storage/FDD/fdd.c b/Modules/Storage/FDD/fdd.c index 5c2848ff..e507e94e 100644 --- a/Modules/Storage/FDD/fdd.c +++ b/Modules/Storage/FDD/fdd.c @@ -712,6 +712,7 @@ int FDD_int_SendByte(int base, Uint8 byte) if( inb(base + PORT_MAINSTATUS) & 0x40 ) { Log_Warning("FDD", "FDD_int_SendByte: DIO set, is this ok?"); + return -2; } if( now() < end ) @@ -740,6 +741,7 @@ int FDD_int_GetByte(int base, Uint8 *value) if( !(inb(base + PORT_MAINSTATUS) & 0x40) ) { Log_Warning("FDD", "FDD_int_GetByte: DIO unset, is this ok?"); + return -2; } if( now() < end ) @@ -842,11 +844,13 @@ int FDD_Reset(int id) // 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");