Lobsters retrocomputing - 25 Oct 2026

Page 2 of 2

In the prior article we solved this issue using Boot Variables, a utility originally written by Paul Mackerras (now at IBM) which allows you to directly manipulate Open Firmware variables and save them. Because the changes to NVRAM occur before the boot process reaches the Finder, once we get to the Finder we can then fix everything and remain confident it will stay unmolested until the next boot. This process works but obviously requires manual intervention, so since Boot Variables is open source under the GNU Public License, I decided I'd just hack in a hard-coded version which automatically undoes the munge when run. I converted it to build under CodeWarrior Pro 7 which is my preferred environment for classic Mac work, and rigged it so that it would display a quick window to show you it was working, do its work, and then terminate back to the Finder. When placed in the Startup Items folder, it will do this job every boot automatically, or can be run on demand. If the input device and output device are both ttya, it resets them back to the default kbd (ADB keyboard) and screen (onboard 54M30 video), and installs an nvramrc of its own. The critical code looks like this, using a library function I transplated to do the NVRAM patching in place:

patchstr(21, "kbd");

patchstr(22, "screen");

nvvals[7].word_val = 1; // belt and suspenders approach

patchstr(25,

"0 to my-self\015"

"dev /bandit/gc/mace\015"

"1 encode-int \" PLSCCPort\" property\015"

"device-end\015"

"?cr \" Pre-production patches on.\" type\015"

);

The numbers are fixed indexes into NVRAM since this is just a hack, but in order are input-device, output-device, use-nvramrc? and nvramrc itself. This simple nvramrc patches up the Ethernet to work correctly with the Mac OS Apple Enet INIT. Prior Macintoshes with Ethernet, including first generation NuBus Power Macs like the Workgroup Server 9150, had a single Ethernet AAUI port, but AAUI was expensive and unpopular and as the industry moved to twisted-pair Apple offered both an 8P8C ("RJ-45") and AAUI port starting with the 9500 - but still using just the single MACE, so only one port was active at a time. For as yet unexplained reasons, the ANS went back to a single AAUI port with no 8P8C/"RJ-45" despite being an evolution of the same platform base.

This means the MACE is connected directly to the (A)AUI port in the ANS, whereas in machines like the 7300, 7500, 8600, 9500, etc., it switches between the AAUI (equivalent to AUI) or an internal MAU to provide the link over twisted-pair. The MACE embedded in CURIO has a register called PLSCC, or the Physical Layer Signaling Configuration Control, which determines which network port is active. In dual-ported machines, the PLSCC value should be 7 (which includes the $01 enable bit), which corresponds to the "General Purpose Serial Interface" to the circuitry where the signal is routed. In the ANS, however, this value should be 1, which specifies a direct AUI connection.

The ANS Mac OS ROM internally and explicitly specifies a property PLSCCPort on /bandit/gc/mace with that value of 1. @joevt gets credit here (a) for discovering that the Apple Enet INIT looks for and if specified uses this property as an override, relying on a platform default if not, and (b) for the magic incantation required to make this property stick when placed in the nvramrc. Since the ANS looks like a Power Mac 9500 to Mac OS, this value must be provided before Apple Enet runs, so since it's not in the 1.1.20.1 ROM we'll provide it ourselves in Open Firmware before the operating system even starts.

This scheme works and solves both the reboot-shutdown and Ethernet problems simultaneously. But what about bringing the system up from a cold start, where this property won't yet have been set? Well, we have a solution for that too!

The Mac OS NameRegistryLib allows us to directly manipulate the Name Registry (which will necessarily have a copy of our Open Firmware properties), so we can also get this property installed during boot as long as we do so before the Apple Enet INIT opens. We could do this with an ndrv, but we have a simpler and more conventional way which I talked about in this blog before with ways to expand virtual Mac device support in QEMU. kanjitalk755's tablet INIT installs a handler for USB HID devices during startup which allows QEMU absolute pointer positioning to work with its synthesized virtual USB tablet.

