Mac OS 9 Lives

Mac OS 9 Discussion => Mac OS 9, Hacks & Upgrades => Topic started by: NerduMiner on July 17, 2022, 07:27:46 PM

Title: Setting up an environment for modifying the Mac OS ROM
Post by: NerduMiner on July 17, 2022, 07:27:46 PM
Hello everyone,
I have a longstanding hobby in tinkering with computers and consoles with PowerPC CPUs, and I recently picked up a tray-loading iMac G3 from a friend(Interesting to know it's in the same CPU family as the Nintendo Gamecube!). I always had a mild interest in Mac OS, and this is my chance to mess around with it, namely for software development and whatever else I can figure out.

I notice that there's a good amount of resources related to disassembling and modifying the Mac OS ROM file, which I'd like to try setting up a build environment for.  The only problem I am having is that documentation related to setting up a build environment is both sparse and what's there seems to only apply to users on macOS. Is there any pointers that can be given for the preferred method of dumping and rebuilding the ROM file? I can boot into Windows 10 and Linux, and I can run Mac OS 9 on both the iMac G3 and QEMU instances.  If I have to use OSX I can make use of a Mojave VM, but that should only really be a last resort thing as I wouldn't be as efficient with moving files around.

Thanks in advance!
Title: Re: Setting up an environment for modifying the Mac OS ROM
Post by: IIO on July 18, 2022, 01:41:28 AM
http://macos9lives.com/smforum/index.php/topic,3985.msg27012.html#msg27012
http://macos9lives.com/smforum/index.php/topic,5003.msg36226.html#msg36226
http://macos9lives.com/smforum/index.php/topic,5162.msg37256.html#msg37256
https://github.com/elliotnunn/tbxi-patches
http://macos9lives.com/smforum/index.php/topic,3823.msg25765.html#msg25765
https://web.archive.org/web/20200224195214/http://www.toddp.com/classic/Software%20Install/Apple%20Source%20Code/System%207.1%20Source/Tools/
Title: Re: Setting up an environment for modifying the Mac OS ROM
Post by: Daniel on July 18, 2022, 01:37:56 PM
The best tool for altering the Mac OS ROM file is currently Elliot Nunn's tbxi project. It separates each part of the Mac OS ROM file into its own file, where it can be inspected and modified. Then it lets you put it all back together into a bootable form. https://github.com/elliotnunn/tbxi (https://github.com/elliotnunn/tbxi) https://github.com/elliotnunn/tbxi-patches (https://github.com/elliotnunn/tbxi-patches)

It is written in Python3 and should in theory work on non-Mac machines.
Title: Re: Setting up an environment for modifying the Mac OS ROM
Post by: NerduMiner on July 19, 2022, 02:48:47 PM
The best tool for altering the Mac OS ROM file is currently Elliot Nunn's tbxi project.

I actually was able to setup that one, I just got a bit confused on how you could actually do edits.  I assume you need a disassembler in order to access any assembly code, just not sure what the best one would be for this case.
Title: Re: Setting up an environment for modifying the Mac OS ROM
Post by: Daniel on July 21, 2022, 08:54:14 AM
I believe the people who use modern computers use IDA. Presumably other disassemblers would work too.

On Classic MacOS there is FDisasm, DumpPEF, PEF Explorer, and dePEF (an incomplete tool I wrote).