On Mon, 29 Jul 2019, Segher Boessenkool wrote:
On Mon, Jul 29, 2019 at 12:29:35PM +0200, Howard Spoelstra wrote:
--- a/forth/device/other.fs +++ b/forth/device/other.fs @@ -58,21 +58,27 @@ defer (poke) \ 5.3.7.2 Device-register access
: rb@ ( addr -- byte )
- ioc@ ;
: rw@ ( waddr -- w )
- iow@ ;
: rl@ ( qaddr -- quad )
- iol@ ;
: rb! ( byte addr -- )
- ioc! ;
: rw! ( w waddr -- )
- iow! ;
: rl! ( quad qaddr -- )
- iol! ;
: rx@ ( oaddr - o )
Thanks, have you seen the full patch (implementing pci-map-in) or just this fragment?
Note that all those are bus-specific, and a correct implementation of these words has to look at the FCode 235 (etc.) of the bus you are on, and inherited from its parent bus, etc.
I don't understand any of the above... What's FCode 235? Also OpenBIOS only handles one PCI bus at the moment so not sure that additional complexity you mention exists in it yet. The io* words do what needs to be done to read and write mapped registers (on ppc doing eieio or similar, otherwise same as memory read/write as all io is memory mapped on that platform) so I think for now this might be sufficient even if not correct at least on PPC. (Since I don't have enough knowledge to make it correct I had to hack it together so it does what I need to run the FCode I wanted to test without exception but it may not be correct.)
OpenBIOS is not OpenHackWare but seems to be equally incomplete, patchy and rely on random hacks. Trying to clean it up and implement missing stuff seems to be as complex as rewriting OpenFirmware. Given all OpenBIOS's missing features and non-existing developer comunity with only limited resources to improve it I wonder if we should try to move on to OpenFirmware instead eventually to at least have a complete OF implementation so we only need to care about porting that to QEMU and adding Apple specific stuff and not to implement OF itself. Apparently this was already done for QEMU prep a few years ago:
https://tyom.blogspot.com/2014/09/open-firmware-for-qemu-system-ppc-m-prep.h... https://github.com/artyom-tarasenko/openfirmware/
So how hard would it be to do the same for the Mac machines in QEMU? Would that be easier than trying to fix OpenBIOS?
Regards, BALATON Zoltan