aboutsummaryrefslogtreecommitdiff
path: root/hw/ide.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-05-04 01:29:51 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-05-04 01:29:51 +0000
commit66201e2ddff787d7ddff123baa56661a95be7c4b (patch)
tree9b0460c5a271b6a2333b47429bc6b35ef92ec107 /hw/ide.c
parentec844b96c083340a4c04849c2c1cdc09e85e0595 (diff)
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
Diffstat (limited to 'hw/ide.c')
-rw-r--r--hw/ide.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/hw/ide.c b/hw/ide.c
index 9bd32e097f..6c92bedbbd 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;