Showing posts with label Infinite Mac. Show all posts

Infinite Mac: BeOS #

tl;dr: You can now run many BeOS versions in the browser at Infinite Mac, my site where you can experience the Macintosh Cinematic Universe from 1984 to 2005. The installs are full peers to their Mac cousins: you can boot them instantly (large disks are streamed in), play around with pre-installed software from Infinite HD, insert CD-ROMs from the Internet Archive, and save your work on the “Saved HD” drive.

BeOS was a multimedia-focused, multi-tasking and multi-threaded OS that was eventually ported to the Power Macintoshes of the mid-90s. It impressed many in the Mac community, including Apple itself, who considered acquiring Be, the company that had created it. If you’ve been following the saga of Apple’s search for a next-generation operating system, this lets you see what the road not taken was like.

BeOS R5 running inside Infinite Mac, showing GL Teapot, Mandelbrot, Gobe Productive, Terminal, image viewer and CPU monitor.

Getting BeOS Running

After the last somewhat involved (though still satisfying) project on Infinite Mac, I was looking for a quicker win. BeOS had been on my radar for a while, and (unlike A/UX) I had a personal connection to it: I remember spotting a BeBox in Akihabara, making my Mac cosplay as it with BeView, and eventually dual-booting BeOS on my Power Macintosh 8500. DingusPPC, an emulator I had already integrated, was making good progress on running BeOS, so it seemed like adding it to the site would be mostly a matter of preparing some additional disk images.

Initially it appeared to be as straightforward as I had hoped; I added a Power Macintosh 7300 configuration (one of the Power Macs that was officially supported), found an install CD, made a disk image, and was up and running. But as I used it more and started to install additional versions, I began to find a lot of small bugs and edge cases:

  • The BeOS boot loader thought that all modifier keys were being held down due to a bug in the ADB emulation; this made it present the (ugly, PC BIOS-like) partition choice screen every time.
  • When changing the screen depth, there are two hardware components that need to be notified: the video controller and the digital-to-analog converter. DingusPPC had been accidentally relying on the order that Mac OS sent these notifications in; BeOS happened to make the opposite choice and would end up with a corrupted display.
  • Early versions of BeOS did video memory updates in little-endian mode1; DingusPPC was missing support for that hardware capability.
  • Later versions of BeOS could mount HFS partitions, but they were having trouble with the volumes that I generated via the machfs Python library. It turned out that BeOS was (correctly) stricter than Mac OS about how some data structures should be populated.
  • And so on – most of the commits that I upstreamed to DingusPPC over the past month were in a quest for better BeOS compatibility.

Infinite Mac emulating BeOS R5 emulating System 7.6.1 running Speedometer
The best of both worlds?

SheepShaver, a Power Macintosh emulator that is still around today (and that Infinite Mac also embeds), originated on BeOS. Mostly for the fun of another layer of inception/emulation, I wanted to make sure that it worked too. As it turned out, it also required a compatibility fix – it relied on an edge case of how the ROM is mapped to physical memory addresses that DingusPPC did not accurately model.

There is a pattern to most of these bug fixes: DingusPPC (and Infinite Mac) have been mostly focused on running Mac OS, and thus accidentally became dependent on its quirks or implementation choices. Adding an independently developed operating system to the mix exercised new paths, and ended up improving the accuracy of the emulated hardware. To be clear, DingusPPC was pretty close out of the box; kudos to its maintainers. I believe that, with this work, it’s the only emulator2 that can run PowerPC versions of BeOS. I’m also hopeful that this will help with bringing up alternate operating systems like MkLinux (which I also have memories of) and Rhapsody.

Infinite Mac custom instance dialog with a BeOS control appearance.

On the Infinite Mac side, there were obvious changes like a “BeOS” appearance for my custom controls and collecting software for the library. I also needed to overlay some dynamically generated content on the disk to get the OS to preselect a screen resolution that matches the browser window’s (similar to what was done for A/UX). An AI agent (still Codex for me) was once again helpful for this type of fiddly reverse-engineering task: it’s one thing to observe that the OS stores a file on disk with the screen size; it’s another to be able to reproduce all its nuances, especially as the format changed with later releases.

Developer Release 8.2, the initial BeOS version for Power Macs, had a time bomb that kept it from booting after April 1, 1997. This was not just to create a sense of urgency; it shipped with a licensed font renderer that Be could not distribute indefinitely. DR8.3 addressed this, but to make that notable first version bootable, I did end up relying on the custom date support to hardcode a working date when choosing that disk.

BeOS Impressions

Though I did kick the tires of BeOS back when it was current, I don’t recall using it enough to form any opinions beyond “this is fast; I miss all my third-party software.” About This Particular Macintosh does have contemporary coverage, including Be’s first and second appearances at Macworld Expo Boston, and reviews of R3 and R4.5; they make for interesting reading. This video released by Be itself also has a walkthrough of what they considered its strengths.

Looking at it with 2026 eyes, I am still struck by its speed – it’s fast to boot and to use, especially when compared with its contemporary Mac OS releases that do so much less (e.g. live window dragging did not appear until Mac OS X). The POSIX subsystem and the Unix-like shell also feel modern (unlike A/UX’s) – I had no trouble using the terminal to poke around. There’s also plenty of innovation, though some of it (BFS with its attributes and live queries) is more interesting than the rest (replicants are a precursor to widgets, but I couldn’t think of a use for them).

It also feels like a developer-focused and under-construction system: many of the included apps are technology demos (though who doesn’t love a Utah teapot), while a contemporary Be homepage links directly to the developer release notes and discusses CodeWarrior releases and access to the bug tracker. The unfinished nature extends to third-party software too – I stumbled across some BeOS software on this Amiga magazine CD, and most of it had a “version 0.1” feel, either literally or figuratively. To be fair, I did find some more fleshed-out software, for example, Gobe Productive from the former ClarisWorks team. This and other software is on Infinite HD if you’d like to try it out (preferably in later OS versions).

The interface seemed novel at the time, though I wonder how it would have held up3. The distinctive tabbed window titles look neat, but they have a reduced draggable area, so I’d have to think harder every time I wanted to move a window. And using a hand as the default cursor makes clicking feel less precise than a traditional arrow (just which of the pixels on the “finger” is the hotspot?). Other parts of the UI feel like a not-fully-coherent Windows/Mac hybrid, with a Deskbar that can emulate a Start menu4, Alt key accelerators on menu items, but also spring-loaded folders and a spatial Finder Tracker.

