+ // EDD 3.x
+ channel = device / 2;
+ u8 iface = GET_EBDA(ata.channels[channel].iface);
+ iobase1 = GET_EBDA(ata.channels[channel].iobase1);
+
+ SET_INT13DPT(regs, size, 0x42);
+ SET_INT13DPT(regs, key, 0xbedd);
+ SET_INT13DPT(regs, dpi_length, 0x24);
+ SET_INT13DPT(regs, reserved1, 0);
+ SET_INT13DPT(regs, reserved2, 0);
+
+ if (iface==ATA_IFACE_ISA) {
+ SET_INT13DPT(regs, host_bus[0], 'I');
+ SET_INT13DPT(regs, host_bus[1], 'S');
+ SET_INT13DPT(regs, host_bus[2], 'A');
+ SET_INT13DPT(regs, host_bus[3], 0);
+ } else {
+ // FIXME PCI
+ }
+ SET_INT13DPT(regs, iface_type[0], 'A');
+ SET_INT13DPT(regs, iface_type[1], 'T');
+ SET_INT13DPT(regs, iface_type[2], 'A');
+ SET_INT13DPT(regs, iface_type[3], 0);
+
+ if (iface==ATA_IFACE_ISA) {
+ SET_INT13DPT(regs, iface_path[0], iobase1);
+ SET_INT13DPT(regs, iface_path[2], 0);
+ SET_INT13DPT(regs, iface_path[4], 0L);
+ } else {
+ // FIXME PCI
+ }
+ SET_INT13DPT(regs, device_path[0], device%2);
+ SET_INT13DPT(regs, device_path[1], 0);
+ SET_INT13DPT(regs, device_path[2], 0);
+ SET_INT13DPT(regs, device_path[4], 0L);
+
+ sum = checksum_seg(regs->ds, 30, 34);
+ SET_INT13DPT(regs, checksum, ~sum);
+}
+
+// IBM/MS extended media change
+static void
+disk_1349(struct bregs *regs, u8 device)
+{
+ // Always success for HD
+ disk_ret(regs, DISK_RET_SUCCESS);
+}
+
+static void
+disk_134e01(struct bregs *regs, u8 device)
+{
+ disk_ret(regs, DISK_RET_SUCCESS);
+}
+
+static void
+disk_134e03(struct bregs *regs, u8 device)
+{
+ disk_ret(regs, DISK_RET_SUCCESS);
+}
+
+static void
+disk_134e04(struct bregs *regs, u8 device)
+{
+ disk_ret(regs, DISK_RET_SUCCESS);
+}
+
+static void
+disk_134e06(struct bregs *regs, u8 device)
+{
+ disk_ret(regs, DISK_RET_SUCCESS);
+}
+
+static void
+disk_134eXX(struct bregs *regs, u8 device)
+{
+ debug_stub(regs);
+ disk_ret(regs, DISK_RET_EPARAM);
+}
+
+// IBM/MS set hardware configuration
+static void
+disk_134e(struct bregs *regs, u8 device)
+{
+ switch (regs->al) {
+ case 0x01: disk_134e01(regs, device); break;
+ case 0x03: disk_134e03(regs, device); break;
+ case 0x04: disk_134e04(regs, device); break;
+ case 0x06: disk_134e06(regs, device); break;
+ default: disk_134eXX(regs, device); break;
+ }
+}
+
+static void
+disk_13XX(struct bregs *regs, u8 device)
+{
+ debug_stub(regs);
+ disk_ret(regs, DISK_RET_EPARAM);
+}
+
+static void
+disk_13(struct bregs *regs, u8 device)
+{
+ //debug_stub(regs);
+
+ // clear completion flag
+ SET_BDA(disk_interrupt_flag, 0);
+