-
Notifications
You must be signed in to change notification settings - Fork 0
Emulator Getting Granny Smith
This page owns: obtaining, building and starting the emulator everything else on this wiki is run against.
Granny Smith is a Macintosh emulator that models the TNT hardware — the PowerPC 604, the Bandit PCI bridges, Grand Central, Cuda — well enough to run Apple's real Open Firmware ROM, the veneer, and Windows NT on top of them. It is what makes this project tractable: a HAL that crashes is a ten-second iteration rather than a reboot and a serial cable.
The emulator support this HAL needs is not in Granny Smith's mainline. It is
pull request #135, branch
ppc-le-mode-and-bandit-lane-reversal — open, not merged.
Build main and you get an emulated Power Macintosh that cannot run any of this, and will not
tell you why. The failure is Open Firmware's little-endian reboot, which happens long before
anything mentions NT — so the symptom is a machine that fetches garbage, with no message
connecting it to the cause.
This is the single most common way to waste an afternoon here.
| Commit | What it adds | What breaks without it |
|---|---|---|
96a7336 |
PowerPC little-endian mode on the 604 (MSR[ILE]/MSR[LE], the fetch and data address munge) and Bandit byte-lane reversal
|
Open Firmware's little-endian? true reboot produces a CPU that fetches garbage. Nothing works. This is the load-bearing commit |
39fa333 |
The Bandit config ports reverse with the lanes | PCI configuration space reads back byte-swapped, so no device is identified |
b4dbbe9 |
The four Cirrus 54M30 registers a driver identifies the part by |
cirrus.sys cannot identify the chip, and Setup stops with "fatal error while initializing your computer's video"
|
→ Little-endian PowerPC explains why the first of these is so fundamental.
You need git, gcc (C11) and python3. The headless build needs nothing else — no SDL, no
Emscripten.
git clone --branch ppc-le-mode-and-bandit-lane-reversal \
https://github.com/pappadf/granny-smith.git
cd granny-smithIf you already have a clone:
git fetch origin ppc-le-mode-and-bandit-lane-reversal
git checkout ppc-le-mode-and-bandit-lane-reversalOr, with the GitHub CLI — useful if the branch is later renamed or force-pushed:
gh pr checkout 135Do this before building. Three one-line checks, each of which fails silently rather than loudly, so read the output:
grep -q le_xor src/core/cpu/ppc/ppc_internal.h && echo "OK little-endian mode"
grep -q bandit_lanes_reversed src/machines/tnt/bandit.c && echo "OK Bandit lane reversal"
grep -q C54M30_CR27_ID src/core/peripherals/pci/cards/cirrus54m30.c && echo "OK Cirrus 54M30 id"Three OK lines means you are on the branch. Any silence means you are not — go back to step 1.
make headless # about a minute; produces build/headless/gs-headlessThis is a native binary with a TCP shell, breakpoints, logpoints and checkpoints — the surface
every tool in this project drives. The WebAssembly build (make) is not needed here and will not
help.
Run the emulator's own integration test for this machine family. It exercises exactly the Bandit behaviour the branch changed, so a pass means the emulator half is sound and any later failure is yours:
make integration-test-tnt-pci-slots > /tmp/tnt.log 2>&1; tail -5 /tmp/tnt.logAlmost nothing here runs the emulator one-shot. The tools talk to a long-running daemon over
TCP, so that restoring a checkpoint and trying a new hal.dll takes seconds instead of a
ten-minute cold boot.
ROM=path/to/ans-2.26NT.rom # see Media you must supply
nohup ./build/headless/gs-headless --daemon --kill --port=6820 --speed=turbo \
--no-prompt -q --checkpoint-dir=tmp/ckpt-daemon rom=$ROM --var ROM=$ROM \
> tmp/daemon.log 2>&1 &Check it came up:
tail -2 tmp/daemon.log # expect: Daemon listening ... / READYThe tools default to port 6820; GS_PORT overrides it. One daemon holds one machine.
It holds state between commands. After a run finishes, the machine is still there — you can connect and inspect memory, registers and the screen without re-running anything. This is routinely more useful than adding more instrumentation to the next run.
It will fill your disk. Every checkpoint restore materialises a fresh copy-on-write delta
under --checkpoint-dir — about 540 MB for the NT disk, and another 600 MB if a CD is
attached. A dozen iterations will fill a small volume, and the emulator will not warn you.
du -sh tmp/ckpt-daemon # watch thisDeltas the daemon does not currently hold open are throwaway; deleting them is safe. → Checkpoints and deltas
Steps 1 and 2 collapse to a plain git clone and this warning disappears. Until then it is a
required step rather than a footnote, and anyone following mainline instructions fails at the
first reboot with no clue why.
- Media you must supply — the ROM and the NT CD.
- Building the HAL.
- The emulator shell — what you can do with the daemon once it is up.
Corrections welcome — this wiki is edited directly, so nothing here has had a review. Repository · STORY.md · GPL-2.0-only
Start here
Theory
- Why NT on a Power Mac is hard
- Open Firmware
- ARC
- The veneer
- The NT boot chain
- The HAL contract
- The NT PowerPC ABI
- Little-endian PowerPC
- How Setup chooses a HAL
- The NT video stack
Machines
Emulator
- Getting Granny Smith
- Media you must supply
- Building the HAL
- The boot floppy
- Preparing disks
- Running text-mode Setup
- Capturing the installed image
- Booting the installed system
- Iterating on the HAL
- Checkpoints and deltas
- Making an OEM CD (retired)
Real hardware
Debugging
- The emulator shell
- Reading NT binaries
- Decoding a bugcheck
- When your instrumentation lies
- Debugging recipes
Reference
- HAL exports
- ARC environment variables
- The veneer's VrDebug bitmask
- Veneer patch catalogue
- Address and interrupt map
- Error codes seen
Project