From 66201e2ddff787d7ddff123baa56661a95be7c4b Mon Sep 17 00:00:00 2001 From: bellard Date: Tue, 4 May 2004 01:29:51 +0000 Subject: [PATCH] ide slave fixes (aka Win98 CD-ROM detection fix) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@782 c046a42c-6fe2-441c-8c8c-71466251a162 --- Changelog | 1 + hw/ide.c | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Changelog b/Changelog index ca6d0e6..86d9d92 100644 --- a/Changelog +++ b/Changelog @@ -4,6 +4,7 @@ version 0.5.5: - VGA support on PowerPC PREP - VBE fixes (Matthew Mastracci) - PIT fixes (aka Win98 hardware probe and timer bug) + - IDE master only fixes (aka Win98 CD-ROM probe bug) version 0.5.4: diff --git a/hw/ide.c b/hw/ide.c index 9bd32e0..6c92bed 100644 --- a/hw/ide.c +++ b/hw/ide.c @@ -409,11 +409,6 @@ static void ide_atapi_identify(IDEState *s) p = (uint16_t *)s->io_buffer; /* Removable CDROM, 50us response, 12 byte packets */ put_le16(p + 0, (2 << 14) | (5 << 8) | (1 << 7) | (2 << 5) | (0 << 0)); - put_le16(p + 1, s->cylinders); - put_le16(p + 3, s->heads); - put_le16(p + 4, 512 * s->sectors); /* sectors */ - put_le16(p + 5, 512); /* sector size */ - put_le16(p + 6, s->sectors); padstr((uint8_t *)(p + 10), "QM00001", 20); /* serial number */ put_le16(p + 20, 3); /* buffer type */ put_le16(p + 21, 512); /* cache size in sectors */ @@ -1088,6 +1083,9 @@ static void ide_ioport_write(void *opaque, uint32_t addr, uint32_t val) printf("ide: CMD=%02x\n", val); #endif s = ide_if->cur_drive; + /* ignore commands to non existant slave */ + if (s != ide_if && !s->bs) + break; switch(val) { case WIN_IDENTIFY: if (s->bs && !s->is_cdrom) { @@ -1254,7 +1252,8 @@ static uint32_t ide_ioport_read(void *opaque, uint32_t addr1) break; default: case 7: - if (!ide_if[0].bs && !ide_if[1].bs) + if ((!ide_if[0].bs && !ide_if[1].bs) || + (s != ide_if && !s->bs)) ret = 0; else ret = s->status; @@ -1273,7 +1272,8 @@ static uint32_t ide_status_read(void *opaque, uint32_t addr) IDEState *s = ide_if->cur_drive; int ret; - if (!ide_if[0].bs && !ide_if[1].bs) + if ((!ide_if[0].bs && !ide_if[1].bs) || + (s != ide_if && !s->bs)) ret = 0; else ret = s->status; -- 2.7.4