• Updated 2023-07-12: Hello, Guest! Welcome back, and be sure to check out this follow-up post about our outage a week or so ago.

unirom: an Old World ROM info dumper

Arbee

Well-known member
This is a small command line utility I've been working on occasionally for as long as I've been emulating Macs in MAME (that's 2009). It dumps out the Universal tables from a ROM so you can see what machines a ROM will recognize and some basic info about each machine. Not all ROMs can actually successfully boot all of the machines they claim support for (I'd be pretty surprised if the PowerMac 6100 ROM can actually boot an LC II or IIsi), but it's a good starting point for further testing.

It's command-line written in C++ even though it probably shouldn't be, and it was throwaway code made to serve a specific purpose for a long time until I had the brainwave to add a tiny amount of polish and let everyone here see.

Disclaimers out of the way, here it is:

As an example, here's the output from running it on the popular-for-hacking IIsi ROM. It doesn't entirely deal properly with the many versions of the Universal info structs over time so some machines show addresses for things they don't have (the IIci shows IOPs, and systems without built-in video show garbage for the frame buffer address).

ROM ID is 36b7fb6c
[info 35c0] Box II decoder 4 (Mac II Glue) VIA mask 40000008 VIA match 00000008 ID 0000
Screen physical fffffe28 logical 32-bit 000003aa logical 24-bit 00000000
ROM @ 40800000 diag ROM @ 58000000 VIA1 @ 50f00000 SCC Read @ 50f04000
SCC Write @ 50f04000 IWM/SWIM @ 50f16000 SCSI @ 50f10000 SCSIDack @ 50f12000 SCSIHsk @ 50f06000
VIA2 @ 50f02000 ASC @ 50f14000

[info 3600] Box IIx decoder 4 (Mac II Glue) VIA mask 40000008 VIA match 00000000 ID 0000
Screen physical fffffde8 logical 32-bit 0000036a logical 24-bit 00000000
ROM @ 40800000 diag ROM @ 58000000 VIA1 @ 50f00000 SCC Read @ 50f04000
SCC Write @ 50f04000 IWM/SWIM @ 50f16000 SCSI @ 50f10000 SCSIDack @ 50f12000 SCSIHsk @ 50f06000
VIA2 @ 50f02000 ASC @ 50f14000

[info 3640] Box SE/30 decoder 4 (Mac II Glue) VIA mask 40000008 VIA match 40000000 ID 0000
Screen physical fffffda8 logical 32-bit 0000032a logical 24-bit 00000000
ROM @ 40800000 diag ROM @ 58000000 VIA1 @ 50f00000 SCC Read @ 50f04000
SCC Write @ 50f04000 IWM/SWIM @ 50f16000 SCSI @ 50f10000 SCSIDack @ 50f12000 SCSIHsk @ 50f06000
VIA2 @ 50f02000 ASC @ 50f14000

[info 3680] Box IIcx decoder 4 (Mac II Glue) VIA mask 40000008 VIA match 40000008 ID 0000
Screen physical fffffd68 logical 32-bit 000002ea logical 24-bit 00000000
ROM @ 40800000 diag ROM @ 58000000 VIA1 @ 50f00000 SCC Read @ 50f04000
SCC Write @ 50f04000 IWM/SWIM @ 50f16000 SCSI @ 50f10000 SCSIDack @ 50f12000 SCSIHsk @ 50f06000
VIA2 @ 50f02000 ASC @ 50f14000

[info 36c0] Box IIci decoder 5 (MDU) VIA mask 56000000 VIA match 46000000 ID 0000
Screen physical 00000000 logical 32-bit fbb08000 logical 24-bit fbb08000
ROM @ 40800000 diag ROM @ 58000000 VIA1 @ 50f00000 SCC Read @ 50f04000
SCC Write @ 50f04000 IWM/SWIM @ 50f16000 SCSI @ 50f10000 SCSIDack @ 50f12000 SCSIHsk @ 50f06000
VIA2 @ 50f02000 ASC @ 50f14000 RBV @ 50f26000 VDAC @ 50f24000 SCSIDMA @ 50f18000
SWIMIOP @ 50f1e020 SCCIOP @ 50f0c020

