diff --git a/src/disk/hdc_esdi_at.c b/src/disk/hdc_esdi_at.c index 7da67c61b..25ff5255e 100644 --- a/src/disk/hdc_esdi_at.c +++ b/src/disk/hdc_esdi_at.c @@ -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; diff --git a/src/disk/hdc_ide.c b/src/disk/hdc_ide.c index d2649e046..c756c0c15 100644 --- a/src/disk/hdc_ide.c +++ b/src/disk/hdc_ide.c @@ -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)) { diff --git a/src/disk/hdc_st506_at.c b/src/disk/hdc_st506_at.c index 411ceee21..192a8b6a3 100644 --- a/src/disk/hdc_st506_at.c +++ b/src/disk/hdc_st506_at.c @@ -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;