-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Old World loading capabilities #31
base: main
Are you sure you want to change the base?
Conversation
This is untested, as I don't have a G3 beige system, but the same process works on my OF 1.0.5 PM7600.
About the blessing procedure, I believe from looking at OSX install images, it uses an APM partition with no data storing raw powerpc code, with base address + entrypoint in the partition table entry. OSX uses a mapped binary with mach-o headers present (IDA loads it fine as a mach-o even) but executable headers aren't required. I was planning on modifying arcfw for clearing bss, and having a load image for oldworld that was basically loaded arcfw+custom loader in bss, placing it in the cd image then patching it after build (as far as I can tell no tool can set up such an APM partition in a hybrid ISO containing only code yet). For dualboot, could probably add some boot menu in loader (and enable it only if mac partitions were created). Given the 16KB loader limit will be not present at all for oldworld... |
I just tried booting my 10.0 CD in my 7600 (holding C), and it appears that whatever it boots is a small script that sets the following NVRAM parameters:
and then resets the system, letting OF then hand it off to the OS X loader on the CD. System Disk appears to do the same thing when booting to an OS X CD. I also happen to have a Server 1.2 CD which is supported on the 7600, but it boots and installs from a Mac OS 8.5 System Folder instead - but the boot device setting from 10.0 still tries to boot Mac OS X Server from CD (which doesn't appear to work, it runs the loader but fails to find a kernel I think). From a bit of digging, I believe the HFS Standard wrapper over the HFS+ partition holds the C-key boot data. There are three hidden files located on this hidden sub-partition:
Also possibly relevant is the HFS boot block, which I'm leaving a link to docs for in case it's necessary. As for Open Firmware loading, you're correct about it loading from the APM - I'm not sure exactly where it comes from, but I'm guessing that So after a lot of investigation, I believe this is the way to make a "truly bootable" CD for an Open Firmware payload:
Alternatively, using an APM boot image:
Now, I don't really think I want to put in the effort to make this work without copying Apple's files - it's a lot of hacking to be able to hold "C" instead of typing a command once. But this is some food for thought, and I might play around with the Apple files a bit on my own to see what's possible. |
"without copying Apple's files" - I already bundle the OS9 IDE drivers, the only way for installing them at all is reformat or having them present for OS9 drive setup to be able to update them... if I could have avoided bundling them (for dualboots) I would have... Regarding the open firmware nvram changes, that would make sense given OSX BootX comes up in 1024x768 under dingusppc, the same as when dropping to OF prompt, yet OF |
so I've been thinking about Old World support again. I also got a cheap wallstreet (PDQ) that's seen better days for testing on real hardware eventually. I've decided that the "best" way to go about things would be a custom System file like what Apple did for OSX, except implementing a full stage1 bootloader in that System file instead of just modifying OF variables and rebooting. With the boot partition as Apple_HFS, it would then show in startup disks, and ARC firmware could search the drive for bootable HFS partitions and show all of those in the boot list, and change the boot partition in NVRAM (or just set things up on disk for stage1 to do it) and reboot when attempting to boot those. (I noticed that the MESH driver in open firmware on my wallstreet was broken for the SCSI device I'm currently testing with, INQUIRY would not complete until I powered off the device, but the toolbox ROM could use it fine. It works fine under open firmware on my lombard.) NuBus systems (although I'm not planning to get one) could be supported in the same manner (with a different stage1 bootloader), which would allow for drive partitioning code in stage2 to be shared. |
I've also been thinking about restarting this project, and now I've got my 7600 back with me (didn't have access to it for a while). I've done a little bit of testing and research, but I haven't gotten to do anything significant as I lack a good way to boot HFS+ volumes on real hardware - I'd rather not burn my limited CD stack on tests that won't work, and it's hard to do anything meaningful with the internal hard drive, so I'll need to get a BlueSCSI to drop CD images through.
I'm not sure how well that would work. The boot code in the system file is 68K, so some trap would be needed to tell the system to run native PowerPC code - possibly the The following is some collected miscellany about my tests so far.
Long story short, the Mac OS X method seems promising, but I'm gonna need a BlueSCSI to test any further. |
The OSX one that sets up OF for booting OSX has a small 68k stub (260 bytes) that uses MixedModeDispatch to get into ppc mode after doing some stuff involving reading or trying to read Debugger and Disassembler files that I don't understand the purpose of, the MixedModeDispatch struct points to a powerpc pef directly after the 68k code.
Retro68 is a thing. I don't really care about the 68k side, using Apple's 260 byte stub for that should be good enough. |
This PR adds an extra build step to the arcloader/stage1 makefile which produces an XCOFF file that can be loaded from Old World Open Firmware versions. It uses a small program from the Linux sources to patch the XCOFF that GCC links, which makes the executable bootable.
This is mostly untested, as I don't have a G3 beige system (and DingusPPC is being weird), but the same process works on my OF 1.0.5 PM7600. I also don't know the blessing procedures quite yet, and if OF 1/2 is even able to detect alternate boot devices without changing
boot-device
in NVRAM.