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
@@ -4,6 +4,7 @@ version 0.5.5: | @@ -4,6 +4,7 @@ version 0.5.5: | ||
4 | - VGA support on PowerPC PREP | 4 | - VGA support on PowerPC PREP |
5 | - VBE fixes (Matthew Mastracci) | 5 | - VBE fixes (Matthew Mastracci) |
6 | - PIT fixes (aka Win98 hardware probe and timer bug) | 6 | - PIT fixes (aka Win98 hardware probe and timer bug) |
7 | + - IDE master only fixes (aka Win98 CD-ROM probe bug) | ||
7 | 8 | ||
8 | version 0.5.4: | 9 | version 0.5.4: |
9 | 10 |
hw/ide.c
@@ -409,11 +409,6 @@ static void ide_atapi_identify(IDEState *s) | @@ -409,11 +409,6 @@ static void ide_atapi_identify(IDEState *s) | ||
409 | p = (uint16_t *)s->io_buffer; | 409 | p = (uint16_t *)s->io_buffer; |
410 | /* Removable CDROM, 50us response, 12 byte packets */ | 410 | /* Removable CDROM, 50us response, 12 byte packets */ |
411 | put_le16(p + 0, (2 << 14) | (5 << 8) | (1 << 7) | (2 << 5) | (0 << 0)); | 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 | padstr((uint8_t *)(p + 10), "QM00001", 20); /* serial number */ | 412 | padstr((uint8_t *)(p + 10), "QM00001", 20); /* serial number */ |
418 | put_le16(p + 20, 3); /* buffer type */ | 413 | put_le16(p + 20, 3); /* buffer type */ |
419 | put_le16(p + 21, 512); /* cache size in sectors */ | 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,6 +1083,9 @@ static void ide_ioport_write(void *opaque, uint32_t addr, uint32_t val) | ||
1088 | printf("ide: CMD=%02x\n", val); | 1083 | printf("ide: CMD=%02x\n", val); |
1089 | #endif | 1084 | #endif |
1090 | s = ide_if->cur_drive; | 1085 | s = ide_if->cur_drive; |
1086 | + /* ignore commands to non existant slave */ | ||
1087 | + if (s != ide_if && !s->bs) | ||
1088 | + break; | ||
1091 | switch(val) { | 1089 | switch(val) { |
1092 | case WIN_IDENTIFY: | 1090 | case WIN_IDENTIFY: |
1093 | if (s->bs && !s->is_cdrom) { | 1091 | if (s->bs && !s->is_cdrom) { |
@@ -1254,7 +1252,8 @@ static uint32_t ide_ioport_read(void *opaque, uint32_t addr1) | @@ -1254,7 +1252,8 @@ static uint32_t ide_ioport_read(void *opaque, uint32_t addr1) | ||
1254 | break; | 1252 | break; |
1255 | default: | 1253 | default: |
1256 | case 7: | 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 | ret = 0; | 1257 | ret = 0; |
1259 | else | 1258 | else |
1260 | ret = s->status; | 1259 | ret = s->status; |
@@ -1273,7 +1272,8 @@ static uint32_t ide_status_read(void *opaque, uint32_t addr) | @@ -1273,7 +1272,8 @@ static uint32_t ide_status_read(void *opaque, uint32_t addr) | ||
1273 | IDEState *s = ide_if->cur_drive; | 1272 | IDEState *s = ide_if->cur_drive; |
1274 | int ret; | 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 | ret = 0; | 1277 | ret = 0; |
1278 | else | 1278 | else |
1279 | ret = s->status; | 1279 | ret = s->status; |