A/UX on the Carrera040
A/UX 3.1 now boots and runs on my SE/30 with a Carrera040 accelerator and a BMOW ROM SIMM - with System 7.5.3 as the Mac environment, no less.
Getting here took 29 kernel patches, a lot of photos of a frozen screen, and more wrong guesses than I’d like to admit. Here’s what the Carrera does to A/UX (so far as I know, so far), and the patch kit, which is available at the end.
The emulation post covers how the card works and how QEMU emulates it, and the 7.5.3 port covers the Mac side.
As with the rest of this project, a bunch of this was done with bot assistance. If that’s a deal breaker for you, I get it.
Why A/UX doesn’t just work
Mac OS on the Carrera040 is fine because MicroMac’s software handles everything: it hands the bus to the 68040 after Mac OS boots, sets up its own MMU tables, and works around the card’s quirks. A/UX doesn’t use any of that. It has its own kernel, its own 68040 MMU tables, and its own idea of how to talk to the hardware.
The A/UX kernel does support the 68040 (it runs on Quadras), and it supports the SE/30. It has never seen a 68040 in an SE/30. And on the real hardware, the Carrera turns out to have some sharp edges Mac OS never exposed.
Debugging without a debugger
MacsBug is cut off by the Carrera’s vector table move, so all feedback from the real machine came as phone photos of the screen. Every diagnostic had to work within that:
- NMI Peek, an INIT that hooks the programmer’s switch (into the Carrera’s relocated vector table, re-installed twice a second) and draws machine state, stacks and a PC sampler in a big hex font that’s readable in a photo.
- Kernel breadcrumbs: patches to
/unixthat draw black bars across the screen at each milestone of kernel startup, long before any console exists. A bar grows every time its spot is reached, so repeat counts show up too. The code hides inside rarely printed kernel messages, and every version has a--revertthat has to restore a byte-identical kernel. - An exception catcher that points the bus-error and other vectors at a routine that draws the top of the exception stack as bits: a solid block for a 1, a thin line for a 0. Reading a frame dump from a photo of black and white stripes is … an experience.
boot_trace.py, for the later stages, which makes the kernel print each startup routine to the console.

The real SE/30, stopped: the patched kernel’s dump, drawn as bits. A solid block is a 1, a thin line a 0.
Reading those back means cropping the photo down to one row at a time and counting:

Single rows, cropped from photos of the screen.

