Classic Mac OS Software (Discussions on Applications) > Hacking the System, Mac OS 9.3, and Beyond !

Mac OS Rom Hacking

(1/11) > >>

Daniel:
Hello everyone,

I created a custom Mac OS ROM file and thought it might be useful. It does not have the Trampoline or Toolbox data in it. Instead, it loads them from a folder called 'Bootfiles' in the System folder it resides in. The Trampoline and Toolbox are in separate files and can be modified independently. It also loads and runs a Forth boot script from that folder before running the Trampoline.

To use it, just copy the Mac OS ROM file and the Bootfiles folder into your System Folder. It is probably best to save the old ROM file somewhere else and have a second System Folder that can be booted from to restore the first one. I have only tested this on one system. Use it at your own risk.

The Trampoline and Toolbox file are taken from a recent release of CDG5 (it even supports NKDebug if you have it). It probably only works on 9.2.2, but you can swap out the Trampoline and Toolbox for ones that have more compatibility (assuming that you can figure out how to create the separate Trampoline and Toolbox in the first place. It can be trivial or impossibly difficult depending on what tools you have available).

I apologize for the messiness of the custom ROM. I started out with a regular Mac OS ROM file and iteratively modified it until it did what I wanted it to.

I hope that the custom ROM is useful. I would appreciate any feedback on it.
Thank You,
Daniel

Edit:

The version in this message should probably not be downloaded. It is not compatible with every NewWorld Mac. The latest version is attached to another message in this topic. Please download that instead.

ELN:
Legend. Testing shortly.

Daniel:
If you try to use the helper functions I made ( $$+ and load-from-path ) for other projects, be careful. load-from-path seems to only work if you use it in chrp files. This is presumably because init-program copies the data in <boot-script> over to another memory region that is not deallocated by release-load-area. If you use it with a forth or fcode script, calling it swaps the loaded data out from under the running program (this seems to not crash it, but makes it return to the program that called the script). ELF and XCOFF files are presumably safe to use load-from-path as well, but I lack the means to test it (also, ELF and XCOFF files are in native powerpc, so it might not make sense to call load-from-path in there).

Also, be careful editing the Mac OS ROM file. Your text editing program might change the file and creator codes after you save it. I am not sure if Simpletext or BBEdit do this, but I know for a fact that Textedit on 10.3.9 does.

ELN:
Neither QEMU nor my MDD seem to like the image very much. Any ideas? While I notice that the script mixes some LFs in with the usual CRs, Open Firmware usually doesn't mind that. Is the resource fork meant to be missing? The OS usually crashes pretty early if you do that.

But this is very cool, potentially handy for debugging, and easy to integrate into our build system. Which, by the way, does some funky Forth preprocessing that I'd really like your help with. Keen?

Daniel:
I had no idea that the resource fork was missing. The LFs are probably because I used Textedit on OSX to create the script. For testing the scripts, go into Open firmware and type in " boot [the device alias or path to the device]:[the partition number or ','][the path to the Mac OS ROM file or '\\:tbxi']" . This will show the debugging info for it (assuming it even gets that far). Please send me the entire log or the last line of text in the log. I will look over tomorrow. It is 11:25 PM for me at the moment. I would probably like to help.

Navigation

[0] Message Index

[#] Next page

Go to full version