[info 3700] Box IIci decoder 5 (MDU) VIA mask 56000000 VIA match 56000000 ID 0000
Screen physical 00000000 logical 32-bit fbb08000 logical 24-bit fbb08000
ROM @ 40800000 diag ROM @ 58000000 VIA1 @ 50f00000 SCC Read @ 50f04000
SCC Write @ 50f04000 IWM/SWIM @ 50f16000 SCSI @ 50f10000 SCSIDack @ 50f12000 SCSIHsk @ 50f06000
VIA2 @ 50f02000 ASC @ 50f14000 RBV @ 50f26000 VDAC @ 50f24000 SCSIDMA @ 50f18000
SWIMIOP @ 50f1e020 SCCIOP @ 50f0c020

[info 3800] Box Four Square decoder 5 (MDU) VIA mask 56000000 VIA match 54000000 ID 0000
Screen physical fffffc8c logical 32-bit 0000016a logical 24-bit 00000000
ROM @ 40800000 diag ROM @ 58000000 VIA1 @ 50f00000 SCC Read @ 50f04000
SCC Write @ 50f04000 IWM/SWIM @ 50f16000 SCSI @ 50f10000 SCSIDack @ 50f12000 SCSIHsk @ 50f06000
VIA2 @ 50f02000 ASC @ 50f14000 RBV @ 50f26000 VDAC @ 50f24000 SCSIDMA @ 50f18000
SWIMIOP @ 50f1e020 SCCIOP @ 50f0c020

[info 37c0] Box IIfx decoder 6 (FMC) VIA mask 56000000 VIA match 52000000 ID 0000
Screen physical fffffd70 logical 32-bit 000001aa logical 24-bit 00000000
ROM @ 40800000 diag ROM @ 58000000 VIA1 @ 50f00000 ASC @ 50f10000
SCSIDMA @ 50f08000 SWIMIOP @ 50f12020 SCCIOP @ 50f04020 OSS @ 50f1a000 FMC @ 50f1c000
RPU @ 50f1e000

[info 3740] Box Aurora SE25 decoder 5 (MDU) VIA mask 56000000 VIA match 00000000 ID 0000
Screen physical 00000000 logical 32-bit fbb08000 logical 24-bit fbb08000
ROM @ 40800000 diag ROM @ 58000000 VIA1 @ 50f00000 SCC Read @ 50f04000
SCC Write @ 50f04000 IWM/SWIM @ 50f16000 SCSI @ 50f10000 SCSIDack @ 50f12000 SCSIHsk @ 50f06000
VIA2 @ 50f02000 ASC @ 50f14000 RBV @ 50f26000 VDAC @ 50f24000 SCSIDMA @ 50f18000
SWIMIOP @ 50f1e020 SCCIOP @ 50f0c020

[info 3780] Box Aurora SE16 decoder 5 (MDU) VIA mask 56000000 VIA match 06000000 ID 0000
Screen physical 00000000 logical 32-bit fbb08000 logical 24-bit fbb08000
ROM @ 40800000 diag ROM @ 58000000 VIA1 @ 50f00000 SCC Read @ 50f04000
SCC Write @ 50f04000 IWM/SWIM @ 50f16000 SCSI @ 50f10000 SCSIDack @ 50f12000 SCSIHsk @ 50f06000
VIA2 @ 50f02000 ASC @ 50f14000 RBV @ 50f26000 VDAC @ 50f24000 SCSIDMA @ 50f18000
SWIMIOP @ 50f1e020 SCCIOP @ 50f0c020

[info 3b64] Box IIsi decoder 5 (MDU) VIA mask 56000000 VIA match 16000000 ID 0000
Screen physical 00000000 logical 32-bit fee08000 logical 24-bit fee08000
ROM @ 40800000 diag ROM @ 58000000 VIA1 @ 50f00000 SCC Read @ 50f04000
SCC Write @ 50f04000 IWM/SWIM @ 50f16000 SCSI @ 50f10000 SCSIDack @ 50f12000 SCSIHsk @ 50f06000
VIA2 @ 50f02000 ASC @ 50f14000 RBV @ 50f26000 VDAC @ 50f24000 SCSIDMA @ 50f18000
SWIMIOP @ 50f1e020 SCCIOP @ 50f0c020

