Mark Cave-Ayland <mark.cave-ayl...@ilande.co.uk> wrote:

> On 31/05/2020 15:58, Theo de Raadt wrote:
> 
> >> AFAICT the problem here is the Forth being used at
> >> https://github.com/openbsd/src/blob/master/sys/arch/sparc64/dev/fb.c#L511: 
> >> since the
> >> addr word isn't part of the IEEE-1275 specification, it is currently 
> >> unimplemented in
> >> OpenBIOS.
> >>
> >> Why is addr needed here? Does the fb.c driver try and change these values 
> >> rather than
> >> just read them?
> > 
> > Why does that matter?
> > 
> > sparc64 isn't a IEEE-1275 openfirmware.
> > 
> > It is a Sun openfirmware, meaning it is more than the vague
> > specification.  An emulation must be able to emulate THE REAL HARDWARE.
> > 
> > This should work.
> 
> Well there are plenty of SUN-ims already included in OpenBIOS to enable 
> Solaris to
> boot as far it does; I'm not against them, I was just commenting that this 
> was the
> reason why it is currently unimplemented.

I still think this is conceptually backwards. IEEE-1275 is the bastard
step-child, it is a sub-set of what OpenFirmware actually is and was.  These
aren't minor extentions.  They are fundamentals which started on 32-bit sparc
and carried forward into 64-bit sparc.

> A simple addr implementation for Forth values should be fairly easy to put 
> together.
> Since I don't have access to any Sun hardware, can someone confirm the 
> semantics of
> the addr word for me? In particular what does it return for:
> 
> - Values (presumably this is a pointer to a 64-bit value?)

On sparc64, cell_t is 64 bit, so that seems true.

> - Defers (does it return a pointer to the deferred word?)
> - Words  (is it the same as the ' word?)

It seems to only be used for values.  Can't speak to the rest.


Did something weird happen where other 32 architectures heading into
64 bit territory (powerpc?  arm?) decided to keep cell_t as 32-bit when
when transitioning to 64-bit?  That's a pretty poisonous situation.
I guess the answer is to assume those are fully 32-bit OFW, but clearly
there are purely 64-bit OFW 'in the wild'.  It seems ridiculously easy
to fall into the trap of sustaining legacy, and not keeping architecture
clean.


Reply via email to