For several months now, Nanopico and I, both of the MacOS9Lives forum, have been picking apart the Power Mac ROM. As we go, we have been writing build and "unbuild" code for NewWorld ROM images (aka "Mac OS ROM" files, Toolbox images and tbxis). The part of the ROM that we have explored to the greatest depth is the PowerPC Nanokernel -- specifically version 02.28, which seems to be the final one. This (very sanitised!) workflow best demonstrates our toolchain, which I have dubbed the "Toolbox toolbox".
Code: Select all
$ git clone https://github.com/elliotnunn/cdg5.git && cd cdg5
$ ls
boot-script kernel-stock prcl-pefs test-template.img
datafork-pefs Makefile README.md trampoline.elf
kernel-disasm-script.py PowerROM-nokern rsrc-template
$ make kernel-redisassemble
Disasm: 05k 10k 15k 20k 25k 30k 35k 40k 45k 50k 55k 60k 65k 70k 75k 80k ...80736b
(Edit your newly-generated kernel-disasm.s, an annotated assembly code document. Maybe clobber something to see when and how the machine crashes, or change a constant to observe its effect on the PowerMacInfo application.)
$ make test
(output from kernel assembly, PowerROM construction, parcel compression,
Mac OS ROM packaging, HFS image modification and QEMU)
(QEMU will start from the included minimal OS 9 image, patched with your kernel. The Nanokernel log will come up during boot and will be redrawn intermittently. PowerMacInfo is the only startup app.)
(Now edit your kernel-disasm-script.py, the script that produced the above kernel-disasm.s, to reflect the wisdom that you have gleaned from your experiment.)
$ make kernel-redisassemble
Disasm: 05k 10k 15k 20k 25k 30k 35k 40k 45k 50k 55k 60k 65k 70k 75k 80k ...80736b
(Admire your more beautifully disassembled kernel. And submit a pull request so that I can too!)
We'd be pretty chuffed if anyone wants to join in. The best test of your relevant knowledge is probably whether you know C and grok pointers -- but err on the side of having a go. I picked up PowerPC assembly as I went, and so can you.
While we have some moderately exotic build dependencies, I have neatly packaged these up as Docker images. To run the above code you only need to have Make, Docker and an OS 9-capable QEMU. You do not need to download any Docker images yourself, or even know how to use Docker. The makefile takes care of that for you. This build system is brand new, and while I think it should work for everyone, I'd like to know about build failures ASAP.
Happy hacking,
Elliot