A computing fanatic unearthed a 34-year-old Apple Mac bug that ought to have crippled the system at startup, but it surely by no means did, because of an undocumented function within the Motorola CPU that quietly neutralized the flaw. Downtown Doug Brown found this Mac Classic II ROM code wrinkle after witnessing a MAME-emulated system crash (in 32-bit mode) that the unique {hardware} wouldn’t (h/t PC Gamer). We are likely to agree that “this bug in the ROM would have gone undiscovered for all eternity” if it weren’t for Brown’s curiosity being piqued.
Brown, who self identifies as “a combined Apple/Linux/Windows geek,” and is a giant fan of the open supply MAME (the Multiple Arcade Machine Emulator) venture. He additionally tells his readers that this software program is “arguably the most complete emulator of 68000-based Mac models,” and that these basic Motorola CPU-based programs are his major use of the emulator. That’s fairly uncommon, as MAME is most well-known for facilitating basic arcade gaming enjoyable.
MAc Machine Emulator
The story goes that Brown was indulging in his Mac emulation on MAME hobby when he noticed that an emulated Classic II wouldn’t boot with 32-bit addressing enabled. However, it worked with 24-bit addressing – no ‘sad Mac’ with the 24-bit option toggled on… What was happening? And why was the emulated Mac crashing so badly, so quickly, when the original faced no such issues?
Well, there are plenty of ways bugs can crop up in an emulator, but in this instance, it would have been wrong to blame MAME or any of the code it relies on.
An undocumented MC68030 instruction
After reverse engineering the Apple ROM, and extensive forensic debugging of the errant behavior of the emulated machine, Brown actually found that the bug was present in the Mac Classic II ROM code – nothing to do with the emulation software. The biggest difference between emulated and original systems was how the CPU handled the problematic instruction in the ROM. In the emulated system, it crashed with a ‘sad Mac’ in 32-bit mode. In the real hardware 68030-equipped system, it skipped the wrinkle nonchalantly. However, no documented feature of the 68030 explained this (lucky) operational quirk.
Brown concludes his lengthy and intricately detailed blog post by asserting that Apple devs would surely have found and fixed the 32-bit crash boot issue “if the pesky 68030 hadn’t been hiding the bug.” The computing enthusiast also cleverly characterized this secret 68030 feature as “the glue that’s accidentally holding the Classic II together.”
He was also sympathetic to the Apple ROM developers who let this bug out into the wild, as the Motorola CPU quietly fixed it in the background.
A final important point raised by Brown was that, with this undocumented bug in mind, “it’s very likely that there is not a 100% perfect Motorola MC68030 emulator or replica in existence.”
There is a small probability that an engineer who labored on this Motorola CPU would possibly learn this and attain out with details about the undocumented 68030 function that, fortunately, involves the rescue throughout the Classic II’s boot course of. Brown additionally contemplated whether or not many different 68030-powered machines had their software program quietly bug-fixed by the intelligent options of this processor.
Follow Tom’s Hardware on Google News, or add us as a preferred source, to get our newest information, evaluation, & critiques in your feeds.