IDE drives now return BUSY status in reset mode, and AT MFM and ESDI controllers now return the READY bit in the status register set also for the first sector of the WRITE command, fixes #1281.

This commit is contained in:
OBattler
2021-04-03 23:26:30 +02:00
parent 637e70841e
commit c0a70b400b
3 changed files with 17 additions and 3 deletions

View File

@@ -328,7 +328,7 @@ esdi_write(uint16_t port, uint8_t val, void *priv)
esdi->command &= ~0x03;
if (val & 0x02)
fatal("Write with ECC\n");
esdi->status = STAT_DRQ | STAT_DSC;
esdi->status = STAT_READY | STAT_DRQ | STAT_DSC;
esdi->pos = 0;
break;

View File

@@ -1338,6 +1338,20 @@ ide_write_devctl(uint16_t addr, uint8_t val, void *priv)
ide->sc->callback = 0.0;
ide_set_callback(ide, 0.0);
ide_set_callback(ide_other, 0.0);
/* We must set set the status to busy in reset mode or
some 286 and 386 machines error out. */
if (ide->type != IDE_NONE) {
ide->atastat = BSY_STAT;
if (ide->type == IDE_ATAPI)
ide->sc->status = BSY_STAT;
}
if (ide_other->type != IDE_NONE) {
ide_other->atastat = BSY_STAT;
if (ide_other->type == IDE_ATAPI)
ide_other->sc->status = BSY_STAT;
}
} else if (!(val & 4) && (ide->fdisk & 4)) {
/* Reset toggled from 1 to 0. */
if (!(ch & 1)) {

View File

@@ -125,7 +125,7 @@ static void mfm_write(uint16_t port, uint8_t val, void *priv);
#ifdef ENABLE_ST506_AT_LOG
int mfm_at_do_log = ENABLE_ST506_AT_LOG;
int st506_at_do_log = ENABLE_ST506_AT_LOG;
static void
@@ -305,7 +305,7 @@ mfm_cmd(mfm_t *mfm, uint8_t val)
mfm->command &= 0xfc;
if (val & 2)
fatal("WD1003: WRITE with ECC\n");
mfm->status = STAT_DRQ|STAT_DSC;
mfm->status = STAT_READY|STAT_DRQ|STAT_DSC;
mfm->pos = 0;
break;