qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Mike Nordell" <tamlin@algonet.se>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: Qemu floppy emulation problems - partially solved
Date: Wed, 18 Aug 2004 17:35:19 +0200	[thread overview]
Message-ID: <001301c48538$f9e406b0$0401a8c0@putte2k> (raw)

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
HKLM\HARDWARE\DESCRIPTION\System\MultifunctionAdapter\x\DiskController\y\Flo
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) |
fdctrl->cur_drv;

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.


/Mike

             reply	other threads:[~2004-08-18 15:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-18 15:35 Mike Nordell [this message]
2004-08-31 16:55 ` [Qemu-devel] Re: Qemu floppy emulation problems - partially solved Derek Fawcus
2004-10-03 21:49   ` Fabrice Bellard
2004-10-04 22:00     ` Derek Fawcus
  -- strict thread matches above, loose matches on Subject: below --
2004-10-07 13:37 Mike Nordell
2004-10-07 17:13 ` Derek Fawcus
2004-10-08  9:39 Mike Nordell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='001301c48538$f9e406b0$0401a8c0@putte2k' \
    --to=tamlin@algonet.se \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).