I'm going to drop some notes on my trampoline recreation here. Some of it may be ramblings some not.
Firstly though I would share a couple interesting things I've found. Nothing earth shattering, but it amused me for some reason.
Keep in mind I'm using the last version of the trampoline released by Apple.
After open firmware loads the trampoline and jumps in, the main method starts at address 0x00204D54 in RAM.
Some stack frame setup is done.
Then a handle to the Open Firmware Client interface is stored in RAM.
Then a handle to /chosen is acquired.
The bootpath property of /chosen is loaded.
if bootpath doesn't exist in /chosen everything ends here.
From /chosen a handle to stdout is acquired.
Then a handle to memory is acquired from /chosen.
Doesn't look like the stdout handle has to succeed, but if the memory handle is not acquired then again booting ends here.
Next a handle to the root of the device tree is acquired.
If that fails again booting ends.
The AAPL,debug property is checked.
If this is found then it stored in memory. If it is not found then it sets a default.
The cool thing here is that it's loaded from a default value in the data section of the trampoline elf image. So it's possible to update the trampoline with a debug level value and then you never have to set AAPL,debug.
The other cool thing is that all those points where it fails now, they call a debugprint function. It checks this value. Since the first few failure points haven't loaded AAPL,debug and the default value shipped is 0 then those message would never get printed.
The next portion of code is to try to get the value in the property "copyright" of the root device.
This looks like a very rudimentary check to ensure that the system is running on a legit Apple machine if the copyright property is missing it ends with outputing a message
"Official Apple copyright message missing."
That's as far as I am with disassembly of main.
That's it for interesting things.