Decompile the PROM firmware for the Silicon Graphics O2 (IP32) and reassemble into a bit-identical image.
The Silicon Graphics O2 is a Unix workstation with a MIPS CPU.
There are two families of CPUs available for the O2:
In the early 2000s, members of the Nekochan community replaced the 300 MHz RM5200 and 350 MHz RM7000A CPUs with a faster 600 MHz RM7000C model. The 600 MHz CPU, though in-order, is faster than the out-of-order 400 MHz R12000 CPU in most cases.
This modification is documented by SGI Depot in the article Upgrading an O2 to 600MHz (and beyond!). While replacing a BGA-mounted CPU takes significant tooling and expertise, the modification does not require any firmware or software changes.
As the title ("Upgrading an O2 to 600MHz (and beyond!)") of the article might suggest, there were hopes of further upgrades. The article notes
Meanwhile, Joe unfortunately did not have any success with the PMC 866Mhz CPU - apparently it is not quite as compatible with R5200 as PMC thought. Meanwhile, any ideas about a 900 are somewhat hampered by the need to have a distinctly modified IP32 PROM image, which would need some assistance from SGI. Who knows if they would be willing to help; one can but ask!
Watch this space!!
The 900 MHz CPU referred to is the RM7900 from PMC-Sierra. The RM7900 uses a newer E9000 CPU core but in a 304-pin BGA package compatible with earlier RM7000 CPUs. It is not clear to me what the 866 MHz CPU is — I can find no evidence of an 866 MHz MIPS CPU, RM7000 or otherwise.
Presumably any attempts to use an RM7900 failed without support in the O2's PROM firmware.
At the time, Silicon Graphics still existed and there remained some faint hope for access to the source code of the PROM — the boot firmware — but today Silicon Graphics is long gone and with it the source code for the PROM. (as well as any concerns about legal issues from reverse engineering!)
I reverse engineered the PROM firmware and wrote a program to decompile it into modifiable assembly (.S) files. The assembly files can be reassembled into a bit-identical PROM image, thus verifying that the decompilation was accurate.
With the PROM firmware now decompiled into modifiable assembly, the "distinctly modified IP32 PROM image" needed for RM7900 support is possible — no assistance from SGI required.
See doc/reverse-engineering.md for details on the process.
The assembly files are made more comprehensible with various annotations and other improvements to readability.
| Filename | Purpose |
|---|---|
| labels.json | Named addresses for branch targets and data |
| comments.json | Per-instruction documentation |
| functions.json | Function boundaries and descriptions |
| operands.json | Instruction operand replacements |
| relocations.json | Code that executes at different addresses than stored |
| bss.json | Named BSS (uninitialized data) symbols |
The resulting assembly:
| Without improvements | With improvements |
|---|---|
|
|
- Rust toolchain (cargo)
- MIPS cross-compilation toolchain
- C preprocessor (
cpp)
With ip32prom.rev4.18.bin located one directory up from the project directory, run make in the project directory. The path to the PROM image can be overridden with make PROM_IMAGE=/path/to/prom.bin.
This project has been tested with PROM version 4.18, but is expected to work with other versions.
The decompiled PROM image is in output/, complete with:
- a
definitions.hheader containing preprocessor defines used by the assembly sources - a
macros.incfile containing GNU GAS macros used by the assembly sources - assembly sources (
.S) themselves, one for each section in the PROM image - linker scripts, needed to set the virtual memory addresses
- a
Makefileto build the PROM image from these files
In addition, the following ancillary files are generated:
.xpmimages that show the structure of each section.prom.xpmshows the structure of the sections as combined into the final PROM image..dotgraphs that show the control flow graph of functions and basic blocks in each section (note thatfirmware.dotis too large to render).
Running make check builds the decompiler, generates assembly files, reassembles them, and verifies the rebuilt output/prom.bin matches the original.