Skip to contentSkip to conversation

Qemu floppy emulation problems - partially solved

Qemu-devel Johannes Martin 2 participants 3 messages Aug 17, 2004 – Aug 18, 2004

lore
Share & tools
lore
#0 lore raw

Hi,

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.

Today I noticed in Win98 that Windows would only offer to format a floppy at 180kB. I then booted Win98 with a floppy inserted at boot time and noticed two things:
- rather than two 'removable disk drives' Win98 now only reports one 3 1/2" floppy drive (correctly)
- I can actually access that floppy and other floppies I insert later (no disk change problem as with CDs)

Observations on other OSes:
- Win95 reports a VFAT error and pretty much dies
- OS/2 can access the floppy that was inserted originally, as soon as I try to access any other floppy, qemu dies with a segmentation fault.

Tested on Debian/GNU Linux with a two week old qemu/CVS.

So I guess our initial assumption was at least partially incorrect, the problem is not (primarily) the fdc hardware emulation in general but the part OSes need to detect the kind of floppy drive installed. Apparently, if no virtual floppy is inserted, the detection fails. I haven't actually looked at the code yet - I imagine it to be quite easy to fix though.

Any hints how to find out why/where qemu segfaults under OS/2? How can I get a core dump out of qemu? So far, my attempts to debug qemu using gdb have failed miserably. :(

Thanks
Johannes

#1 lore raw

Hi,

Quoted 7 lines · Johannes Martin

Today I noticed in Win98 that Windows would only offer to format a floppy at 180kB. I then booted Win98 with a floppy inserted at boot time and noticed two things:
- rather than two 'removable disk drives' Win98 now only reports one 3 1/2" floppy drive (correctly)
- I can actually access that floppy and other floppies I insert later (no disk change problem as with CDs)

update:
when I 'eject fda' in the Win98 guest, and try to access the floppy, I receive hundreds/thousands of
dma: DMA transfer is not read
and the guest pretty much stalls. 'change fda /dev/zero' gets things straight again.

Actually, when I start qemu with -fda /dev/zero, the floppy drive is detected ok. So that would be a very quick fix to the problem.

The only remaining problem is that I get a segfault when I try to format the virtual floppy when it points to /dev/zero (I would expect a 'disk is write protected' error).

Johannes

#2 lore raw
Quoted 11 lines · Johannes Martin

Hi,

Quoted 7 lines · Johannes Martin

Today I noticed in Win98 that Windows would only offer to format a floppy at 180kB. I then booted Win98 with a floppy inserted at boot time and noticed two things:
- rather than two 'removable disk drives' Win98 now only reports one 3 1/2" floppy drive (correctly)
- I can actually access that floppy and other floppies I insert later (no disk change problem as with CDs)

Quoted 6 lines

update:
when I 'eject fda' in the Win98 guest, and try to access the floppy, I receive hundreds/thousands of
dma: DMA transfer is not read
and the guest pretty much stalls. 'change fda /dev/zero' gets things straight again.

I have changed DMA API with 7th audio patch and by extension had to modify fdc.c to use it (Jocelyn didn't return calls when i tried to notify him).

So:
a. I'd suggest using vanilla QEMU when working on fdc for the time being
b. getting 7b_aqemu (or later) that tries to keep DMA silent

Signature · 1 line
mailto:[email protected]