qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
To: Matt Jacobson <mhjacobson@me.com>, qemu-devel@nongnu.org
Cc: Laurent Vivier <laurent@vivier.eu>
Subject: Re: [PATCH 0/1] hw/m68k: add working floppy controller for q800
Date: Fri, 5 Dec 2025 21:20:30 +0000	[thread overview]
Message-ID: <ab79a32b-24b3-418e-a2c5-6427cf174d35@ilande.co.uk> (raw)
In-Reply-To: <20251203064336.79847-1-mhjacobson@me.com>

On 03/12/2025 06:43, Matt Jacobson wrote:

> [Please notify me of any process errors -- this is my first contribution to
> QEMU.  Thanks.]
> 
> Implement the SWIM2 floppy controller for the q800 machine.
> (For details, see: <https://archive.org/details/SWIMDesignDocs/SWIM2%20ERS/>.)
> 
> Reading and writing work, and booting from a system disk works.
> Tested with the Quadra 800 ROM and System 7.
> 
> Future areas of work here could include:
> 
> * Allowing for disk formatting/duplication to work
> * Fleshing out the SWIM1 and hooking it up to the emulated drive
> * Implementing the IWM for earlier machines (this could share code with SWIM1)
> 
> Matt Jacobson (1):
>    hw/m68k: add working floppy controller for q800
> 
>   hw/block/meson.build               |   2 +-
>   hw/block/sony_superdrive.c         | 940 +++++++++++++++++++++++++++++
>   hw/block/swim2.c                   | 657 ++++++++++++++++++++
>   hw/block/trace-events              |  17 +
>   hw/m68k/q800.c                     |   4 +-
>   include/hw/block/sony_superdrive.h |  55 ++
>   include/hw/block/swim2.h           |  66 ++
>   include/hw/m68k/q800.h             |   4 +-
>   8 files changed, 1740 insertions(+), 5 deletions(-)
>   create mode 100644 hw/block/sony_superdrive.c
>   create mode 100644 hw/block/swim2.c
>   create mode 100644 include/hw/block/sony_superdrive.h
>   create mode 100644 include/hw/block/swim2.h

Thanks for the contribution! I've applied this patch and managed to get it to compile 
successfully, but I'm struggling to find a suitable disk image that works. Can you 
point me towards both a GCR and an MFM image I can use for testing? I think this 
might be because the images I use here are simply HFS(+) images.

Some initial thoughts from looking over the code:

- The basic implementation looks fairly good from what I can see, but I can see a 
number of places that don't match our code style guidelines. You can do a basic style 
check running "./scripts/checkpatch.pl HEAD~1..HEAD" from a git checkout with your 
patch applied which will pick up the majority of issues.

- Having everything in one patch makes it harder to review: I think it would make 
sense to introduce the SONY drive in one patch, the updated SWIM2 controller in 
another, and then a final patch to update the q800 machine to switch over the SWIM2. 
And maybe even an extra patch to remove the existing SWIM1 stub? The stub was added 
with just enough implemented to allow Linux to boot.

- Have you tested with an A/UX 3.0.1 boot floppy? A number of people are interested 
to run AUX 3.0.1 as per 
https://www.emaculation.com/doku.php/m68k-qemu-on-windows#running_qemu-system-m68k_with_a_ux_3x_guests_in_windows 
and it would be good to be able to use the real floppy image here.

- QEMU already has a fairly good Fifo8 implementation: is it possible to use that or 
Fifo32 instead of reinventing it here?

- It's worth updating the cover letter to include an example command line. I had to 
go digging into the patch to discover that I needed to add something like "-drive 
file=/tmp/Install.img,if=none,id=floppy" to attempt a floppy boot. Configuring 
internal devices can be fiddly: I'm wondering if there is existing precedent in the 
way PC floppy drives work that we can use to keep things consistent?

- When booting a test Linux image I got stuck in a boot loop, both with and without a 
floppy inserted in the drive:

swim2_mmio_read addr=0x1e00 size=1 reg=7 [HANDSHAKE] value=0x8 mode=0xca setup=0x28 
phase=0x74 fifo=0
swim2_mmio_read addr=0x1e00 size=1 reg=7 [HANDSHAKE] value=0x8 mode=0xca setup=0x28 
phase=0x74 fifo=0
...
...

Since the Linux maintainers make use of QEMU for testing, I think we need to get this 
working. Laurent - do you know if the 68K Mac kernel driver works on real hardware?

I appreciate the time and effort that has gone into creating this patch, and I'm 
really looking forward to getting it to a point where it can be merged :)


ATB,

Mark.



  parent reply	other threads:[~2025-12-05 21:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-03  6:43 [PATCH 0/1] hw/m68k: add working floppy controller for q800 Matt Jacobson
2025-12-03  6:43 ` [PATCH 1/1] " Matt Jacobson
2025-12-05 21:20 ` Mark Cave-Ayland [this message]
2025-12-08 12:44   ` [PATCH 0/1] " Laurent Vivier

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=ab79a32b-24b3-418e-a2c5-6427cf174d35@ilande.co.uk \
    --to=mark.cave-ayland@ilande.co.uk \
    --cc=laurent@vivier.eu \
    --cc=mhjacobson@me.com \
    --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).