Fix disk_1301 handler.
regs->ah was getting clobbered in call to disk_ret().
diff --git a/src/disk.c b/src/disk.c
index 74c49bf..152315e 100644
--- a/src/disk.c
+++ b/src/disk.c
@@ -142,7 +142,8 @@
, MAKE_32_PTR(segment, offset), before*512);
irq_disable();
if (status != 0) {
- BX_INFO("int13_harddisk: function %02x, error %02x !\n",regs->ah,status);
+ BX_INFO("int13_harddisk: function %02x, error %02x !\n"
+ , regs->ah, status);
regs->al = 0;
disk_ret(regs, DISK_RET_EBADTRACK);
}
@@ -222,8 +223,10 @@
static void
disk_1301(struct bregs *regs, u8 device)
{
- regs->ah = GET_BDA(disk_last_status);
- disk_ret(regs, DISK_RET_SUCCESS);
+ u8 v = GET_BDA(disk_last_status);
+ regs->ah = v;
+ set_cf(regs, v);
+ // XXX - clear disk_last_status?
}
// read disk sectors