Skip to content

Emulator Getting Granny Smith

pappadf edited this page Sep 14, 2026 · 1 revision

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.


⚠ Read this first: you need a branch, not main

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.

What the branch adds

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.


1. Get the source

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-smith

If you already have a clone:

git fetch origin ppc-le-mode-and-bandit-lane-reversal
git checkout ppc-le-mode-and-bandit-lane-reversal

Or, with the GitHub CLI — useful if the branch is later renamed or force-pushed:

gh pr checkout 135

2. Confirm you actually have it

Do 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.

3. Build

make headless          # about a minute; produces build/headless/gs-headless

This 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.

4. Check it works before involving NT

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.log

5. Start the daemon

Almost 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 ... / READY

The tools default to port 6820; GS_PORT overrides it. One daemon holds one machine.

Two things to know about the daemon

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 this

Deltas the daemon does not currently hold open are throwaway; deleting them is safe. → Checkpoints and deltas


When #135 merges

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.


Next

Clone this wiki locally