The same kind of dump in the emulator.
The emulator ran everything first, so a patch was only sent to the real machine once it booted to the A/UX Finder in QEMU. Which is necessary, but as it turned out, very much not sufficient.
Before the Carrera even takes over
Two fixes are needed just because a 68040 is running A/UX on an SE/30, before any of the Carrera’s own quirks come into it.
The slot probe that never finished
The ROM’s slot-probe bus-error handler only understands the 68030’s format-$B exception frames. That never mattered before, because the probe only ever ran on the 030 at power-on. A/UX runs the Slot Manager again from its kernel, and with the Carrera that’s on the 68040. The 040’s format-7 frames were passed on to the kernel’s fault handler, which retried the access forever with interrupts off.
The fix is a kernel patch around the Slot Manager call. It installs a temporary bus-error handler that recognizes a format-7 fault on a slot address and resumes the probe the way the ROM expects. (There’s also a ROM patch for the same thing, but the kernel patch works with a stock ROM.)
Restart
Stock A/UX restarts an SE/30 with a 68030-only PMOVE, which panics on the 040. The SE/30 ROM can’t run on a 68040 anyway, so the restart has to hand the machine back to the motherboard 68030, the way MicroMac’s driver does under Mac OS.
The catch is that the 68030 has been parked since startup, in driver code A/UX has long since overwritten. So before writing to the Carrera’s control register, the patched kernel fills RAM with NOPs and puts a short 68030 restart stub at the end of every 4 KB block. Wherever the 030 resumes, it slides into a stub that switches off its MMU and jumps to the ROM’s reset vector. The code lives where five boot-time “can’t allocate” panic messages used to be.
The emulator’s RESET handling was needed for this path to work in QEMU: a 68030 RESET resets the card too, as on the hardware.
The wrong turns
The secondaryInit that worked in the emulator
On the real machine the kernel froze in video_init, at the call into the ROM’s secondaryInit. A/UX picks that entry point by machine ID, and an earlier fix forced the IIfx address for the SE/30 - which was right for the IIfx ROM in the emulator, and landed in the middle of the routine on the BMOW ROM.
Early emulator runs also used a 24-bit, 8 MB configuration with a patched ROM, which hid real problems. The emulator now runs the real configuration: BMOW ROM, 64 MB, 32-bit PRAM, Carrera on, nuCF present. The secondaryInit fix checks the ROM at run time and uses whichever address actually starts the routine. Even then, the emulator succeeded very early in the process, because it didn’t capture the true wackiness of the Carrera040 hardware; check out the Carrera040 emulation post for that whole adventure.
Reading stale stacks
The NMI Peek dumps include the Process Manager’s saved contexts. Those are saved, not live, and reading them as the current state cost three patches that fixed nothing. Lesson learned: read the live stack.
“Loading…”
A/UX Startup hung at “Loading…” on the real 040. NMI Peek showed it waiting on the Carrera software’s GetPhysical, which never returned. Two fixes came out of that: the Carrera control panel’s GetPhysical has an off-by-one (a request that ends exactly on a page boundary returns zero ranges), which the disk tool patches, and A/UX Startup was patched to skip its application check and copyright screen and to answer its own GetPhysical call with a single identity-mapped range.
The Carrera trap
With those out of the way, the kernel froze in the middle of 15 instructions that set up Mac low memory in initMacEnvironment. Same code, fine in QEMU.
The breadcrumbs put it on the first read of low memory, and after a lot of back and forth, the rule turned out to be:
On the Carrera, an uncached single bus cycle from the 68040 to a cache line that has been read through the cache never finishes. No bus error, no interrupt, no NMI: the bus just stalls.
Mac OS never trips over this, because the Carrera software maps everything cacheable and keeps it that way. A/UX maps page 0 uncached, starts with the caches off, and reads ROM data uncached in supervisor mode - so it walks into it constantly.
It took five versions of the low-memory fix to get past it:
- Make page 0 copyback-cacheable and turn the data cache on.
- The same, using the kernel’s own cache mode.
- No cache changes at all, just push and invalidate both caches. Hung at the first low-memory read again, exactly like the stock kernel. So flushing the 68040’s caches doesn’t clear whatever is remembered outside the CPU.
- Make ROM instruction fetches cacheable too. The ROM trap dispatcher then hung reading a trap word, an uncached data read from a ROM line that had just been fetched as code. Which, in hindsight, confirmed the rule.
- ROM uncached, both caches on, then read 512 KB of kernel code through the data cache, to replace any line Mac OS left behind with one A/UX only ever reads cached. This one worked.
The same trap kept showing up in new places as the boot got further, each one its own patch:
| Fix | Where the bus stalled |
|---|---|
| Slot scan | a 68040 read of an empty slot never ends either (the 68030 gets a bus error); the boot-time slot scan only sees the built-in video now |
| Polled SCSI reads | A/UX’s blind SCSI reads wait in a bus cycle while the drive pauses, and rely on the SE/30 ending it with a bus error. The Carrera never passes bus errors on to the 68040, so that’s a permanent stall |
| Slot Manager | the kernel runs the ROM’s Slot Manager with the ROM uncached, reading lines the Mac environment had read cached; froze in an sResource search, and again in a walk of the video card’s declaration ROM after a SetGamma |
| ROM copyin | the gamma table is a ROM resource, copied by the kernel with the ROM uncached |
| ROM cached for good | after the boot-time slot scan, the ROM stays write-through cacheable in supervisor mode; I/O and slots stay uncached |
One of these had its own failure: the first version of the ROM copyin fix stored its code in kernel message space the breadcrumbs also used, so taking the breadcrumbs out wrote text over it.
The rest of the fixes
Not everything was the same trap:
- Write-through pages. A/UX uses copyback pages on the 68040. Mac OS’s FAST (copyback) mode corrupts memory on the Carrera where MED (write-through) doesn’t, so A/UX now uses write-through.
- Byte-wise SCSI writes. The write-steering hole that pureed the disk.
- 68030-style cache flushes. The SE/30 ROM flushes caches with 68030
CACRbits that the 68040 ignores, so code the Mac environment had just loaded ran from stale instruction-cache lines. The emulator has no caches, so this only ever showed up on the real machine. The kernel now pushes and invalidates both caches on everyCACRwrite from the Mac environment. - No MOVE16. The Carrera doesn’t handle MOVE16 bus cycles (MicroMac’s software replaces Mac OS’s BlockMove with a plain
move.lloop for the same reason), so the kernel’s block copy no longer uses it. - The nuCF card. A small A/UX driver so the card can be the root disk. An early version tied it to one slot, and A/UX Startup’s
launchthen rejected/unixon the real machine. A/UX also hangs at startup with nothing at all on the SCSI bus, because without the internal drive the bus has no termination and the boot-time scan waits forever, so the scan can now be turned off.

