Classic II ROMDisk


Classic II Background

The Macintosh Classic II has a number of different configurations for ROM expansion. There is a ROM/FPU expansion connector on the motherboard, which can accept either 2 or 3MB of ROM depending on the state of a jumper on the logic board. The jumper changes the ROM configuration between two different mappings. One allows 2MB of onboard ROM and 2MB of ROM in the expansion slot. The other allows 1MB of onboard ROM and 3MB of ROM in the expansion slot. The stock Classic II ROM image is 512KB, so even the 1/3 split is more than enough for the system ROM. The default configuration (and no jumper installed) is the 1/3 split.

In addition to those configurations, the Classic II logic board comes in 2 configurations: One with four 8bit wide PROM chips, and one with two 16bit wide PROM chips.

Address Space Mappings

The onboard ROM always starts at address $40a00000. The mapping of the ROM/FPU expansion slot is not exactly obvious. Address $0 of the expansion slot maps to $40c00000 of the address space, and continues for 2MB. This allows $0 to always be located at the same spot regardless of the 2/2 or 1/3 split. The 1MB located at $40b00000 is what changes based on the 2/2 or 1/3 configuration jumper. If in the 1/3 configuration, then $40b00000 is occupied by the highest 1MB of the ROM/FPU expansion slot. So the expansion slot's ROM is not mapped contiguously into the Mac's address space.

Using the ROM space

From the perspective of Mac OS (and ROM), there is nothing special about the $40b00000-$40dfffff address range. It is not probed by the SlotManager in the stock Classic II ROM, so no Declaration ROM located in this space will be loaded. Essentially nothing is done automatically with this address space by the ROM, and there isn't a way to automatically load code from it.

Additionally, the Classic II ROM lacks the eDisk driver that most other Macs of that era had, including the Classic. The eDisk driver provides RAM Disk functionality for most machines, but it can also provide ROM Disk functionality as well. The eDisk driver was initially introduced in the Portable, and was intended to be used by 3rd parties with the Portable's ROM expansion slot. I'm not aware of any 3rd party products actually utilizing this functionality. The Classic's ROM boot functionality is provided by the eDisk driver as well. Unfortunately, since the Classic II's ROM lacks this driver, again there's no stock way to make use of the ROM/FPU slot.

Expansion Board

360alaska of 68kmla has produced a ROM/FPU expansion board with both an FPU socket and a ROM socket. The ROM socket is capable of supporting either a 27c322 (4MiB) or 27c166 (2MiB) EPROM. If a 27c166 is used, the 2MB are mapped into the Mac's address space at $40c00000, and if a 27c322 is used, the EPROM's 4MB is mapped non-contiguously as described above. The first 2MB of the 27c322 are located at $40c00000, and the last 1MB of the 27c322 is located at $40b00000. This will be important when trying to use the full space of the 27c322.

I was able to get ahold of one of his boards, and he lent me a Classic II logic board, and I (slowly) started working on trying to boot a Classic II from the ROM/FPU expansion board. As described above, there didn't seem to be any way to accomplish this with the stock Classic II ROM, so in addition to the ROM/FPU board, I'd need to replace the stock system ROM.

