Ahh. We do the actual "the 68K slows down to 700-odd kHz on VIA reads and writes", because the ROM .Sony driver relies on it heavily given Apple was doing cycle-counting floppy control for about 10 years longer than they should have.
Oh wow, that's incredible. I knew that the floppy drive was timing sensitive, but not quite to that extent (SWIM just current debugs accesses in QEMU for now). The main use case is for the A/UX boot floppy, but that seems to work fine added as a SCSI HD to get to the installer. Maybe one for the TODO list if I ever feel like a challenge...
DAFB can be set to either halt the CPU or trigger a bus error if a PDMA access happens and DRQ isn't asserted (so there isn't room in the FIFO), and there's also an option of how many cycles of wait state on accesses to the 53C96. The ROMs and MacOS set it to halt the 68k and the wait states according to the CPU clock.
It actually will work most of the time without either mechanism. But I found that if MacOS writes a sector from a non-word-aligned memory location the way it lines up the FIFO writes causes data loss without halting the '040. Once I had that working I could boot from Legacy Recovery with an unformatted HDD, format, and install any supported OS up to 8.1 with no errors.
I see, thanks for the info. Certainly QEMU currently has no knowledge of this, but it seems to work so far. Ah yes the unaligned read/writes mixing FIFO and DMA commands... I remember that well as it required quite a large rewrite of the existing ESP device (and indeed, I still have another in the pipeline)
. Presumably the issue you had here was because of the DRQ line timing halting the CPU when it's trying to setup the transfer?
A/UX starts to come up and then the video goes corrupt and the CPU jumps to infinity. I haven't tried to debug it yet, I wanted to get all of the non-AV Quadras booting first. After that happened I didn't want to debug Mac chipset devices for a minute (the ATA interface in the Q630/LC580 was annoying to figure out). For NetBSD the Penguin boot loader doesn't like me and I can't find the source to understand what it's mad about. I assume that would also be an issue for Linux. MAME does run a bunch of Unix versions for other m68k machines (SunOS, IRIX, HP-UX, Sony NeWS OS, Apollo Domain/OS, and NEXTSTEP) so I'm pretty confident it's not going to be a huge problem.
Yeah video corruption normally means a panic: A/UX switches to 1-bit mode, but it can generally manage to output some messages to give an idea as to what happened. From memory A/UX support was reasonably trivial and only required a few changes:
- Shadowing the Toolbox from 0x48000000 into 0x40000000 (for some reason A/UX accesses via the lower address range?). At least in the Q800 developers guide it is listed as part of the Toolbox ROM area, and it works...
- Implementing the extra EASC registers. I'd initially implemented just the ASC registers but A/UX panics with a fault if the extended register sets aren't present
- Implementing the"auxmode" interrupt routing switch (also used by Linux, NetBSD). This took me a little while to work out because MacOS works fine in both routing configurations - I guess they played safe given that it is a so-called "Universal" ROM
Interestingly enough I've also had a report that MachTen works on MacOS 7.5 under QEMU so there is still plenty more fun to be had...
(BTW: apologies all if we've hijacked this thread: let me know if this isn't interesting and we can move the discussion elsewhere)