The kernel starting up set to boot from the nuCF card (here an iCF9000, as SCSI ID 6). The next thing it does after the I/O Acceleration line is scan the SCSI bus, which is where it hangs with nothing on the bus.
Success
All 29 patches are now in the kernel on the real machine, and A/UX 3.1 boots with System 7.5.3 as the Mac environment. The newest piece is the SCSI-scan switch, for booting from the nuCF card with nothing on the SCSI bus.
Update, 2026-11-18: the kit is now at release 2.1, with 36 patches. A/UX can also start from an everyday System 7.5.5 restarted with extensions off, with the kernel starting the 68040 itself; that’s its own post.

The first Finder start on the real machine: “Rebuilding the desktop file…” drawn over the nuCF driver’s read and write trace.

About This Macintosh: System 7.5.3 under A/UX on the SE/30, with CommandShell running and the nuCF Boot and nuCF HD volumes on the desktop.

A/UX’s System Console in the Mac environment on the real SE/30: running on the mc68040 with caching enabled, the nuCF card found as SCSI ID 5 next to a BlueSCSI at ID 0.

There’s also a small control panel for the A/UX Mac environment that shows whether A/UX is running on the Carrera and switches the 68040’s caches through the kernel (MicroMac’s own control panel talks to the card directly, which A/UX doesn’t allow). That screenshot is from the emulator.
Still open
- FAST mode’s corruption under Mac OS is still unexplained. A/UX avoids it by using write-through pages.
- The restart fix relies on the 68030 resuming in the right place. If the Carrera driver happens to park it inside one of the 32-byte stubs (about 1 in 128 load addresses), restart hangs. Turning the power off and on still works.
Download
aux-se30-carrera040.tar.gz is release 2.1 of the kit. It contains:
se30/andse30patch.tar- the in-system patcher. Copy the tar onto the A/UX disk and runinstall.shas root: it patches/unix, and adds a step tonewconfig(and to the startup autoconfig) so every kernel they build gets the patches too.se30patch -c /unixreports what a kernel has and its settings.mac/- A/UX Kernel Switch, the Mac OS app that changed the card’s kernel in place while chasing the extensions-off start.carrera040-aux/- the cache control panel.source/- everything needed to rebuild it all, including the Python patchers, thenucfdriver and the NuCF SCSI extension.HISTORY.md- the whole story, fix by fix.
# inside A/UX, as root
tar xf se30patch.tar
sh se30/install.sh
newconfig
Then set A/UX Startup’s AutoLaunch command to launch -n -k 0x0200; the 7.5.5 post explains why.

newconfig on the real machine after install.sh: it builds a new kernel, finds 0 of 29 patches in it, and patches it before it’s installed.
The patcher checks every patch site first and leaves a kernel it doesn’t recognise alone. No Apple code is included: install.sh adds its lines to the stock A/UX 3.1 newconfig on your machine. The A/UX Startup patches (for the “Loading…” hang, and the version that finds the nuCF card itself) aren’t in the kit, since they’re patched copies of Apple’s application.
The QEMU patches let you try all of this in an emulator first, which I strongly recommend.