Commit 66201e2ddff787d7ddff123baa56661a95be7c4b
1 parent
ec844b96
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
Showing
2 changed files
with
8 additions
and
7 deletions
Changelog
hw/ide.c
... | ... | @@ -409,11 +409,6 @@ static void ide_atapi_identify(IDEState *s) |
409 | 409 | p = (uint16_t *)s->io_buffer; |
410 | 410 | /* Removable CDROM, 50us response, 12 byte packets */ |
411 | 411 | put_le16(p + 0, (2 << 14) | (5 << 8) | (1 << 7) | (2 << 5) | (0 << 0)); |
412 | - put_le16(p + 1, s->cylinders); | |
413 | - put_le16(p + 3, s->heads); | |
414 | - put_le16(p + 4, 512 * s->sectors); /* sectors */ | |
415 | - put_le16(p + 5, 512); /* sector size */ | |
416 | - put_le16(p + 6, s->sectors); | |
417 | 412 | padstr((uint8_t *)(p + 10), "QM00001", 20); /* serial number */ |
418 | 413 | put_le16(p + 20, 3); /* buffer type */ |
419 | 414 | 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) |
1088 | 1083 | printf("ide: CMD=%02x\n", val); |
1089 | 1084 | #endif |
1090 | 1085 | s = ide_if->cur_drive; |
1086 | + /* ignore commands to non existant slave */ | |
1087 | + if (s != ide_if && !s->bs) | |
1088 | + break; | |
1091 | 1089 | switch(val) { |
1092 | 1090 | case WIN_IDENTIFY: |
1093 | 1091 | if (s->bs && !s->is_cdrom) { |
... | ... | @@ -1254,7 +1252,8 @@ static uint32_t ide_ioport_read(void *opaque, uint32_t addr1) |
1254 | 1252 | break; |
1255 | 1253 | default: |
1256 | 1254 | case 7: |
1257 | - if (!ide_if[0].bs && !ide_if[1].bs) | |
1255 | + if ((!ide_if[0].bs && !ide_if[1].bs) || | |
1256 | + (s != ide_if && !s->bs)) | |
1258 | 1257 | ret = 0; |
1259 | 1258 | else |
1260 | 1259 | ret = s->status; |
... | ... | @@ -1273,7 +1272,8 @@ static uint32_t ide_status_read(void *opaque, uint32_t addr) |
1273 | 1272 | IDEState *s = ide_if->cur_drive; |
1274 | 1273 | int ret; |
1275 | 1274 | |
1276 | - if (!ide_if[0].bs && !ide_if[1].bs) | |
1275 | + if ((!ide_if[0].bs && !ide_if[1].bs) || | |
1276 | + (s != ide_if && !s->bs)) | |
1277 | 1277 | ret = 0; |
1278 | 1278 | else |
1279 | 1279 | ret = s->status; | ... | ... |