X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;ds=sidebyside;f=Modules%2FStorage%2FFDD%2Ffdd.c;h=2de321da65694a4cbe43a40fb93112d90af4f72f;hb=327c86d2221d49994ad49ec0d1717444e04521b8;hp=801f2eb7d0b12da1c00f3457e5432cf5595d94f3;hpb=98d45a155c3ce437d0eddb67b9eb2b203f87ec3b;p=tpg%2Facess2.git diff --git a/Modules/Storage/FDD/fdd.c b/Modules/Storage/FDD/fdd.c index 801f2eb7..2de321da 100644 --- a/Modules/Storage/FDD/fdd.c +++ b/Modules/Storage/FDD/fdd.c @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include @@ -176,7 +176,7 @@ int FDD_Install(char **Arguments) // Ensure the FDD version is 0x90 { - Uint8 tmp; + Uint8 tmp = 0; FDD_int_SendByte(cPORTBASE[0], CMD_VERSION); FDD_int_GetByte(cPORTBASE[0], &tmp); if( tmp != 0x90 ) { @@ -584,7 +584,7 @@ int FDD_WriteSector(Uint32 Disk, Uint64 LBA, void *Buffer) */ int FDD_int_SeekTrack(int disk, int head, int track) { - Uint8 sr0, cyl; + Uint8 sr0=0, cyl=0; int base; base = cPORTBASE[disk>>1]; @@ -707,8 +707,12 @@ int FDD_int_SendByte(int base, Uint8 byte) { tTime end = now() + 1000; // 1s - while( (inb(base + PORT_MAINSTATUS) & 0xC0) != 0x80 && now() < end ) + while( (inb(base + PORT_MAINSTATUS) & 0x80) != 0x80 && now() < end ) Threads_Yield(); //Delay + + if( inb(base + PORT_MAINSTATUS) & 0x40 ) { + Log_Warning("FDD", "FDD_int_SendByte: DIO set, is this ok?"); + } if( now() < end ) { @@ -731,9 +735,13 @@ int FDD_int_GetByte(int base, Uint8 *value) { tTime end = now() + 1000; // 1s - while( (inb(base + PORT_MAINSTATUS) & 0xd0) != 0xd0 && now() < end ) + while( (inb(base + PORT_MAINSTATUS) & 0x80) != 0x80 && now() < end ) Threads_Yield(); + if( !(inb(base + PORT_MAINSTATUS) & 0x40) ) { + Log_Warning("FDD", "FDD_int_GetByte: DIO unset, is this ok?"); + } + if( now() < end ) { Uint8 tmp = inb(base + PORT_DATA);