diff -aur gxemul-0.4.6.orig/src/devices/bus_pci.c gxemul-0.4.6/src/devices/bus_pci.c --- gxemul-0.4.6.orig/src/devices/bus_pci.c Fri Dec 7 18:45:18 2007 +++ gxemul-0.4.6/src/devices/bus_pci.c Fri Dec 7 18:48:40 2007 @@ -839,7 +839,7 @@ /* Possibly not correct: */ PCI_SET_DATA(PCI_CLASS_REG, PCI_CLASS_CODE(PCI_CLASS_MASS_STORAGE, - PCI_SUBCLASS_MASS_STORAGE_IDE, 0x00) + 0x01); + PCI_SUBCLASS_MASS_STORAGE_IDE, 0x80) + 0x01); /* PIIX_IDETIM (see NetBSD's pciide_piix_reg.h) */ /* channel 0 and 1 enabled as IDE */ diff -aur gxemul-0.4.6.orig/src/devices/dev_wdc.c gxemul-0.4.6/src/devices/dev_wdc.c --- gxemul-0.4.6.orig/src/devices/dev_wdc.c Fri Dec 7 18:45:18 2007 +++ gxemul-0.4.6/src/devices/dev_wdc.c Fri Dec 7 18:47:45 2007 @@ -238,16 +238,17 @@ d->identify_struct[2 * 53 + 1] = 0x02; /* 57-58: current capacity in sectors */ - d->identify_struct[2 * 57 + 0] = ((total_size / 512) >> 24) % 255; - d->identify_struct[2 * 57 + 1] = ((total_size / 512) >> 16) % 255; - d->identify_struct[2 * 58 + 0] = ((total_size / 512) >> 8) % 255; - d->identify_struct[2 * 58 + 1] = (total_size / 512) & 255; + d->identify_struct[2 * 58 + 0] = ((total_size / 512) >> 24) % 255; + d->identify_struct[2 * 58 + 1] = ((total_size / 512) >> 16) % 255; + d->identify_struct[2 * 57 + 0] = ((total_size / 512) >> 8) % 255; + d->identify_struct[2 * 57 + 1] = (total_size / 512) & 255; + /* 60-61: total nr of addressable sectors */ - d->identify_struct[2 * 60 + 0] = ((total_size / 512) >> 24) % 255; - d->identify_struct[2 * 60 + 1] = ((total_size / 512) >> 16) % 255; - d->identify_struct[2 * 61 + 0] = ((total_size / 512) >> 8) % 255; - d->identify_struct[2 * 61 + 1] = (total_size / 512) & 255; + d->identify_struct[2 * 61 + 0] = ((total_size / 512) >> 24) % 255; + d->identify_struct[2 * 61 + 1] = ((total_size / 512) >> 16) % 255; + d->identify_struct[2 * 60 + 0] = ((total_size / 512) >> 8) % 255; + d->identify_struct[2 * 60 + 1] = (total_size / 512) & 255; /* 64: Advanced PIO mode support. 0x02 = mode4, 0x01 = mode3 */ d->identify_struct[2 * 64 + 0] = 0x00; @@ -779,8 +780,6 @@ if (writeflag == MEM_READ) { odata = d->error; debug("[ wdc: read from ERROR: 0x%02x ]\n", (int)odata); - /* TODO: is the error value cleared on read? */ - d->error = 0; } else { d->precomp = idata; debug("[ wdc: write to PRECOMP: 0x%02x ]\n",(int)idata); @@ -919,6 +918,7 @@ d->addr_mult = devinit->addr_mult; d->data_debug = 1; d->io_enabled = 1; + d->error = 1; d->inbuf = zeroed_alloc(WDC_INBUF_SIZE);