Speaking of the Tracker, I had not realized that Be had open-sourced it (and even incorporated changes from the open-source version). This was around the time that Be pivoted away to internet appliances – there’s no need to invest engineering resources in a file manager if all that’s exposed is one full-screen browser app. This interview with the Tracker developer has more of the backstory.

OPENSTEP 4.0 and BeOS DR8.2, side-by-side in Infinite Mac's disk browser
Do your own bake-off: NeXT vs. Be

NeXTStep, by comparison, feels more mature. It had gone through some similar churn (proprietary hardware to off-the-shelf PCs, company strategy shifts), but, perhaps because it had more time, it handled things a bit more gracefully. For example, NeXT supported “fat” binaries that could run on 68K, Intel, PA-RISC and other architectures. On BeOS they had to be separate executables, making the user choose which to run and complicating distribution (this made it harder for me to find software to include in Infinite HD). Worse yet, you also had to have parallel disk partitions on CD-ROMs: BFS used the host endianness, so disks written by a PowerPC install could not be read by an Intel one, or vice versa. But my pro-NeXT bias may be due to knowing which OS Apple ended up picking.

Other Site Improvements

It’s only been a short while since the last update, but I did squeeze in a couple of quality-of-life improvements. You can now take screenshots and record videos (with sound) of the emulated machine’s screen. This gives you a high-fidelity way to capture image content, since it’s a direct dump of what would have been shown on the screen.

Infinite Mac CD-ROM drawer showing a lot of system CDs.

I also expanded the collection of operating system CD-ROMs with items like the Rhapsody and Mac OS X developer previews. While they’re aspirational for now (DingusPPC can’t run them yet), they do satisfy my completionist tendencies. These CDs are mirrored to and served from my own Cloudflare R2 bucket – the Internet Archive is an incredible resource (you can donate to them), but streaming from it has been increasingly flaky. I don’t want to add to the problem, and thanks to my sponsors, I can afford to serve a few gigabytes.

As for what’s next, with this alternate Mac timeline covered, it may be time to explore a prequel.

Update: See also the discussion on Hacker News.

  1. TIL that this was possible – Apple generally ran the PowerPC and did everything on its machines in big-endian mode. There’s even a patent about this controller capability. ↩
  2. Though while I was working on this, BeBox was vibed into existence. ↩
  3. Then again it looks like Haiku has preserved it almost verbatim, so it definitely has a long-lasting appeal to some. ↩
  4. If you can find the 3-pixel-wide draggable area to move it to the bottom. ↩

Infinite Mac: Snow and A/UX #

tl;dr: Infinite Mac now uses a custom WebAssembly build of the Snow emulator to simulate many early 68K Macintoshes. Snow is a more capable emulator; in addition to classic Mac OS, it is now possible to run A/UX (Apple’s late ’80s UNIX/Mac hybrid).

A/UX 3.1 running inside Infinite Mac, showing the Finder opened to a Photoshop Window, the xlogo X11 program, and a command shell.

Snow

Since its launch, all of the early (pre-System 7) instances on Infinite Mac have been powered by Mini vMac. I’ve previously discussed how it’s a somewhat idiosyncratic and seemingly abandoned codebase. While the core emulator works well enough, I had a long list of features for deeper integration into the site (and bugs to fix). I did not relish the thought of diving back into a sea of cryptically named functions and C preprocessor tricks. Separately, “learn Rust” had been on my wishlist, but I never had a project in mind for it.

It was thus fortuitous that Snow was released late last year. It’s an emulator that covers the same era1 as Mini vMac, with a focus on accuracy. It also happens to be written in Rust, and has an active maintainer and community. I set out to bring up Snow as a new emulator core inside Infinite Mac, with the goal of eventually replacing my use of Mini vMac.

Snow is a well-structured codebase; there’s already a separation between the core and the native frontend. It was pretty natural to add a new crate that hooked up the core to the Infinite Mac abstractions for video, input, audio, disk images, etc. For file I/O and audio, Snow didn’t quite have the flexibility I needed, but it was feasible to add a layer of indirection. The maintainer was open to merging these changes; my fork is mostly Infinite Mac-specific work, and thus easy to keep up to date.

The flipside of Snow being a more accurate emulator is that it also replicates the limitations of early Mac hardware. For example, the original Mac 128K only had an internal 400K floppy drive, and a connector for attaching an external one. But there was no first-party hard drive (at least, not without hacks) and third-party ones sound finicky2. Mini vMac did not quite operate at that level (it instead patches the ROM and relies on that custom driver) and thus it was possible to “cheat” – I had simulated an “Infinite HD” for it with 1.4 MB of installed software, even though that was anachronistic3.

Infinite Mac emulating System 1.0 on the Mac 128k, showng the message 'Please insert the disk Write/Paint' with the floppy drawer open.
Disk swapper’s elbow, now in your browser

Mac Missiles created by Avadis Tevanian, Jr. (who later became Apple CTO)
Rolodex created by Bill Atkinson, presumably as a side-project
Some familiar names in early Mac software about boxes

In lieu of a hard drive, I ended up extending the CD-ROM library feature with a “Floppies” companion. It draws upon the Internet Archive (especially the Moof-A-Day collection) and the Macintosh Garden to showcase early Mac software. Unlike with CD-ROMs, the disk images are small enough that it’s worth it for me to host them – it both improves reliability and allows me to preprocess them, to handle compression and other edge cases.

Despite the Mac having a reputation of not having a lot of software, it was still impressive just how much there was released even in its first couple of years of its existence. I’m sure I’ve missed including some classics, but I’m happy to add more if you let me know.

Additional changes were required to handle Snow’s verisimilitude. MODE32 is now available to allow the IIcx and other non-32-bit-clean machines to actually address more than 8 MB of RAM. I had to make sure that a CD-ROM driver was installed on all disk images, otherwise CDs could not be mounted. Similar to the hard drive situation, I had been relying on Basilisk II’s ROM patching for this support.

