On Wed, 31 Jul 2019, BALATON Zoltan wrote:
For Sparc machines even CPU support is missing so it may be more difficult to get that working. Or maybe not as this could be added based on some other similar architecture: arm, mips and ppc are already there but these do have a lot of Forth files so it may take a while to understand those. I don't know Sparc hardware to tell what drivers may be needed.
It's just occured to me that Sun's OpenBoot (and thus the needed cpu support and drivers) is also open sourced and available at https://openbios.org/OpenBOOT so this may make it the same level to get OpenFirmware working for Sparc machines in QEMU as 40p or Pegasos2. At first sight the directory organisation is the same and while the Sun OBP is probably older than OFW so the latter may have changes from later development that prevent just copying the cpu/sparc and drivers from dev over to OFW tree to get it to work for Sparc but it may be that easy or doable with some porting or much more difficult depending on what changes were made between OBP and OFW and how much these have been diverged. This could only be found out by trying I guess. Even in case these sources cannot completely be merged to a single code base, what has been learned and done with OFW could be applied to and done with OBP to get a ROM built from the original sources for sparc emulation. (One difficulty in building it may be that for ppc there's a cross-forth that can compile it on x86 so no qemu-ppc or PPC hardware is needed to build PPC ROM image which can be done conveniently on x86 host. For Sparc the same likely does not exist so this may need a real or virtual machine or qemu user emulation like used for mips or doing something similar to ppcforth. I think ppcforth depends on a simple PPC simulator in cpu/ppc/ppcsim so if something similar can be found or written for Sparc it may work the same way or qemu-sparc may also work instead.) People interested in Sparc machine emulation (Marc and Atar I think) may want to look at this to evaluate if it would help getting a more complete firmware for Sparc emulation. I'm not interested in that. I'm trying to get OFW working for Pegasos2 but instead of hardcoding init code as is the usual way of porting OFW to a new platform I'm trying to figure out if it would be possible to do it the SLOF way by passing the initial parameters from QEMU so the same way would work for other machines later so we don't have to implement each board in OFW as well. Since we don't want it to run on real hardware only for QEMU a lot of init code should not be needed which would simplify it to only need to write (or port) appropriate drivers where missing which probably there aren't too many so may not be that difficult. If that's doable then maybe the most missing pieces are the Mac drivers which means that for Mac machines OpenBIOS may still have the advantage of having the drivers and support for booting OSes but also the disadvantage of being incomplete in implementing the standard. I still think that putting some work in trying to get OFW working at least for some time is worth it because if it works we could have a firmware that should be most compatible with the expectation of guests and if it doesn't work out we can always get back to trying to reimplement all the missing pieces in OpenBIOS.
Regards, BALATON Zoltan