AI disclosure: Claude Code was used as a member of the development team for this project.

This project spun out of some work I was doing with Claude on the System 7.1 leaked source code. I originally was trying to synthesize the missing pieces of source code, get it booting, and then port it over to PPC. I eventually got it booting in an emulator, but halfway through I was wondering how hard it would be to port over busybox and have like a "MachTen" style environment, but for Linux!
Turns out, not that hard (with a healthy token budget and an uncomplaining "dev"). Tux Box is a Mac OS 9 application that loads an ordinary statically-linked PowerPC Linux ELF, lets the CPU run its instructions directly, and services its system calls out of the Toolbox. There's no emulation involved, BusyBox believes it's on Linux, Mac OS believes it's running one well-behaved app, and both are right. The gate is the interesting part: on a PowerPC Mac `sc` belongs to the NanoKernel and there's no documented exception kind for what it raises, so guests are built with musl's syscall stub patched to trap with `tw` instead. That arrives as `kTrapException`, which an ordinary application can catch via InstallExceptionHandler. Guests are static PIE and get relocated into whatever block NewPtr hands back, since an app can't map memory where it pleases.
The screenshots are BusyBox ash (with a prompt, history, tab completion, cd and working pipelines), MicroPython 1.25 in 330 KB, and a little fetch script. The app's own folder is the guest's / over HFS, and /Volumes opens onto the real disks, so grep and find reach actual Mac files. Networking goes through Open Transport with TCP, UDP and DNS, so wget works, plus HTTPS via mbedTLS linked into the guest.
I don't know if anyone else will find this useful or not, and I haven't bisected the app & code out of my messy working directory for original System 7.1 playground. But I hope to have this on GitHub later this week/weekend.
EDIT: Spelling

This project spun out of some work I was doing with Claude on the System 7.1 leaked source code. I originally was trying to synthesize the missing pieces of source code, get it booting, and then port it over to PPC. I eventually got it booting in an emulator, but halfway through I was wondering how hard it would be to port over busybox and have like a "MachTen" style environment, but for Linux!
Turns out, not that hard (with a healthy token budget and an uncomplaining "dev"). Tux Box is a Mac OS 9 application that loads an ordinary statically-linked PowerPC Linux ELF, lets the CPU run its instructions directly, and services its system calls out of the Toolbox. There's no emulation involved, BusyBox believes it's on Linux, Mac OS believes it's running one well-behaved app, and both are right. The gate is the interesting part: on a PowerPC Mac `sc` belongs to the NanoKernel and there's no documented exception kind for what it raises, so guests are built with musl's syscall stub patched to trap with `tw` instead. That arrives as `kTrapException`, which an ordinary application can catch via InstallExceptionHandler. Guests are static PIE and get relocated into whatever block NewPtr hands back, since an app can't map memory where it pleases.
The screenshots are BusyBox ash (with a prompt, history, tab completion, cd and working pipelines), MicroPython 1.25 in 330 KB, and a little fetch script. The app's own folder is the guest's / over HFS, and /Volumes opens onto the real disks, so grep and find reach actual Mac files. Networking goes through Open Transport with TCP, UDP and DNS, so wget works, plus HTTPS via mbedTLS linked into the guest.
I don't know if anyone else will find this useful or not, and I haven't bisected the app & code out of my messy working directory for original System 7.1 playground. But I hope to have this on GitHub later this week/weekend.
EDIT: Spelling




