No, patch not help. =================== 07.522: Booting from Floppy... 07.522: enter handle_13: 07.534: a=00000201 b=00000000 c=00000001 d=00000000 ds=0000 es=07c0 ss=df80 07.534: si=00000000 di=00000000 bp=00000000 sp=0000f930 cs=f000 ip=cb99 f=0202 07.534: disk_op d=0x000f5520 lba=0 buf=0x00007c00 count=1 cmd=2 07.534: Floppy_drive_recal 0 07.534: Floppy_enable_controller 07.534: handle_0e 07.534: handle_0e 08.195: handle_0e 08.195: Floppy_media_sense on drive 0 found rate 0 08.386: handle_0e 08.386: Booting from 0000:7c00 08.385: enter handle_13: 08.385: a=00000000 b=00000000 c=00000000 d=00000000 ds=7c00 es=0000 ss=df80 08.385: si=00000000 di=00000000 bp=00000000 sp=0000f930 cs=0000 ip=7cc0 f=0202 08.385: disk_op d=0x000f5520 lba=514 buf=0x0000f879 count=0 cmd=0 08.385: Floppy_disable_controller 08.387: Floppy_enable_controller 08.387: handle_0e 08.387: enter handle_13: 08.387: a=00000800 b=00000000 c=00000000 d=00000000 ds=7c00 es=0000 ss=df80 08.387: si=00000000 di=00000000 bp=00000000 sp=0000f930 cs=0000 ip=7cc8 f=0202 08.387: enter handle_13: 08.393: a=00000204 b=00000000 c=00000001 d=00000000 ds=7c00 es=5000 ss=df80 08.393: si=00000000 di=000056c0 bp=00000000 sp=0000f930 cs=0000 ip=7cde f=0202 08.393: disk_op d=0x000f5520 lba=0 buf=0x00050000 count=4 cmd=2 08.393: Floppy_drive_recal 0 08.393: handle_0e 08.407: handle_0e 08.407: Floppy_media_sense on drive 0 found rate 0 08.553: handle_0e 11.873: i8042_command cmd=ae 11.873: i8042_wait_write 11.873: enter handle_13: 11.873: a=00000201 b=00000000 c=00001c01 d=00000000 ds=5000 es=6000 ss=df80 11.873: si=00000000 di=000056c0 bp=0000001e sp=0000f930 cs=5000 ip=0188 f=0246 11.876: disk_op d=0x000f5520 lba=1008 buf=0x00060000 count=1 cmd=2 11.915: i8042_command cmd=ae 11.915: i8042_wait_write 12.046: handle_0e 12.792: handle_0e 12.792: enter handle_13: 12.792: a=00000201 b=00000000 c=00001c02 d=00000000 ds=5000 es=6020 ss=df80 12.792: si=00000000 di=000056c0 bp=0000001e sp=0000f930 cs=5000 ip=0188 f=0246 12.792: disk_op d=0x000f5520 lba=1009 buf=0x00060200 count=1 cmd=2 12.992: handle_0e 12.992: enter handle_13: 12.992: a=00000201 b=00000000 c=00001c03 d=00000000 ds=5000 es=6040 ss=df80 12.992: si=00000000 di=000056c0 bp=0000001e sp=0000f930 cs=5000 ip=0188 f=0246 12.994: disk_op d=0x000f5520 lba=1010 buf=0x00060400 count=1 cmd=2 13.189: handle_0e 13.189: enter handle_13: 13.189: a=00000201 b=00000000 c=00001c04 d=00000000 ds=5000 es=6060 ss=df80 13.189: si=00000000 di=000056c0 bp=0000001e sp=0000f930 cs=5000 ip=0188 f=0246 13.194: disk_op d=0x000f5520 lba=1011 buf=0x00060600 count=1 cmd=2 13.385: handle_0e 13.385: enter handle_13: 13.385: a=00000201 b=00000000 c=00001c05 d=00000000 ds=5000 es=6080 ss=df80 13.385: si=00000000 di=000056c0 bp=0000001e sp=0000f930 cs=5000 ip=0188 f=0246 13.387: disk_op d=0x000f5520 lba=1012 buf=0x00060800 count=1 cmd=2 13.580: handle_0e 13.580: enter handle_13: 13.580: a=00000201 b=00000000 c=00001c06 d=00000000 ds=5000 es=60a0 ss=df80 13.580: si=00000000 di=000056c0 bp=0000001e sp=0000f930 cs=5000 ip=0188 f=0246 13.582: disk_op d=0x000f5520 lba=1013 buf=0x00060a00 count=1 cmd=2 13.775: handle_0e 13.775: enter handle_13: 13.775: a=00000201 b=00000000 c=00001c07 d=00000000 ds=5000 es=60c0 ss=df80 13.775: si=00000000 di=000056c0 bp=0000001e sp=0000f930 cs=5000 ip=0188 f=0246 13.777: disk_op d=0x000f5520 lba=1014 buf=0x00060c00 count=1 cmd=2 13.977: handle_0e 13.977: floppy error: 40 20 20 1c 00 07 02 14.178: handle_0e 14.178: floppy error: 40 20 20 1c 00 07 02 14.381: handle_0e 14.381: floppy error: 40 20 20 1c 00 07 02 14.381: invalid basic_access:96: 14.381: a=00000200 b=00000000 c=00001c07 d=00000000 ds=5000 es=60c0 ss=df80 14.381: si=00000000 di=000056c0 bp=0000001e sp=0000f930 cs=5000 ip=0188 f=0246
On Fri, Dec 13, 2013 at 06:05:28PM +0100, Gelip wrote:
No, patch not help.
[...]
13.775: enter handle_13: 13.775: a=00000201 b=00000000 c=00001c07 d=00000000 ds=5000 es=60c0 ss=df80 13.775: si=00000000 di=000056c0 bp=0000001e sp=0000f930 cs=5000 ip=0188 f=0246 13.777: disk_op d=0x000f5520 lba=1014 buf=0x00060c00 count=1 cmd=2 13.977: handle_0e 13.977: floppy error: 40 20 20 1c 00 07 02 14.178: handle_0e 14.178: floppy error: 40 20 20 1c 00 07 02 14.381: handle_0e 14.381: floppy error: 40 20 20 1c 00 07 02 14.381: invalid basic_access:96: 14.381: a=00000200 b=00000000 c=00001c07 d=00000000 ds=5000 es=60c0 ss=df80 14.381: si=00000000 di=000056c0 bp=0000001e sp=0000f930 cs=5000 ip=0188 f=0246
Maybe the patch below instead will help?
-Kevin
diff --git a/src/hw/floppy.c b/src/hw/floppy.c index b848203..8d940a9 100644 --- a/src/hw/floppy.c +++ b/src/hw/floppy.c @@ -558,7 +558,7 @@ floppy_read(struct disk_op_s *op) goto fail; return DISK_RET_SUCCESS; fail: - op->count = 0; // no sectors read + //op->count = 0; // no sectors read return res; }
@@ -587,7 +587,7 @@ floppy_write(struct disk_op_s *op) goto fail; return DISK_RET_SUCCESS; fail: - op->count = 0; // no sectors read + //op->count = 0; // no sectors read return res; }
@@ -603,7 +603,7 @@ floppy_verify(struct disk_op_s *op) // This command isn't implemented - just return success. return DISK_RET_SUCCESS; fail: - op->count = 0; // no sectors read + //op->count = 0; // no sectors read return res; }
@@ -633,20 +633,37 @@ process_floppy_op(struct disk_op_s *op) if (!CONFIG_FLOPPY) return 0;
- switch (op->command) { - case CMD_RESET: - return floppy_reset(op); - case CMD_READ: - return floppy_read(op); - case CMD_WRITE: - return floppy_write(op); - case CMD_VERIFY: - return floppy_verify(op); - case CMD_FORMAT: - return floppy_format(op); - default: - op->count = 0; - return DISK_RET_EPARAM; + int origcount = op->count, retry = 0; + for (;;) { + int ret; + switch (op->command) { + case CMD_RESET: + return floppy_reset(op); + case CMD_READ: + ret = floppy_read(op); + break; + case CMD_WRITE: + ret = floppy_write(op); + break; + case CMD_VERIFY: + ret = floppy_verify(op); + break; + case CMD_FORMAT: + ret = floppy_format(op); + break; + default: + op->count = 0; + return DISK_RET_EPARAM; + } + if (ret == DISK_RET_ECONTROLLER && retry++ < 2) { + u8 floppyid = GET_GLOBALFLAT(op->drive_gf->cntl_id); + u8 frs = GET_BDA(floppy_recalibration_status); + SET_BDA(floppy_recalibration_status, frs & ~(1<<floppyid)); + continue; + } + if (ret != DISK_RET_SUCCESS && op->count == origcount) + op->count = 0; + return ret; } }