On Thu, 29 Sep 2022, Mark Cave-Ayland wrote:
On 28/09/2022 18:30, Jd Lyons via OpenBIOS wrote:
I’m trying to figure how Openbios boots CHRP boot scrips like :tbxi, yet SOLF does not.
Can anyone point me to the code in Openbios that enables :tbxi/CHRP booting?
Also, does anyone know how exactly that works, what was done to Openbios to enable booting the Mac OS?
I’d really like to try and get Apple’s BootX to load on Qemu’s pseries machines and as I understand it CHRP booting should work in SLOF, but it just errors out on BootX with "bad executable”, so there must be some magic I need to understand about :tbxi CHRP boot scripts that SLOF needs some sort of patch.
The boot scripts are really just an XML file that contains among other things, a Forth command to use when booting the media. You can find the simple parser in OpenBIOS at https://github.com/openbios/openbios/blob/master/libopenbios/bootinfo_load.c.
I suspect what is happening in SLOF is that the XML is being parsed, however the resulting executable loaded isn't being recognised because it is in COFF rather than ELF format.
Either that or SLOF can't read HFS file system to load it. There's an HFS driver in openfirmware in Forth (https://github.com/openbios/openfirmware/tree/master/ofw/fs/hfs) that could be tried to be ported but I don't see how can MacOS run on anything else than a Mac as it would need drivers to the different machine so there are probably much bigger problems ahead than just SLOF.
Regards, BALATON Zoltan