[Top][All Lists]

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

[Qemu-devel] Re: Qemu floppy emulation problems - partially solved

From: Mike Nordell
Subject: [Qemu-devel] Re: Qemu floppy emulation problems - partially solved
Date: Wed, 18 Aug 2004 17:35:19 +0200

Johannes Martin wrote:

> a little while ago we had some discussion about floppy emulation not
> working in qemu once an OS has been installed. Our assumption was that
> floppy access worked through int13 bios emulation but not really down at
> the hardware level.

Both have problems (errors). Fabrice was (AFAIK) notified by me over one
month ago.

1. diskette_param_table in rombios.c from Bochs is too short. It neeed two
more bytes, else e.g. NT believes the floppy only got 31 cylinders (the code
following the table begins with "push ds", 0x1e, and that just happens to be
"maximum track" NT expects). Append:
db 79
db 0

This is obvious if looking at the registry value
ppyDiskPeripheral\0\Configuration Data.

(x, y was 5 and 0 respectively on a real machine, but you might experience
local fluctuations)

Compare the last two bytes from a real system (working) with a non-working
QEMU-installed system.

2. fdc.c has got some problems:
2.1 fdctrl_stop_transfer:
- fdctrl->fifo[0] = status0 | (cur_drv->head << 1) | fdctrl->cur_drv;
+ fdctrl->fifo[0] = status0 | (cur_drv->head << 2) | fdctrl->cur_drv;

2.2 fdctrl_write_data for case 0x08 /* SENSE_INTERRUPT_STATUS*/:
- fdctrl->fifo[0] =
    fdctrl->int_status | (cur_drv->head << 2) | fdctrl->cur_drv;
+ fdctrl->fifo[0] = 0x20 /* seek complete */ | (cur_drv->head << 2) |

To be 100% clear about 2.2, it is AFAIK _not_ to return the main status
register like it was/is.

2.3 Just for good measure, let's tell the OS we got a two-sided drive. For
case SENSE_DRIVE_STATUS transfer, just before "fdctrl_set_fifo(fdctrl, 1,
0);" I put:
+ fdctrl->fifo[0] |= 0x08; // two-sided drive

2.4 And finally while treating READ_ID:
+ cur_drv->head = (fdctrl->fifo[1] >> 2) & 1;

As I haven't got the tools to rebuild the rombios, I can't verify that fix.
The other hardware-emulation fixes are AFAIK 100% correct.


reply via email to

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