In this INIT, a block of 68K code (remember, the normal state of the Power Macintosh nanokernel is to run 68K code in the emulator) invoked at load time displays the icon and uses the Code Fragment Manager to pull a single non-static PowerPC function from the "PPC " resource (yes, P P C and a trailing space), set up a Universal Procedure Pointer to it as PowerPC native code, and run it. This code fragment is what installs the HID report handler.

Because this extension is so modular in design, we can just gut it and replace the PPC resource with our own code (yes, PowerPC code can run from resources, not just from the data fork), though I also manually patched the 68K section with a couple NOP instructions to not bother displaying the icon since we don't really need to. This is the entirety of the PowerPC code:

#include <MacErrors.h>

#include <NameRegistry.h>

// MACE Fixer for Shiner ROM 1.1.20.1

// (C)2026 Cameron Kaiser, all rights reserved

// MIT license

// oldvcr.blogspot.com

#define AIX "Devices:device-tree:packages:aix-boot"

#define MACE "Devices:device-tree:bandit:gc:mace"

#define PLSCCPORT "PLSCCPort"

// Any other function must be declared static!

void main(void) {

OSErr err;

RegEntryID regEntryID;

// Ensure this is an ANS ROM that can boot AIX (2.0 doesn't, but doesn't need this)

err = RegistryCStrEntryLookup(NULL, AIX, (R)EntryID);

if (err != noErr) {

return;

}

// Find MACE and set the PLSCCPort property on it if not already done.

err = RegistryCStrEntryLookup(NULL, MACE, (R)EntryID);

if (err == noErr) {

RegPropertyValueSize s;

err = RegistryPropertyGetSize((R)EntryID, PLSCCPORT, &s);

if (err == nrNotFoundErr) { /* may not be found if nvram patches not on */

UInt32 port = 1;

err = RegistryPropertyCreate((R)EntryID, PLSCCPORT, &port, sizeof(UInt32));

}

}

}

Notice the device tree paths for the two devices we're interested in, Devices:device-tree:packages:aix-boot (or, as an Open Firmware path, /packages/aix-boot) and Devices:device-tree:bandit:gc:mace (/bandit/gc/mace). We don't need to know anything else about what these nodes are or how they're connected to query and modify them. The first step this function takes is to see if this is an AIX-capable ROM by checking for the AIX booter package as a Name Registry node, and if this package isn't present, such as a regular Power Mac or the ANS Mac OS ROM, then we exit. The second step is to see if the PLSCCPort property already exists; if it does, such as being set from our nvramrc, we exit also, or otherwise set the proper value of 1.

Since the whole scheme can only work if our extension runs first, we give it the special file type of scri instead of INIT, which is notionally a WorldScript extension but can be used to load any sort of extension, because WorldScript extensions load before all other INITs (Apple Enet is an INIT). Failing that, the name of the extension (ANS MACE Fixer) is intentionally chosen to lexically sort above Apple Enet so that it will also run first. The upshot is that the property will be set one way or another before the Ethernet INIT runs, and with this extension installed, now the only circumstance where our Ethernet won't work would be on the very first boot after a PRAM zap with extensions off - which would obviously be an uncommon situation.

It is also important to ensure that main() is the only non-static function in the code fragment because of the way the 68K code finds, declares and calls it (see the prior article for why). CodeWarrior's project settings can be set to build this file as a resource and after doing so we manually merge everything together in ResEdit for the final extension.

As our last stop before the installation instructions, let me also talk a little bit about something not in this version of the extensions pack.

The NCR 53C825 Fast'n'Wide SCSI-2 controller also has its own ndrv in the ANS Mac OS ROM. Indeed, it must, or else the internal SCSI wouldn't be bootable with that ROM (the production and pre-production ROMs have their own support and hand everything over to AIX after boot). It is possible to extract this ndrv and wrap it as an extension in the same way. It won't be bootable, of course, but in theory this should allow devices on the internal SCSI to be used once Mac OS has booted from the external SCSI. Go ahead and try it. It doesn't work. The machine will boot, but no devices are visible from the internal SCSI drive bays. Apple PCI DDK 3.0 also includes a utility (Load Driver Test) where you can test the structure of an ndrv to see if it's valid (useful for hardware builders before they spend a lot of money burning defective ROMs). This utility basically checks if the ndrv can be loaded as a code fragment, and if it can, that it has a sensible driver description block, and shows the device node it's looking for and the driver name it installs.

