On Sun, 14 Nov 2021, Segher Boessenkool wrote:
On Sun, Nov 14, 2021 at 02:17:23PM +0100, BALATON Zoltan wrote:
In my opinion a more perfect solution would be to use real OpenFirmware instead that would really fix all compatibilty problems. If anything I would be willing to put effort in that otherwise it's just wasted time for me. Why reimplement OpenFirmware now that it's available open source? We would only need to write the drivers for the mac hardware for it some of which may be available in the Sun version which is also open source (like escc and sungem)
Fwiw, this will not be compatible to Apple OF at all. There are very many things, small and large and huge, where Apple OF deviates from the 1275 standard. Also all OSes that run on Macs have their own special little (or huge) requirements as well.
The basic OF things enough to boot these OSes are probably not that much different after all OpenBIOS also implements only part of the standard and it can boot some of these OSes. Maybe a larger missing part would be the Apple HFS, partition table and bootinfo support that would need to be reimplemented in Forth as these are in C in OpenBIOS. But OF should already have a lot of other things OpenBIOS is missing like those needed to run card Fcode ROMs or guest boot codes. So both ways need some work.
Note that the Apple 8530 and GEM are incompatible to the original as well, in some crucial ways. Nothing that cannot be overcome, but don't be surprised if things do not work out of the box.
Which would be more work? Implement everything missing in OpenBIOS compared to OpenFirmware or implement the missing parts in OpenFirmware to reach the current state of OpenBIOS? I don't know, but Apple's OF is likely closer to the open source OLPC OpenFirmware than to OpenBIOS as they share origins so it may be more compatible with that. (For Sun we would only need to compile the published version which should be mostly identical to the original but to reduce the number of versions it might be better to merge them if possible. The third machine that needs OF in QEMU is prep for which Artyom already made OF work. I've considered it for pegasos2 as well but went with VOF at last that became available in the meantime.)
Good luck and have fun,
Was just an idea anyway and only mentioned it to explain why I don't want to put too much effort in OpenBIOS. I'd rather have some fun instead.
Regards, BALATON Zoltan