The 2 ROM version of Classic II can use two 27c400 EPROMs of 100ns or faster (150ns won't work) to replace the system ROMs. The 4 ROM version can use four 27c010's. I did my development with the 2 ROM version because half the number of chips to remove, erase, reprogram, and reinstall seemed like a good thing.

EPROM Programming

Programming the 27c400 and 27c322 chips requires an EPROM programmer that both supports up to 42pin chips, and can handle 16bit wide EPROMs. I normally use a Batronix BX32 Batupo II programmer, but unfortunately it doesn't support either of those two requirements. I ended up getting a GQ-4x4 Programmer with an ADP-019 adapter. The adapter is required for the 42pin and 16bit wide support that's required. I wasn't able to find a programmer that supported these out of the box without an adapter (and could use usb).

The 4 rom version of the board uses 27c010's in the stock configuration, although I ended up using 29F040's instead. They are higher capacity, so just duplicating the image 4 times to fill the space worked fine.

Ultimately, it will probably be helpful to make adapter boards that allow the use of a modern eeprom or flash technology, but for development purposes simpler is better and this is where I started.

Since the 3MB of ROM/FPU slot address space doesn't linearly align with the space of the 27c322, I wrote a simple tool that arranges an image so that it's suitable for programming into a 27c322. c2-arrange-rom.c
Don't forget that the 27c322 is 16bits wide, so you will probably need to byteswap the buffer before programming it (most programming software has this functionality builtin).

The two PROMs on the logic board are interleaved to form the complete ROM image. So in order to go from a full ROM image to images able to be programmed into 27c400's and placed on the logic board, we need to deinterleave them. c2split.c

ROM Changes

Most of the changes I made are the same or similar to what I describe in my 68k Mac ROM Boot Disk page. The specific changes I made to the Classic II ROM are:
Disable checksum:
000464e0 00 01 4d fa 00 06 4e 71 4e 71 4e 71 4e 71 4e 71

Special case the ROM disk similar to the Floppy drive, to always boot it if the keys are down. There's a slight change here to match the driver reference number of the .ATBOOT driver instead of the .netBOOT driver. More on that with the next change.
00001700 0c 6a ff fb 00 08 67 06 0c 6a ff cd 00 08 4e 75

When BMOW modified the ROMDisk driver, it became bigger than the .netBOOT driver. So instead, he started placing the driver in the space occupied by the .ATBOOT driver (also disabled by default). Normally, the .ATBOOT driver is loaded by the .netBOOT driver if needed, since technically the .netBOOT driver could work with almost any protocol if the driver existed, and the .ATBOOT driver is just the one for AppleTalk (well, localtalk only in this case). Since the .netBOOT driver can never be used in the default ROM, the .ATBOOT driver would never be loaded. So, we need to tell the ROM to load the .ATBOOT driver. Strictly speaking, we could continue to use the .netBOOT driver here, since the driver I'm using is small enough to fit, it seems prudent to make the change so if a different ROM Disk driver is used in the future, all that's necessary is splatting it in place on this already modified image.
00001270 21 49 00 12 a0 00 4e 75 07 2e 41 54 42 4f 4f 54

And like the .netBOOT driver as described in my original mac rom boot page, the .ATBOOT driver has a flag marking it as disabled, which needs changing:
00052530 78 00 00 00 00 00 00 00 00 05 1d 40 00 05 25 60

Finally, the driver needs to be installed at the location of the .ATBOOT driver, which is $00052560 or 337248 decimal.

The code above is hexdump -C output of the change, so it's listing offset from the beginning of the file, followed by 16 bytes in hex.

Using the Expansion Board without modifying System ROM

If you'd prefer to keep the system ROM stock, the expansion board can still be used, it just needs a driver to be installed. I've made a minimal version of the ROM disk driver that gets loaded as an INIT at boot time, so it can be installed in a System Folder, and it'll mount your ROM Disk on the desktop even if you're not booting from it: ClassicII ROMDisk.hqx

Disk Image

The disk image used is the same as the one used in my other ROM Disk drivers. The image is the same as one used by minivmac and basiliskii. It has no header and is just a plain image. Here is some information about creating a custom image, originally geared towards the ROM SIMM Driver, but the process is the same, just with a 3MB image.

Files

The modified system ROM: classic2-romdrv0.9.6-nosum.bin
Source to the driver: romdrv0.9.6c2.sit.hqx
System ROM splitting tool for 2 and 4 ROM versions: c2split.c
ROM Disk rearranging tool for 27c322: c2-arrange-rom.c
Sample 3MB disk image: 3mb-classic2.dsk

Updated September 2 2016