We can immediately see from this that the node name is wrong. In the ANS Mac OS 2.0 ROM, the 53C825 nodes in the Name Registry are named apple53C8xx, not 53c825 as they are in the pre-production ROM. Triumphantly I changed the string and length byte to make the matched name 53c825. It still didn't work.

The PCI DDK has an additional tool (PCIPeek) which allows you to mess around with PCI-based devices. When we ask it for the PCI configuration space for one of the 53C825s using the node name 53c825, we can pull it up and see all 64 bytes are valid. Though the compatible name doesn't fetch, this does at least prove that the issue isn't the logic board and the node name is correct. The next step was to look at the driver description in the hex editor. This is again another trivially compressed PEF. Like any well-behaved SCSI driver, it implements a fully-specified SIM (SCSI Interface Module), which, according to the SCSI Common Access Method (CAM), is the link between the 53C825 host bus adapter (HBA) and the transport (XPT) layer that in turn hooks into the SCSI drivers used by the operating system. You should be able to see the device node name and the Macintosh driver name, but the byte before the Pascal string for the Mac driver name here is $04. Unlike video ndrvs, the documentation states SCSI ndrvs should only have a single bit set in that byte, in this case specifying that the family expert handles loading the driver (kDriverIsUnderExpertControl, $04).

Since that didn't load nor open the driver, I tried setting various bit combinations of forcing it to load upon discovery and/or open upon load, all of which ended up hanging the ANS doing boot. Remember how I said that SHIFT doesn't stop ndrvs from loading? Each of these permutations thus ended up making the external SCSI volume unbootable until the poison ndrv was removed. I had to connect it to the WallStreet PowerBook G3 (it was handy) to get it out, though as a check I had the Wally boot from the same volume just to see what it would do - and it booted fine. The driver doesn't load on the Wally almost certainly because the device name doesn't match anything, which also implies the hang is specific to trying to bring up the device on the ANS or we'd hang on the Wally too.

This leaves us at the mercy of the family expert, so the next thing I tried was various combinations of service category and type. By default this is ndrvgenr, so I tried ndrvscsi, ndrvblok, blokgenr, blokscsi, scsigenr, scsiblok, scsiscsi, blokblok and finally an intemperate combination inappropriate for a family blog, and while none of these locked up the 700, none of them made any difference either.

After all that I'm not sure this approach would have worked for getting the internal SCSI bus working anyway, at least not without additional code. Apple's PCI documentation says, "The SCSI expert is simpler than some other experts" and while it mentions the situation of a "PCI card that wants to register a SIM with the SCSI Manager" which necessarily covers the situation of one in ROM, it says nothing about disk-based drivers. It's possible the SCSI expert just doesn't handle this situation because a non-bootable SCSI bus is certainly less useful, and while we could write up an INIT to try loading the SIM manually, I'm still pondering how this would work and I have yet to find a working disk-based driver for a 53C825-based card that I could hack as an alternative (suggestions solicited in the comments). The PCI DDK 3.0 notably includes a "driver" for this chipset, but only to let you mess around with the hardware - it's intentionally not structured as a SIM, so it wouldn't be an effective foundation.

But you can still try the other pieces, so let's pick up with the install instructions now that you have the prerequisites.

If you were working with a pre-built Mac OS disk image, using the system you used to build it put the ANS MACE Fixer and ANS Video Enabler into the Extensions folder, and the ANS Startup Fixer into the Startup Items folder. If you are doing the install on the ANS itself, simply have the CD disk image ready to go on your external device (or connect a real physical external SCSI CD-ROM).

