OpenFirmware - VOF, SmartFirmware
Solaris today has a strong dependence on OpenFirmware if you are on PPC or SPARC.
With the Solaris port project on PowerPC we initially ran into a number of limitations with Genesi's Open Firmware implementation aka SmartFirmware on the ODW target. This firmware only ran in real mode and was unable to effectively boot Solaris directly. However the ODW does map it's 256mb of memory via a BAT and it sets V=R. This allowed the first release of the code base to boot. We worked around this issue for a while but shortly after the source release we had implement a better solution. In this case it is called VOF or Virtual Open Firmware.
You can obtain the binary of VOF openfirmware from the Project Extras.
But first some history.
SmartFirmware Background
SmartFirmware runs in real-mode, and at this time it is not (easily) possible
to move it to virtual-mode. This has a certain number of implications for the
way you handle it, but they are well defined in the ppc bindings to IEEE1275
available here, and described in Chapter 4.
When in real-mode, the mmu translations settings are not shared between the
firmware and client program, as is the case in virtual mode (section 4.2.1),
and as thus each client program is in charge setting up its own mmu settings,
using BATs or page tables.
The firmware is in charge of saving and restoring the client-side mmu settings. There were issues with this implementation on ODW, in which the client-side mmu settings were not restored as they should. A work around was tried by having the firmware preset or hardcode an upper bat. This allowed us to load the kernel but callbacks failed.
Now, running in real mode, means that the data exchanged between the client
program and the openfirmware through the client interface need to be physical
addresses, (section 4.2.5), however this created a problem with solaris, which also logically explain the access violation exception we saw on the callback. So all string and other internal structure data pointers passed to the client
interface have to be converted between virtual and physical addresses, and
vice-versa when coming back.
We had to decide what was the least path of resistance, Genesi and the Labs agreed it made more sense to use VOF.
VOF
Virtual Open Firmware was created by Brian Horn for the original Solaris PowerPC port. This is a IEEE-1275 compliant bootloader and is a c based implementation, simple, straightforward and effective.
Written for the Solaris PPC port to the PReP platforms. It claims support for the
- IBM 6015 (40P)
- IBM 6040 (ThinkPad 820)
- IBM 6042, 6070, 7248
- Motorola's Comet and Blackhawk (???)
- Daystar Digital Genesis (???),
It provides the proper callback structure and is worth mentioning especially if there is interest in alternate HW platforms. This code was developed by Sun and has to be reviewed to understand the restrictions as to its use and availability. For now this is an informational reference point as the ODW is the target reference platform.
VOF will be a 2nd level Open Firmware and downloaded first by the ODW Smartfirmware. It will then replace the Smartfirmware essentially operating in place of it. Since the underlying HW is well understood and previously initialized by the Genesi OF, taking over the system from that point is fairly straightforward. VOF however cannot replace Smartfirmware, it just works with it.
A few features are currently hard coded, noteably is the amount of physical memory present. Register property for host to PCI bridges should be changed, but work the way they are.
With our focus to make quick progess we decided to re-implement VOF which was used on the original Solaris PowerPC port. We use the ODW's SmartFirmware to inititalize the HW and then we load VOF. This in turn takes over the mmu and allows operation in virtual mode. From here we can load inetboot and the kernel seamlessly. EFIKA and ODW will require VOF to load solaris. VOF is really a stop gap measure. The longterm plan would be to move more of the VOF functionality into the kernel init at some point. Details on VOF are pending. There will only be binary distribution at this time a we expect to deprecate this as soon as possible.