On 16/08/11 02:25, William Hahne wrote:
On Mon, Aug 15, 2011 at 6:57 AM, Mark Cave-Ayland mark.cave-ayland@siriusit.co.uk wrote:
Ah I see - so the real bug is that OpenBIOS can't add the word correctly? Do you have any DEBUG_CIF traces so we can determine the Forth being sent to OpenBIOS and come up with a fix for that?
I would recommend looking at the BootX source directly for this. If you look at http://opensource.apple.com/source/BootX/BootX-45/bootx.tproj/sl.subproj/dis... line 403. You can see that it just throws the phandle directly into active-package. The device package implementation in OpenBIOS expects active-package to only be set by calling the active-package! word. If it is set directly then it doesn't actually change the active-package.
So looking at the OpenBIOS code I can see that active-package! not only changes the active-package value, but also switches in the private wordlist for that package. I wonder how OBP does it? I can only assume that there is a hook in the dictionary search routine which interrogates the private wordlist first based upon the current value of active-package.
I have a feeling in the back of my mind that I've seen Fcode elsewhere that does a similar thing in some of my SPARC investigations, so it seems like a strong assumption held by various developers. Perhaps it may be possible to alter the $find word to search the active-package wordlist first if set to a non-zero value?
I would like to note that this particular patch is optional for booting Mac OS X. It is just nice since it allows the Apple logo to be displayed.
Understood.
ATB,
Mark.