[info 3ba4] Box LC decoder 7 (V8/Eagle/Spice) VIA mask 56000000 VIA match 54000000 ID 0000
Screen physical 009e4c00 logical 32-bit 009e4c00 logical 24-bit 009e4c00
ROM @ 00a00000 diag ROM @ 50f80000 VIA1 @ 50f00000 SCC Read @ 50f04000
SCC Write @ 50f04000 IWM/SWIM @ 50f16000 SCSI @ 50f10000 SCSIDack @ 50f12000 SCSIHsk @ 50f06000
ASC @ 50f14000 RBV @ 50f26000 VDAC @ 50f24000
 

dougg3

Well-known member
This is really cool! Thank you for sharing this with the community. Will definitely be useful for examining ROMs.
 

Phipli

Well-known member
Really helpful. I want to run the LC475 and C650 ROMs through it to see if there is crossover. Will do so later :)
 

Phipli

Well-known member
Ran a few ROMs through it. I haven't looked at them yet, but here are...

EC904829 - LCIII (Early) - not sure why, but this doesn't seem to have worked. Suspect not universal?
ECBBC41C - LCIII (Late)
F1A6F343 - 610/650/800 (Early)
F1ACAD13 - 610/650/800 (Late)
FF7439EE - 475/575/605/473
06684214 - 630
064DC91D - 580
 

Attachments

  • VariousROMDecodes.zip
    8.4 KB · Views: 3

Phipli

Well-known member
Oooooooh. Awesome.

The late ROMs, eg. the 580 include stuff back to the Mac IIx. :

IIx
SE/30
IIcx
IIci
IIfx
IIsi
LC
Q700
Q900
Q950
PB 170
PB 180
PB D 210
PB D 230
PB D 270c
LC III
PM 6200!!! This Performa ROM has a PPC in its list of machines (yes, they are related hardware, but interesting still).
PM 5200
Q605
LC520
LC550
LC/P/Q630


And some other stuff that I don't instantly recognise.

@dougg3 @bigmessowires
 

Phipli

Well-known member
So in a way, the LC475 one is quite interesting because it potentially contains the most entries, although not the newest.
 

Phipli

Well-known member
I'd be pretty surprised if the PowerMac 6100 ROM can actually boot an LC II or IIsi
There is actually a chance. The first gen PPC development work was initially done with stock LC ROMs in the "RISC LC" using an 88100 before moving onto other stuff.

The 6100 ROM should be most like the 660av and 840av ROM, as I believe that late in development, the codebase for these was the same, although I image that some compile time flags might have been set differently. It would be interesting to know if a 6100 ROM (common to the 8100 and some 7100s) would boot an 660av. Or the reverse.

Does MAME emulate any first gen Nubus PPCs?
 

Arbee

Well-known member
The utility has to have each ROM's checksum and the offsets to the table(s) hardcoded into it so I probably just missed the one LC III ROM. That's late enough that it's definitely Universal.

We almost emulate the x100 PowerMacs. With most HDD and CD images it will Welcome to Macintosh and then bomb with "Error type 11" at the point where it should redraw the screen and start loading extensions. We found out by chance that the bootable installer floppy from 7.6 will load all the way into the installer and you can interact with it. It's probably a corner case in how we emulate one of the 601 instructions but various automated tests haven't flushed it out. If anyone's a genius about the early boot phase and has any tips on how to debug that coming from the Mac end, let me know.
 

Phipli

Well-known member
It's probably a corner case in how we emulate one of the 601 instructions but various automated tests haven't flushed it out.
I'm guessing you are, but are you emulating the POWER instructions that the 601 has as well as the PowerPC stuff?

The 603/604 had to emulate the POWER instructions that early 601 target software uses, but if the nanokernel sees that it is on a 601, it might assume that those instructions are available.
 

Arbee

Well-known member
Yes, we emulate the 601's unique MMU and the relevant POWER instructions (it would give a diagnostic if it hit an instruction it doesn't recognize). It didn't get that far until I added all that.

I just pushed an update that adds the earlier LC III ROM, the offsets were the same as for the later one.
 

