qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] FDC: Fix data transfer len


From: Hervé Poussineau
Subject: [Qemu-devel] [PATCH] FDC: Fix data transfer len
Date: Tue, 29 Apr 2008 19:15:20 +0200
User-agent: Thunderbird 2.0.0.12 (Windows/20080213)

Hi,

In floppy controller, transfer data len is not correctly calculated.
We should read up to the last sector specified by the caller, and not up to the last sector of the floppy.

Attached patch fixes this issue.

Hervé
Index: hw/fdc.c
===================================================================
--- hw/fdc.c    (revision 4290)
+++ hw/fdc.c    (working copy)
@@ -1137,9 +1137,9 @@
     } else {
         int tmp;
         fdctrl->data_len = 128 << (fdctrl->fifo[5] > 7 ? 7 : fdctrl->fifo[5]);
-        tmp = (cur_drv->last_sect - ks + 1);
+        tmp = (fdctrl->fifo[6] - ks + 1);
         if (fdctrl->fifo[0] & 0x80)
-            tmp += cur_drv->last_sect;
+            tmp += fdctrl->fifo[6];
         fdctrl->data_len *= tmp;
     }
     fdctrl->eot = fdctrl->fifo[6];

reply via email to

[Prev in Thread] Current Thread [Next in Thread]