Assuming you didn't tl;dr this article, your depowered logic board should now be fully reset. Close the drawer and lock the rear key and plug the server back in, then plug in ADB and your SCSI device. Remove all hard drives from the front; you can't boot MacOS from them anyway, and it will simply confuse Open Firmware. The CD-ROM and any tape drives may remain, though do note they currently won't work either. Connect your display to the on-board VGA port, not to any PCI video card, and finally power on the system. If you are using one of Jeff's current replica ROMs, you may need to hit Control-Command-Reset after powering up to get the bong (this is an electrical issue we're sorting out). From a cold start with no bootable AIX volume, the 1.1.20.1 ROM will automatically bomb into Open Firmware, showing you the prompt here. If you don't see this screen, make sure your monitor is connected to the onboard port.

If you've already prepared your external Mac OS volume and the extensions are in their proper places, just type bye at the Open Firmware ok prompt. You will see the message

/AAPL,ROM

MacOS is currently unsupported, use at your own risk.

while the ROM component looks for your startup disk. Once it finds it, there will be a pause, then the screen will flash and drop into the Mac OS mid-boot. Remember, the Startup Fixer must run once every time Mac OS starts up, or your system will come up with a black screen on the next boot. You can manually fix this by entering Open Firmware with a serial connection to Port 2 (38400bps, 8-N-1) and enter setenv input-device kbd, setenv output-device screen, setenv use-nvramrc? false and reset all, or you can just reset the logic board.

If you are doing an install from an external Mac OS CD-ROM or CD image, move your display to the PCI video card and then blindly type bye. You will get the Mac 50% dithered grey, then a Happy Mac, then the CD should start. Install Mac OS as usual to your previously prepared blank disk image. After the installation completes, if you can, install the extensions (e.g., from a floppy disk or via AppleShare over LocalTalk) and startup item as described above before you shut down. Either way, shut down, power off and reset your logic board again, disable or remove the CD-ROM/image, move the display back to the onboard video port, and power back on to the Open Firmware prompt. If the extensions were installed, just type bye - you're good to go. If you couldn't, move the display to the PCI card again, blindly type bye, bring up Mac OS from your external volume, install the extensions, shut down, power off and reset your logic board one last time, then move the display back to the onboard video port. Now you can boot by just typing bye also.

Things still to do:

- Get the internal SCSI bays working, which may require us to create a modified ROM and put the ndrv there with the proper node name. However, one other possibility is by installing a MacOS-bootable SCSI PCI card. The Shiner logic board has connectors on the logic board that directly feed into the two front SCSI busses (bus 0 controls the top four trays and bus 1 controls the bottom three and the 700's rear two). These connectors were intended for the ANS PCI RAID card, but I don't see why we couldn't just connect a regular controller there as long as we change its SCSI ID to not conflict with the 53C825, which should be possible on Adaptec cards with the PowerDomain Control CDEV. I intend to do some experimentation with that, including finding an optimum card which is Mac-bootable (or flashable to same) and supports full Fast'n'Wide SCSI-2, yet is not supported by AIX so that the regular 53C825 will "just work."

- On a reboot, the ANS may go into its Long RAM Test. This is not only not fatal but is arguably intended behaviour and it will start normally afterwards, though the delay is annoying. On the other hand, even though the ANS Mac OS ROM doesn't do this, it also doesn't properly register the sticks as parity RAM even if they are. I don't know if I can stop the Long RAM Test by tweaking Open Firmware or if it requires a ROM patch, though I suspect it's the latter. In the meantime, you can manually cut it short by hitting Control-Command-Reset.

Hopefully you'll see solutions to one or both of these in a future article. For now, you can get everything on the Github repo, including source code for CodeWarrior Pro 7. Note that this compiler cannot build the 68K portion of the ANS MACE Fixer, but I've included the source for that too, and you don't need to build the 68K segment anyway merely to modify the PowerPC portion. Each portion is under its own license and you should read the brief notes. No AI was used.

Previous page | More Lobsters retrocomputing | Headlines

Original: http://oldvcr.blogspot.com/2026/10/macos-extensions-pack-for-apple-network.html