On Feb 5, 2016, at 8:17 AM, Mark Cave-Ayland wrote:
On 05/02/16 13:08, BALATON Zoltan wrote:
On Fri, 5 Feb 2016, Mark Cave-Ayland wrote:
The Apple 9.2 bootloader ignores the Forth specification in this respect and includes direct r-stack commands and hence the return address is corrupted once they have executed (for fun, try typing r-stack commands directly into the OpenBIOS command line).
So the solution is to find some way to preserve the r-stack in this context to ensure that execution continues back at the right location.
How does this work on Apple's OF implementation? How is that different from OpenBIOS?
No idea, since we don't have the source code ;) However we can assume that the only reason this works is due to a specific implementation detail of Apple's OF in this respect.
You can get fairly close by forcing the interpret word to execute in compile mode, however that fails as soon as you come across a : to define a word which is also present in the Apple bootloader. I guess the solution would have to involved switching to a separate r-stack context for words executed within the interpret string or similar.
Segher, did you have any further ideas on this?
I'm not entirely convinced that anything is broken. Mac OS 9 booting successfully in OpenBIOS doesn't translate to me as something being broken, but actually working.
Maybe when the client interface is running, there should be two return stacks.