The most complicated change involved teaching the OS to handle dynamic screen sizes and color depths. Snow emulates real NuBus graphics cards (unlike Mini vMac and Basilisk II’s virtual screen drivers), and they would default to black and white. The configuration is driven by a scrn resource that’s stored in the System suitcase of the boot disk. Its contents need to be dynamically generated based on the chosen screen resolution, so my normal approach of doing this at disk image building time (which is what I do for Stickies text) would not work. I instead leave a placeholder entry on disk, track its location, and overlay at runtime the values for the current screen parameters.

Snow brings some additional capabilities too, so all this work was not just to maintain the status quo. It has built-in support for the BlueSCSI Toolbox protocol, allowing file sharing with the host. This means that it’s possible to have a variant of The Outside World drive, though not as slick as Basilisk II’s virtual folder structure. It also emulates a SCSI-based printer, which I’ve hooked up to Infinite Mac too – you can now “print” to export graphics as downloadable PNGs. There’s also a long tail of Mac features you can now experience, such as booting from ROM with the Mac Classic. Finally, Snow aims to more accurately replicate the speed of the machine, though if you get impatient there is an “Uncapped” speed setting.

MacPaint "printing" to a PNG file inside the Snow emulator on Infinite Mac

A/UX

A secondary reason for adopting Snow was that it seemed quite likely that it would be able to run A/UX, Apple’s alternate UNIX-based OS from the late 80s and early 90s. While Shoebill was also an option I had considered, I didn’t relish the idea of incorporating yet another frozen-in-time emulator4 just to run one OS. Sure enough, a few months after I’d started the port, Snow 1.5 was released, bringing A/UX support.

1998 saw the release of A/UX 1.0, NeXTStep 0.8, and System 6.0
1988: The Year of UNIX on the desktop (and System 6)

A/UX mostly just worked – it was a matter of adding additional system images and categorizing them appropriately. Much like early releases of Mac system software and NeXTStep, it’s hard to find original installation media – 1.0 is still MIA and 1.1 was only recently archived5. The OS installations are most fresh-out-of-the-box, though I did end up making some tweaks to make the booting marginally friendlier.

A/UX 2.0 about box, showing the signatures of all those woho made it
It’s nice to be able to sign your work

This is my first time actually using A/UX, and it generates some cognitive dissonance. On one hand, it’s a classic Mac, with a Finder (at least starting with A/UX 2.0) and other familiar trappings. On the other, it’s a UNIX system, with a terminal and other things that engender “It’s a UNIX system! I know this!” feelings. But the UNIX is old (I kept typing vim instead of vi, and really missed tab completion) and feels quirky at times6.

The combination of the Mac GUI and UNIX does feel powerful, though the integration is much clunkier than what was ultimately achieved with Mac OS X, more than 10 years later7. The seams between the two (or even three, if you count X Windows-based UNIX GUI programs) worlds are pretty visible. There was an attempt at bridging the gap, via A/UX Toolbox programs, but it doesn’t appear to have been commonly used. For example, only the X Windows version of Mosaic was available, as opposed to a best-of-both-worlds A/UX Toolbox take on the Mac port. And in the other direction, A/UX did include a Commando mode that added a GUI to common command-line tools. However, it didn’t solve the fundamental issues of discovery in a CLI (you had to know the name of the command to invoke Commando for it).

A/UX Command dialog for the 'grep' command, showing some of its options as checkboxes and radio buttons
Commando output for grep – curious what it would have been for git

While later versions of A/UX could directly mount HFS disks, it still required the use of UFS for booting, which made integration with Macs (and their resource forks and metadata) clunkier. The solution was the AppleSingle and AppleDouble formats, which is the one part of A/UX that lives on: AppleDouble is still used in .zip archives in modern macOS.