Phipli

Well-known member
Yes, we emulate the 601's unique MMU and the relevant POWER instructions (it would give a diagnostic if it hit an instruction it doesn't recognize). It didn't get that far until I added all that.
Yeah, I thought you'd be no top of that. Just double checked in case. It's a long time since I've messed with MAME (like, 12 years at least). It's vastly more comprehensive than last time I looked. I really should investigate.
 

Phipli

Well-known member
The 660 / 840av ROM has the following entry for PDM - the prototype PowerPC Mac that became the first generation of PPC Mac :

[info 14468] Box PDM Evt1 decoder 15 (HMC) VIA mask 00000000 VIA match 00000000 ID 3010
Screen physical 00000000 logical 32-bit 60b00000 logical 24-bit 00000000
ROM @ 40800000 VIA1 @ 50f00000 SCC Read @ 50f04000 SCC Write @ 50f04000
ASC @ 40800000 RBV @ 50f26000 VDAC @ 50f24000 SCSI96 1 @ 50f10000 Singer @ 50140000
MACE @ 50f0a000 AMIC DMA @ 50f31000 SWIM3 @ 50f16000 AWACS @ 07a3181f

This compares to the 6100 ROM entry in the 6100/7100/8100 ROM :

[info 15010] Box PowerMac 6100 decoder 15 (HMC) VIA mask 00000000 VIA match 00000000 ID 3011
Screen physical 00000000 logical 32-bit 60b00000 logical 24-bit 00000000
ROM @ 40800000 VIA1 @ 50f00000 SCC Read @ 50f04000 SCC Write @ 50f04000
ASC @ 40800000 RBV @ 50f26000 VDAC @ 50f24000 SCSI96 1 @ 50f10000 MACE @ 50f0a000
AMIC DMA @ 50f31000 SWIM3 @ 50f16000 AWACS @ 50f14000 BART @ f0000000 Grand Central @ 0300301d
(null) @ 000004d4


Singer has vanished by the time of the 6100, AWACS has moved, and BART and GC have been added. Plus "(null)"?

The PPC ROM has a large number of 68k Macs mentioned in it. I really would be interested to see if you can boot a Q650 from a PPC ROM.
 

Arbee

Well-known member
The main hangup would be if the machine will just map 4 MB of ROM instead of the 1 that came with it (and if it sets the MMU up correctly to compensate for that).

I think the last 3 entries for the actual 6100 are not being parsed correctly. (null) obviously is, but PDM's also too early for Grand Central.
 

Phipli

Well-known member
The main hangup would be if the machine will just map 4 MB of ROM instead of the 1 that came with it (and if it sets the MMU up correctly to compensate for that).
Quadras at least have address space for a 4MB ROM. I think the limit is smaller on older machines.
I think the last 3 entries for the actual 6100 are not being parsed correctly. (null) obviously is, but PDM's also too early for Grand Central.
Ah OK. I was surprised to see it as last time I saw it it was wedged between the PCI controller (and other stuff) and the CPU on a PCI mac.


I tried the first gen PPC ROM in Basilisk II, set up as a IIci. As you might expect (possibly due to the size of the ROM, or other reasons) it did not boot. But, the Q650 ROM happily boots the emulated IIci.

It also will emulate a Q950, but I can't remember if that has a 2MB or 4MB ROM address space. I guess there is no harm in just testing it.

Edit - no luck. I'll check what the maximum Q950 ROM size is.
 

Phipli

Well-known member
Can't tell if the dev note means the ROM can be no more than 1MB, or just that it is 1MB (which it is). But the following from the Q900 Dev Note is interesting. The ROM chapter clearly, and repeatedly, seems to state that the Q900 ROM is perfectly able to run older Macs that are supported by the Universal ROM.

1696512949154.png
 

Phipli

Well-known member
The 660/840 ROM won't boot a Q650 (source: I tried it).
Interesting :)

The 840av and PPC ROMs (called SuperMario) saw a load of rework from stuff I was reading the other day, given the timeline I suspect this happened while the 650 was being finalised, so it was probably forked to early to contain fully compatible code. I'll see if it boots the emulated IIci...

Edit : short answer, no.
 
Top