While this year is a sober one due to current events, I think a lot of people still appreciate what people are creating and sharing to keep spirits up, whether that be music or art or…impractical programming projects. One drawback to MacMESS is that it lacks the ROMs, making it difficultIt’s April 1, and that means it’s both April Fools’ Day and the anniversary of the founding of Apple Inc. This essentially leaves only MacMESS. The former is Classic-only, making it unusable on modern Macs (since Classic does not run on Intel-based Macs, or any Mac running Leopard). There are essentially two Mac emulators for the TI-99/4A: MacV9T9 and MacMESS.OS X Yosemite X Kirby Simulator by honnybean. Mac OS X 10.7 by PigVenomPV. Mac OS X Sierra (10.12.0) by -Apple-Inc. OS X Yosemite Simulator remix by ellistomas. Mac OS X attempts to intercept access.
Classic Emulator For Os X Mac Running LeopardThe plan is to implement System 7 + Color QuickDraw, 68040 instruction set, more hardware emulation, etc. At the moment the project consists of System 6 software implementation, Motorola 68000 emulator and Disassembler, Debugger and Profiler tools. What’s a Mac OS 9?Macintosh.js is a self-contained Electron app that bundles a classic Mac OS emulator preinstalled with Mac OS 8.1 along with a handful of classic applications from that era, including Adobe Photoshop 3.0.5, Adobe Illustrator 5.5, demos for Duke Nukem and Civilization 2, Oregon Trail, and more.I have been working with my friend on a ROM-less Classic Mac emulator. This year I decided to seriously attempt something that I’d thought about in the past: getting a Swift program to run on Mac OS 9. OS X Yosemite Simulator by tycoonjoe.Last year I implemented the world’s best code visualizer. OS X El Capitan Simulator 2 by Jethrochannz. Performance with the current CPU emulator using basic just-in-time (JIT) translation techniques is roughly 1/8-th of native speeds.Mac OS 9 ran on PowerPC processors, which were also used in the GameCube, PS3, and Xbox 360 earlier versions of the OS had started on Motorola’s 68k CPU series. 4 If a program crashed or overwrote memory it wasn’t supposed to, there was a good chance you’d have to restart the whole system.On other systems, SheepShaver provides the first PowerPC G4 emulator, though without MMU, to enable the execution of Mac OS Classic. It also dates from the days when only one program could run at a time because of that, even the latest version uses cooperative multitasking to run multiple programs—that is, a program has to yield its time to let others run. 3 It was one of the first OSs to use a GUI at all, something that we pretty much take for granted these days. Driver for microsoft wireless mouse 3500 for macBut its life ended with the switch to Intel-powered Macs—Classic was built on running the instructions in the original apps directly, only having to provide compatibility shims for libraries. It really was quite effective, and actually survived longer than booting into Mac OS 9 (which never received support for newer PowerPC processors). Because the Classic environment was itself an app, all the programs that ran inside it were protected from interfering with other Mac OS X programs and vice versa. But Apple didn’t want to just leave OS 9 programs behind, so they did two things:The Classic environment set up a sandbox that looked enough like Mac OS 9 to run Classic Mac OS programs directly in Mac OS X. (h/t Marshall Elfstrand for the video link.)Classic ended with the switch to Intel processors back in the 2000s, but Carbon worked all the way up to last year, macOS Mojave. ( Sound familiar? 7) Fun aside: This is the reason (one of the reasons?) Core Foundation exists—to provide a common interface between Carbon and Cocoa. You basically just recompiled your app and added an extra annotation saying you were “Carbonized”. 6Carbon was a packaged-up version of the old Mac OS Toolbox APIs so that you could write Mac OS X apps the same way you always had. I package it up as necessary for Mac OS 9.Is this useful? No! Absolutely not! But neither was ROSE-8, and yet I still learned a lot doing it.As you probably guessed, I managed to accomplish this, or I wouldn’t be writing this blog post. I compile it for PowerPC with (a version of) the Swift compiler. I write Swift source code that calls Carbon / Toolbox APIs. 8 What’s the goal?Since I learned to program on Classic Mac OS, and years later spent a good chunk of my career working on Swift, I’ve had the tantalizing thought that I’d like to write a program in Swift and run it on Mac OS 9. ![]() (Remember, no command line!) I could try to get some version of CodeWarrior running again, but that didn’t seem like the most convenient thing. Actually, calling that “building Classic Mac OS apps” was a stretch I was learning C and using CodeWarrior’s terminal I/O library to get a stdin/stdout interface that Classic Mac OS didn’t have natively. Gathering materialsThe last time I was building Classic Mac OS apps, I was using CodeWarrior. (And note that the SIZE and carb resources are required for any Carbon app, so you can’t just skip the Rez part if you actually want to run your app.)If you just want to try a built version of BitPaint, here’s one: BitPaint-swift.hqx.I’d like to hear about anything you make with these tools! Meanwhile, if you’d like to hear how I made this work, read on. (I did ask him ahead of time if it was okay to use his app for a hobbyist project.) Longtime Mac developer Gwynne Raskind also gave a two-part high-level tour of the Toolbox APIs on Mike Ash’s blog several years ago ( part 1 | part 2) fortunately, Carbon takes care of a fair amount for us even on Mac OS 9. Not only was this the reference I used to get started, but the app you see running in the above picture, BitPaint, is Troughton-Smith’s test app, ported to Swift. And I knew it was going to work, too, because Steve Troughton-Smith, (in)famous in the Apple community for finding undocumented and prerelease features in Apple’s OSs, had written up his experiences building an app with mpw that ran on System 1 all the way up to modern Mac OS X, just by building with the appropriate compiler and against the appropriate libraries.If you’re interested in all this, I highly recommend checking out his blog post. At some point I found about the mpw project: an emulator specifically for running Apple’s Macintosh Programmer’s Workshop tools. I have one, but not the charger for it, and so I did most of my testing using SheepShaver. An actual machine running Mac OS 9. Some stripped-down form of the Swift standard library and runtime (enough to read in and interact with Carbon headers, at least) A modified version of the Swift compiler that supports emitting MPW-compatible object files My idea was to take object files produced by a modern compiler and feed them to the PowerPC linker, which means I’ll additionally need: A bunch of object and binary inspection tools, which we don’t need for the finished product but which I made a lot of use of when trying to debug mystery misbehaviorThat’s pretty good as Troughton-Smith’s blog post shows, it’s enough to build an entire app that’ll run on Classic. It turns out IBM has started adding support for XCOFF to LLVM just last year, as part of adding support for their AIX OS… which runs on PowerPC. The first time I started looking into this project, I was worried I’d have to have my compiler write out assembly code and then send that through the MPW PowerPC assembler…after fixing it up to account for the differences in how LLVM and MPW print PowerPC assembly.However, when I checked to see if LLVM supported XCOFF, I was in for a stroke of luck. Pretty much no one else uses this format, which was not encouraging. It turns out it’s a format called XCOFF searching for modern documentation on this turned up an IBM reference doc. Clang uses the same LLVM infrastructure as the Swift compiler, so I figured I could deal with all the object format and workflow issues in Clang, and then move on to the Swift-specific parts.The first thing I did was try to figure out what the file format was for PowerPC object files. Modern compiler, classic linkerTo make things more manageable, I set an intermediate goal: build an app using Clang, the modern C compiler that ships with Xcode.
0 Comments
Leave a Reply. |
AuthorAdam ArchivesCategories |