If you’d like to learn more about A/UX, this post on Virtually Fun and this one on The Long View are worth reading – they both describe the story and have some ruminations as to why it was a dead end. There’s also the A/UX FAQ and and the Jagubox A/UX software archive (I created a .iso variant so it's easier to mount via the CD-ROM drawer).

Learning Rust

As for my “learn Rust via the Snow bring-up” goal, I did not achieve it, at least not in a traditional way. I got the book, made my way through the first few chapters, and developed some familiarity with Rust concepts. But I couldn’t quite sustain the interest in learning all of the mechanics, especially with Snow being a relatively mature and complex codebase, and my needs being simple, mostly glue code.

This was around January, shortly after coding agents had hit an inflection point. I figured this would be a good test case: did I need to learn the syntax and other basics, or could I skip straight to the interesting parts? While the agent (Claude Code initially, Codex nowadays) knows Rust a lot better than I do, I still felt like I was adding value. Its first attempt to get things to build under Emscripten involved littering #[cfg] checks everywhere. I had to direct it to use stubs, and generally prioritize diff size and maintainability. Similarly, to actually get to the boot stage, I had to draw on past experiences about draining sound buffers.

For the most part, I’m fine with where things ended up – I still understand the generated code, even if I wasn’t the one entering it in. Developing more familiarity with the Rust ecosystem also allowed me to use it in other places: it now powers automatic decompression of disk images inside of StuffIt archives. I still have a lot to learn too, and it’s mostly on me to decide how much I want the agent to be in teaching vs. do-it-for-me mode.

I’ve also found agents to be helpful when debugging, much like the experiences of Linus Torvalds and Arbee8. With emulators there are many things to keep track of (host, emulated CPU, MMU, devices, guest OS/kernel, guest processes, etc.), and agents can churn overnight doing an instrument/run/get a breadcrumb/repeat loop. Getting to a smoking gun is not as satisfying as doing it by hand, but I don’t always have the time or energy for it.

Other Site Improvements

The agent-assisted debugging enabled me to make some more fixes to DingusPPC, and the Mac OS X Public Beta now boots correctly (you can admire the courage to have a non-functional Apple logo in the center of the menu bar). I also made some performance improvements (DMA is good for emulators too) and implemented CD-ROM insertion for that emulator, allowing the CD-ROM library to work for the more modern PowerPC machines that it emulates.

There were also a bunch of quality-of-life improvements: an on-screen keyboard to allow obscure keys to be entered, a cleaner way to open Infinite HD at startup (without littering aliases to it), support for client-side (CORS) fetching of external disk images, and even a fix for a longstanding SheepShaver issue.

As for what’s next, I’m debating between breadth and depth; we’ll see what sparks joy.

  1. Early Motorola 68K-powered Macs, though Snow keeps increasing its time horizon. ↩
  2. Third-party hard drives were also rare enough that I’ve seen no attempts at reverse engineering them. This thread is converging on enough information about the Tecmar Mac Drive that it may be feasible now. ↩
  3. Amusingly this then ended up in David Pogue’s Apple: The First 50 Years book. Hopefully the screenshots within it are not treated as gospel in a future The First 100 Years edition. ↩
  4. The author is alive and well, but there is a conflict of interest – the author works at Apple now. It is amusing to think that it is Apple conflicting with itself. ↩
  5. And it’s not much fun to install from scratch. ↩
  6. Why does the manual encourage you to run sync;sync;sync as part of system shutdown – would one sync (or two) not have been enough? ↩
  7. Or what NeXT had around the same time, another way in which it was ahead of its time. ↩
  8. A MAME maintainer working on Mac support – see also their AI tips. ↩

Infinite Mac: Resource Fork Roundtripping #

One of the frequent emails that I get about Infinite Mac is “I’ve been copying over these files to every mac I’ve owned for the past 20 (or 30 or 40) years, how can I load them into your site?” While there’s been a “The Outside World” drive from the very beginning, all it can do is a best-effort import/export using available browser APIs. Classic Mac OS used resource forks for structured data and stored additional metadata in the file system (where it belongs). Modern macOS still supports all of this, but unfortunately none of that data is visible to web apps – all they can read is the “data fork” of the file (i.e. its raw contents).

This is a long-standing issue – once Macintosh files started to be distributed over the Internet in the mid-90s, they were usually in a container format like MacBinary or StuffIt to preserve this extra data. While StuffIt is still around, having to download a separate program goes against the ethos of Infinite Mac being as easy to use as possible. After some investigation, I remembered that .zip archives created by modern macOS preserve resource forks ("modern" in this case being relative – this feature dates back to 10.3). Specifically they create a parallel __MACOSX directory structure that has metadata and resource forks in an AppleDouble file.

A while back I added detection of such .zip files, which helped with getting data in. More recently, I also switched the .zip files that Infinite Mac generates when exporting to also use this convention, allowing the Finder to expand and reconstruct the full contents. I also wanted to make this feature somewhat discoverable, and I chanced upon an exemption to the “browsers can’t see resource forks” limitation that I mentioned above – when dragging a whole folder into the window it’s possible to read a file’s resource fork via a magic file/..namedfork/rsrc path (sadly there’s no equivalent for the metadata). I used this to show a notification to remind users of the .zip capabilities.

This video shows these features working together – an old app of mine starts out on the modern macOS host – it can be imported, its vers resource edited, and then exported back out (miraculously today’s Finder still displays information based on it).

Odds and Ends

Using the same notification mechanism, I also made the need to click into the window for emulators that use relative mouse movements (DingsuPPC, PearPC, Previous) more discoverable. Thanks to this tip I figured out how to (ab)use GitHub releases to store large files, letting me finally share the Mac OS X disk images I’ve been using. Finally I fixed some longstanding issues with audio playback in some browsers and stuck modifier keys.

Infinite Mac Construction Set #

tl;dr: You can now embed any OS from Infinite Mac into your website, from 1984’s System 1.0 through 2005’s Mac OS X 10.4. There’s documentation for customizing and controlling embedded instances programmatically. As a demo of what’s possible, Infinite Monkey hooks up an emulated Mac 128K to OpenAI’s and Anthropic’s computer-using models, letting the technologies of 1984 and 2025 to finally meet. The instigator behind all this was Marcin Wichary, whose recent Frame of preference article is another showcase of the embedding capabilities.

A Kindred Spirit

Marcin’s articles – with their attention to detail and passion that they convey – have always struck a chord with me, whether they’re about underrated fonts or underrated movies. I’ve also appreciated that he strives for interactivity, from his Google Doodles to his Config talks. A few months ago, Marcin approached me about doing a modern take on his GUIdebook site, something with a story to tell and a way for readers to experience the material first-hand. Specifically, he wanted a way to embed emulated Mac instances in an article, ideally in as seamless of a way as possible.

Infinite Mac was already used by sites like Classic Macintosh Game Demos, DiscMaster, and Macintosh Repository to host runnable custom instances. But those were full-screen experiences and, in some cases, required a custom fork of the site. I wanted the experience to be closer to a YouTube or Google Maps embed – a snippet of HTML that’s easy to drop into any site, but still controllable via query parameters. To enable this, I added a new /embed endpoint that’s better suited to iframing. In addition to hiding the screen bezel and other chrome, it lets the embedding site control the screen resolution, get notified of the screen contents changing, and send mouse and keyboard events to the emulated Mac.

To keep embedded instances lightweight, I added an option for auto-pausing when they’re hidden. This uses both in-page (IntersectionObserver) and cross-page (visibilitychange) signals to pause and resume the emulator. Fortunately, I didn’t need to implement pausing in each emulator – instead I hooked into their input-reading loop and used Atomics.wait to cheaply suspend execution until the “paused” bit is cleared.

There were a couple of surprises along the way. First, while Chrome lets SharedArrayBuffer work in iframes (via the allow="cross-origin-isolated" attribute), this is not yet supported in Safari/WebKit-based browsers. That made my 2021-era Safari workaround newly relevant. It mostly worked, but it assumed a single global emulator instance which in Marcin’s tests had the hilarious effect of making every Mac on the page receive the same input. I added per-instance tracking so that each one gets its own event stream.

Infinite Mac network request waterfalling

Second, Marcin noticed his custom disk images loaded much more slowly than the built-in ones. Some of that was due to them bypassing Cloudflare’s cache, but even when that was enabled, they were slower. It turned out that prefetching – added in the earliest days of the site, when all it ran was System 7 – had become even more important for more modern Mac OS versions. They read a lot more data at startup, and being blocked for 50-100ms for each chunk adds up when they need to get through a couple of hundred. Extending the prefetching to remote disks too (and caching these prefetched chunks via the service worker) shaved a lot of time off booting the Mac OS 8.5 and NeXTStep images from Marcin’s article.

Infinite Mac embed builder dialog

I wanted to make embedding as approachable as possible (well, approachable for those interested in computing platforms from 20 to 40 years ago). There is an embed HTML builder that uses a variant of the custom instance dialog to generate the <iframe> markup for a specific instance (a construction set if you will). I also wrote documentation for the query parameters and message events to control the instance and receive state-change notifications.

Making a Demo Site

Marcin’s article is a kind of demo, and I had a crude testbed, but I wanted to more thoroughly dogfood the embedding support. It occurred to me that its capabilities (get screen content updates, send synthetic input events) made it a perfect fit for the computer use models recently launched by OpenAI and Anthropic. Their demos control a Docker container or other remote environment; having something in the browser is both satisfying (nothing to set up) and safe (the emulation sandbox already limits what the model can do).

The Mac actually has a long history of being controlled by another program, thus the Infinite Monkey site was born (as an aside, the original Monkey desk accessory is installed in the System 1.0 image if you’d like to try it out). Hooking it up was relatively straightforward, the useComputer and useChat hooks have the core glue logic. I even had Claude Code write most of the Anthropic glue code. I went with a “bring your own API key” approach – the models are somewhat expensive, and I did not want the donors to foot the bill. This does make it somewhat less accessible (the OpenAI version of the model is only available for Tier 3 accounts, and possibly not even then). The demo video should help those who don’t have access.

The actual experience of letting an LLM drive System 1.0 is a bit like a dog walking on its hind legs – impressive that it works at all, but objectively a bit underwhelming. The models are slow, it’s definitely faster to use the computer yourself (Anthropic’s own documentation calls this out). They also struggle with the UI conventions of older platforms, especially the press-and-hold mechanics of pull-down menus. OpenAI’s model can’t use them at all, since it can only request click and drag actions. Anthropic’s fares better with its separate left_mouse_down and left_mouse_up, but it often tries to click first, even when instructed otherwise.


OpenAI vs. Anthropic's handling of pull-down menus

This is just one possibility, I’m curious what other things could be built using embedded instances. And if there’s a capability that you wish they had, feel free to file an issue suggesting it.

Odds and Ends

I modernized the site’s Cloudflare setup, adopting both static assets and the official Vite plugin. Both worked as advertised: I have less code to maintain, and the local dev experience is closer to production. It was a welcome change from the usual experience on the frontend dependency treadmill.

The auto-pausing work above also suggested how I might implement a speed setting for more machine types. This fulfills a long-standing feature request to allow older software to run more accurately. It’s somewhat amusing that even in this many-layered environment (an emulator compiled to WebAssembly, which is in turn interpreted or compiled to the native platform) some things can be too fast.

Epilogue: Doctor. Manhattan has nothing on me

  • It is 2006. I am working on making one website (Google Reader) embeddable in another (Gmail).
  • It is 2007. I am working on making one website (Google Reader) embeddable in another (Blogger).
  • It is 2008. I am working on making one website (Google Reader) embeddable in another (iGoogle).
  • It is 2012. I am working on making any web app (Chrome Apps) embeddable in a host environment (Chrome).
  • It is 2017. I am working on making any web app (Live Apps) embeddable in another (Quip documents).
  • It is 2020. I am working on making one website (Quip chat) embeddable in another (Salesforce Lightning).
  • It is 2021. I am working on making one website (Quip documents) embeddable in another (Slack).
  • It is 2022. I am working on making one service (Tailscale SSH) embeddable in another (Tailscale Admin Panel).
  • It is 2023. I am working on making one service (Sierra agents) embeddable in any website or iOS app.
  • It is 2024. I am working on making one service (Sierra agents) embeddable in any Android app.
  • It is 2025. I am working on making one website (Infinite Mac) embeddable in any other.

Infinite Mac OS X #

tl;dr: Infinite Mac can now run early Mac OS X, with 10.1 and 10.3 being the best supported versions. It’s not particularly snappy, but as someone who lived through that period, I can tell you that it wasn’t much better on real hardware. Infinite HD has also been rebuilt to have some notable indie software from that era.

Mac OS X 10.1 running NetNewsWire Lite and Terminal

Porting PearPC

I’ve been tracking DingusPPC progress since my initial port and making the occasional contribution myself, with the hope of using it to run Mac OS X in Infinite Mac. While it has continued to improve, I reached a plateau last summer; my attempts would result in either kernel panics or graphical corruption. I tried to reduce the problem a bit via a deterministic execution mode, but it wasn’t really clear where to go next. I decided to take a break from this emulator and explore alternate paths of getting Mac OS X to run.

PearPC was the obvious choice – it was created with the express purpose of emulating Mac OS X on x86 Windows and Linux machines in the early 2000s. By all accounts, it did this successfully for a few years, until interest waned after the Intel switch (sadly one of the authors passed away around then). I had earlier dismissed it as a “dead” codebase, but I decided that the satisfaction of getting something working compensated for dealing with legacy C++ (complete with its own string class, sprintf implementation, and GIF decoder). An encouraging discovery was that kanjitalk755 (the de-facto Basilisk II and SheepShaver maintainer) had somewhat recently set up an experimental branch of PearPC that built and ran on modern macOS. I was able to replicate their work without too much trouble, and with that existence proof I started on my sixth port of an emulator to WebAssembly/Emscripten and the Infinite Mac runtime.

In some ways PearPC not being actively developed made things easier – I didn’t have to worry about merging in changes from upstream, or agonize over how to structure my modifications to make them easier to contribute back. It was also helpful that PearPC was already a multi-platform codebase and thus had the right layers of abstraction to make adding another target pretty easy. As a bonus, it didn’t make pervasive use of threads or other harder-to-port concepts. Over the course of a few days, I was able to get it to build, output video, load disk images, and get mouse and keyboard input hooked up. It was pretty satisfying to have Mac OS X 10.2 running in a browser more reliably than it previously had.

Performance

While PearPC ran 10.2 more reliably, it felt slower than DingusPCC. I had spent some time last year making some optimizations to the latter, partly inspired by the TinyPPC emulator in this SheepShaver fork (aren’t all these names fun?). I ported DingusPPC’s benchmark harness and then set about replicating the performance work in PearPC (both emulators are pure interpreters driven by a lookup table, so the process was relatively straightforward). I was able to shave off about 15 seconds from the 10.2 boot time – it helps from a saving lives perspective, but is still not enough given that it takes almost 2 minutes to be fully operational. In the end, I copped out and added a UI disclaimer that Mac OS X can be slow to boot. I also got flashbacks to the “is it snappy yet?” discussions from the early days of Mac OS X – it was indeed slow, but not this slow.

Performance is still not as good as DingusPPC’s – the biggest bottleneck is the lack of any kind of caching in the MMU, so all loads and stores are expensive since they involve complex address computations. DingusPPC has a much more mature tiered cache that appears to be quite effective. More generally, while PearPC may be more stable than DingusPPC at running 10.2-10.4, it’s a much less principled codebase (I came across many mystery commits) and it “cheats” in many ways (it has a custom firmware and video driver, and only the subset of PowerPC instructions that are needed for Mac OS X are implemented). I’m still holding out hope for DingusPPC to be the fast, stable, and correct choice for the long term.

A Side Quest

I implemented the “unified decoding table” approach in PearPC’s interpreter one opcode family at a time. When I got to the floating point operations, I assumed it was going to be another mechanical change. I was instead surprised to see that behavior regressed – I got some rendering glitches in the Dock, and the Finder windows would not open at all. After some debugging, I noticed that the dispatching for opcode groups 59 and 63 didn’t just do a basic lookup on the relevant instruction bits. It first checked the FP bit of the Machine State Register (MSR), and if it was not set it would throw a “floating point unavailable” exception.

I initially thought this was the emulator being pedantic – all PowerPC chips used in Macs had an FPU, so this should never happen. However, setting a breakpoint showed that the exception was being hit pretty frequently during Mac OS X startup. The xnu kernel sources of that time period are available, and though I’m not familiar with the details, there are places where the FP bit is cleared and a handler for the resulting exception is registered. I assume this is an optimization to avoid having to save/restore FPU registers during context switches (if they’re not being used). The upshot was that once I implemented the equivalent FP check in my optimized dispatch code, the rendering problems went away.

This reminded me of the rendering glitches that I had encountered when trying to run Mac OS X under DingusPPC. Even when booting from the 10.2 install CD (which does not kernel panic) I would end up with missing text and other issues:

Mac OS X 10.2 installer showing text rendering glitches

Checking the DingusPPC sources showed that it never checked the FP bit, and always allowed floating point instructions to go through. I did a quick hack to check it and raise an exception if needed, and the glitches went away!

Mac OS X 10.2 installer correctly rendering text

The proper implementation was a bit more complicated, and I ended up revising it a bit to avoid a performance hit (and another contributor did another pass). But at the end of it all, DingusPPC became a lot more stable, which was a nice side effect. Better yet, it can run 10.1 reliably, which PearPC cannot. I ended up using a combination of both emulators to run a broader subset of early Mac OS X (unfortunately 10.0 is still unstable, and the Public Beta kernel panics immediately, but I’m holding out hope for the future).

Rebuilding Infinite HD

Part of the appeal of Infinite Mac is that the emulated machines also have an “Infinite HD” mounted with a lot of era-appropriate software to try. With Mac OS X running, it was time to build an alternate version that went beyond the 80s and 90s classic Mac apps I had collected. I had my favorites, but I also put out a call for suggestions and got plenty of ideas.

For actually building the disk image, I extended the automated approach that I first launched the site with. Disk images were even more popular in the early days of Mac OS X than they are today, so I added a way to import .dmgs as additional folders in the generated image. However, I quickly discovered that despite having the same extension, there are many variants, and the hdiutil that ships with modern macOS cannot always mount images generated more than 20 years ago. In the end I ended up with a Rube Goldberg approach that first extracts the raw partition via dmg2img and then recreates a “modern” disk image that can be mounted and copied from.

As for getting the actual software, the usual sites like Macintosh Garden do have some from that era, but it’s not a priority for them. Early to mid 2000s Mac OS X software appears to be a bit of a blind spot – it’s too new to be truly “retro”, but too old to still be available from the original vendor (though there are exceptions). I ended up using the Wayback Machine a lot. As a bonus, I also installed the companion “Developer” CDs for each Mac OS X version, so tools like Project Builder and Interface Builder are also accessible.

Mac OS X 10.4 running Delicious Library, CandyBar, PCalc and Pixelmator

The only limitation that I ran into is that my disk build process is centered around HFS, but HFS+ was the default of that time period, and it introduced more advanced capabilities like longer file names containing arbitrary Unicode characters. Files from disk images that rely HFS+ features do not translate losslessly, but luckily this was not an issue for most software. To actually mount multiple drives (up to 3, between the boot disk, Infinite HD, and Saved HD), I ended up borrowing a clever solution from a DingusPPC fork: a multi-partition disk image is created on the fly from an arbitrary number of partition images that are specified at startup.

Aqua

To make the addition of Mac OS X to Infinite Mac complete, I also wanted to have an Aqua mode for the site’s controls, joining the classic, Platinum, and NeXT appearances. That prompted the question: which Aqua?

Screenshots of the logout dialog in Mac OS X 10.1 to 10.4
Aqua: the early years

Though the more subdued versions from 10.3 and 10.4 are my favorites, I decided to go with the 10.0/10.1 one since it has the biggest nostalgia factor. I wanted to use the exact same image assets as the OS, and since they make heavy use of semi-transparency, regular screenshots were not going to be good enough. I used resource_dasm and pxm2tga to extract the original assets from Extras.rsrc and create my own version of Aqua:

Infinite Mac custom instance configuration dialog, rendered with an Aqua appearance

If the recent rumors of a big UI revamp do come true, it’ll be nice to have this reference point of its ancestor.

Odds and Ends

The ability to mount multiple images means that you can also have a Mac OS 9 partition and start the Classic compatibility environment (this only works under 10.1 – PearPC never supported Classic). You can thus emulate classic Mac apps inside an emulated Mac OS X inside a WebAssembly virtual machine:

Mac OS X 10.1 running Stickies, Scrapbook and Calculator under Classic

There was a recent storm in a teacup about a Calculator behavior change. Using these Mac OS X images, it’s possible to verify that versions through 10.3 didn’t have the “repeatedly press equals” behavior, but 10.4 did.

Since Mac OS X boot is rather slow, I wanted to have a way to show more progress. PearPC has a built-in way to trigger verbose mode, but DingusPPC did not, so I added a way to specify Open Firmware variables at startup. This is now exposed in the custom instance dialog via the “Debug Mode” switch.

Though I’ve moved away from custom domain names, I thought macosx.app would make a nice addition to my collection. Unfortunately it’s taken, though in a rather weird way. I even contacted the YouTuber whose video it redirects to, and he said he was not the one that registered it. It expires in a couple of months, so maybe I’ll be able to grab it.

The End Of The Line?

“When Alexander saw the breadth of his domain, he wept for there were no more worlds to conquer.”
— Hans Gruber Plutarch Some Frenchman

Mac OS X support catches Infinite Mac up to the modern day, unless I happen to get access to some time travel mechanics. There are of course two more CPU transitions to go through and numerous small changes, but Tiger is fundamentally recognizable to any current-day macOS user.

Except that in the retrocomputing world, it’s always possible to go deeper or more obscure. A/UX is not something that I’m very familiar with, but it was a contemporary of classic Mac OS and would be interesting to compare to NeXTStep. Shoebill runs it, and the codebase looks approachable enough to port. Then there’s Lisa, the Pippin (DingusPPC has some nascent support), and further afield the Newton (via Einstein?). We’ll see what moves me next.

A Post-Credits Sequence

When I first began exploring ways of running Mac OS X, I mentioned that QEMU seemed too daunting to port to WebAssembly given my limited time. Furthermore, the performance of the qemu.js experiment from a few years ago made it seem like even if it did run, it would be much too slow to be usable. However, I recently became aware of qemu-wasm via this FOSDEM presentation. The performance of its Linux guest demos is encouraging: I ran an impromptu bennmark of computing an MD5 checksum of 100 MB of data and it completed it in 8 seconds (vs. 13 for DingusPPC and 18 for PearPC). There’s still a big gap between that and a graphical guest like Mac OS X, but it’s nice to have this existence proof.

Update: See also the discussion on Hacker News.

Infinite Mac: Macintosh Garden Library #

The Macintosh Garden is a great resource in the retro Mac community. It has an archive of nearly every piece of software released in the 80s and 90s, complete with screenshots, manuals, and metadata like year of release and operating system requirements. From its debut Infinite Mac would let you use files from the Garden: download it to your computer, and then drag it in to have it appear in the “Downloads” folder.  But while doable, it’s not the same as being discoverable or pleasant to use if you wanted to do this more than a few times. 

Inspired by the CD-ROM library feature, I decided to investigate what it would take to add a “Macintosh Garden” drawer to the site. The goal was to allow any item in the Garden’s catalog to be loaded into the emulated Mac with one click (at least for the versions that support “The Outside World”, which is most from System 7 to Mac OS 9). I reached out to the Garden’s maintainer, who was on board with the project and even provided a JSON dump of the site’s catalog of 20,000 applications and games. Building the UI was a fun exercise in making the CD-ROM drawer into a reusable component - another contribution to my collection of Classic- and Platinum-themed UI controls.

In keeping with the secondary goal of Infinite Mac bringing the best of web technologies to retro-computing, I wanted the Macintosh Garden drawer to be as fast as possible. The entire catalog was 86 megabytes of JSON, which would take a while to load, even with gzip compression (27 MB). I decided to create a custom data format, with only a small index file being necessary to render the drawer list view and support search-as-you-type. It contains plain JavaScript arrays with known indices for the title, author, and other data. This approach (inspired by the JsPbLite format) minimizes redundancy while keeping decoding simple. The file is 1.5 MB, and only 439 KB when compressed with gzip, which - combined with preloading - makes the drawer pretty snappy.

A separate “details” file with descriptions, download URLs, and other information is loaded by the Cloudflare worker, which serves pieces of it on-demand. The worker also handles proxying of downloads from the Garden, both to avoid running into CORS issues and because Cloudflare’s caching should help with frequently-used items. For downloads that are large CD-ROM images, the HTTP range-based streaming approach from the CD-ROM library is also used to help with performance.

The search UI supports operators, which were implemented by a simple predicate function run as part of a linear search (the data set is small enough that fancier indexing is not required). As a small UI touch, I finally got to use scroll snap for something (the carousel view for screenshots). I also added support for triggering downloads of an item via a URL parameter, so it’s possible to share links to a favorite item.

In terms of other Infinite Mac-related work, it’s been relatively quiet. I have been tracking DingusPPC development, and it’s now possible to (sometimes, very slowly) boot Mac OS X 10.2. I also made some small quality-of-life improvements: more control over scaling, it’s harder to accidentally close the site via Command-W, and era-appropriate fonts are now used.

Infinite Mac: Turning To The Dark Side #

tl;dr: No, not Windows¹, but I’ve decided to expand Infinite Mac to the the black hardware that Mac users secretly lusted after in the 80s and 90s: NeXT.  There is now a runnable collection of all notable NeXTStep versions, going from the initial 0.8 preview in 1988 to the final OPENSTEP 4.2 release in 1997.

NeXTSTEP 3.3 running DOOM, DoomEd and WorldWideWeb

Porting Previous

About a year ago I came across the Previous emulator – it appeared to be a faithful simulation of the NeXT hardware and thus capable of running NeXTStep. While including it in Infinite Mac would be scope-creep, NeXT’s legacy is in many ways more relevant to today’s macOS than classic Mac OS. It also helped that it’s under active development by its original creator (see the epic thread in the NeXT Computers forums), and thus a modern, living codebase².

Previous is the fifth emulator that I’ve ported to WebAssembly/Emscripten and the Infinite Mac runtime, and it’s gotten easier. As I'm doing this work, I’m developing more and more empathy for those doing Mac game ports – some things are really easy and others become yak shaves due to the unintended consequences of choices made by the original developers. Previous is available on multiple platforms and has good abstractions, so overall it was a pretty pleasant experience.

The main challenge was the pervasive use of the SDL library – I don’t want any of it as a platform abstraction, since I have my own. I chose to replace the entry-point and several subsystems to avoid bringing in too much SDL code. Even with that, I still needed to have some stub files for dependencies that I couldn’t omit altogether. On the other hand, it was a pleasant surprise that adding sound support was trivial — the APIs that it needed mapped 1:1 with the ones I’d already exposed from the Infinite Mac runtime.

With the initial emulator being brought up, there were some more fun tasks, like adding a NeXT-style monitor frame and a NeXT appearance to the Infinite Mac controls (working on them is giving me Kaleidoscope scheme flashbacks).

Infinite Mac custom instance configuration dialog, rendered with a NeXTStep appearance

Once I had Previous running I did some profiling and was discovered the same excessive wasm-to-js/js-to-wasm ping-ponging that I noticed in DingusPPC – it also uses setjmp/longjmp to implement an exception handling mechanism for the MMU. The fix was also very similar: intentionally add an extra wrapping function that contains the CPU emulation loop.

The performance impact of the fix was not as noticeable because Previous tries to accurately simulate the performance characteristics of the original hardware (this is also why boot times are much longer). In fact, I had originally missed the speed checking that the native main loop does, and the emulator was running too fast, leading to timing-dependent things like double-clicking not working.

Speaking of mouse input, Previous uses relative mouse input — it accurately simulates real hardware so all it can do is behave as though a physical mouse is moving and generating updates. This was the case with DingusPPC too, and while the Pointer Lock API makes this work reasonably well on desktop browsers, it’s not a good fit for the mobile web. To make input more accessible on touch-enabled devices, I added a virtual trackpad mode that turns swipes and taps on the screen into mouse movements and clicks. This also helps with double-clicking and making pre-Mac OS 8.0 pull-down menus more usable, though it is somewhat finicky to trigger the drag-lock gesture (I now see why it’s so hard for other touchpad vendors to replicate all of Apple’s gestures).

As part of doing some of the integration work I became aware of just how much of a minority player NeXT was in the 80s and 90s computing world (even more so than Macs). For example, they had their text encoding/character set, and while Python (and other systems) have native support for the contemporary MacRoman encoding, I had to add my own to handle NeXT’s. Similarly, there is a convenient Python library for dealing with HFS disk images, but I could not find any for the UFS variant that NeXT used³.

The disk images with NeXTStep installs are quite large (hundreds of megabytes per version), and the Workers KV-based storage that I had been using was becoming increasingly ill-suited for them (and expensive). As part of this project I also switched to Cloudflare R2 (their S3-like object storage system). On one hand I’m not thrilled with the site becoming dependent on additional services, but on the other I do want to keep costs down. Luckily the dependency is not invasive — it would be trivial to store the disk chunks anywhere else (or to keep storing them as static files, the way I do in the local dev server).

Exploring NeXTStep

Although I was familiar with NeXTStep at a theoretical level and had spent a few hours using a slab in the mid 1990s, this was my first time using it in-depth. My first observation was that having it side-by-side with the contemporary Mac system software makes it even more apparent how much of an advance it was.

Notable OS releases of 1988: System 6.0 and NeXTStep 0.8
System 6.0 and NeXTStep 0.8: two very different releases from 1988

As I was preparing the system images with the various NeXTStep/NexTSTEP/OPENSTEP releases⁴, it was fascinating to see NeXT’s various strategy shifts over the years represented in the canned email from Steve Jobs that was present in the Mail app:
Steve Jobs email from NeXTStep 2.0 Steve Jobs email from NeXTStep 3.0 Steve Jobs email from NeXTSTEP 3.3
Strategy du jour: productivity (NeXTStep 2.0), multimedia and internationalization (NeXTStep 3.0), object-oriented development (NeXTSTEP 3.3)

I was also amused to notice a parallel with the early Mac system releases: the initial release is hard to find in pristine form (a copy of System 0.97 was only tracked down late last year). In both cases it’s it because of the very small number of copies produced, and because they shipped on read/write media (floppy disks for the Mac, magneto-optical disks in NeXT’s case), and thus ended up being used for personal storage too. For NeXTStep 0.8 the archive of images that forum member mikeboss created was the best source that I could find, though I’m happy to switch things over if a better one turns up.

As part of installing all of the OS versions I discovered that starting with NeXTStep 3.0 there is support for the HFS file system used by contemporary Macs. This means the Saved HD drive that has persistent storage also ends up working here. It can even be used as a virtual sneakernet to move data between NeXT and Mac installations on Infinite Mac (which means that it’s possible to get data in and out of the machines via Macs which have “The Outside World“ drive).

To make the systems more than a quick curiosity, I also created a NeXT version of the “Infinite HD” drive with pre-installed software. I had read stories about Doom and WorldWideWeb being developed on NeXTStep, and it was nice to make them accessible. I also added a NeXT version of the CD-ROM library feature, with one-click access to disks that have been preserved at the Internet Archive.

NeXT CD-ROM Library on Infinite Mac

As part of finding more NeXT software to try out, I came across Daydream, which allows Mac software to run on black hardware. It’s technically not an emulator, instead it takes advantage of the fact that NeXT and Macs both used the Motorola 68K CPUs. It effectively turns your NeXT machine into a Mac that you dual-boot via the help of an adapter kernel. The original version needed a hardware dongle with genuine Mac ROMs, but a few years ago the NeXT Computers forum resurrected it such that it can run entirely via software. It’s this variant (known as Darkmatter) that is included on Infinite HD. In some ways this justifies the whole Previous side-quest — it’s just a more convoluted way to run the same classic Mac software as the rest of the Infinite Mac emulators.

Darkmatter running System 7.1 emulated on NeXT hardware emulated in Previous in a browser

Things happen

Christopher Nolan (sort of) knows about Infinite Mac. I did a minor site redesign. After recalling the KanjiTalk New Year’s Day easter egg, I added custom date/time support so can you see it anytime you want. Infinite Mac is being used as a tool to make Playdate game art and other toys. You can now load files with resource forks straight from the macOS Finder. Apeiron now works. And most excitingly, DingusPPC has progressed to point where the Mac OS X 10.2 installer starts up.

Update: See also the discussion on Hacker News.

  1. Also, PCjs already has the Windows niche well-covered
  2. andreas_g is the Previous author, and he was very helpful in the thread I started about my porting work
  3. I did take a stab at writing a HexFiend template for UFS/NeXT partition maps
  4. See these pages for details on the capitalization rules.