[OpenBIOS] PATCH: Rework CIF interface to handle parameters in reverse order

Nick Couchman Nick.Couchman at seakr.com
Tue Nov 24 01:04:08 CET 2009

>>> On 2009/11/23 at 15:36, Mark Cave-Ayland <mark.cave-ayland at siriusit.co.uk>
> Hi all,
> This patch is an attempt at reworking the CIF so that it can be called 
> correctly from both Fcode (Forth) and C. Currently the C arguments are 
> pushed into the stack in reverse order, rather than forward order which 
> is required by Forth words calling the CIF.
> In order to fix this, we correct the order in which C arguments are 
> placed on the Forth stack by pushing the parameters in forward order. 
> However, this has the side effect of reversing the order in which the 
> parameters to the CIF Forth words are expected and so these must also be 
> altered to take this into account.
> This patch works as expected from Forth Fcode, but I would like to put 
> it out for testing before I commit to the repository. Blue Swirl/Laurent 
> - please can you test on your setups again?

Thanks for the patch - for me this takes care of the seek failed error when booting off the Solaris Nevada DVD, but I'm back to getting this:

0 > boot cdrom 
[sparc64] Booting file 'cdrom' with parameters ''
Not a bootable ELF image
Not a Linux kernel image
Not a bootable a.out image
Loading FCode image...
Loaded 7120 bytes
entry point is 0x4000
Evaluating FCode...
Unhandled Exception 0x0000000008000000
PC = 0x00000000ffd10e3c NPC = 0x00000000ffd10e40
Stopping execution

the exception being at the following location:
0xffd10e3c is in cfetch (../include/openbios/stack.h:34).
29	typedef ucell phandle_t;
34	static inline void PUSH(ucell value) {
35		dstack[++dstackcnt] = (value);
36	}
37	static inline void PUSH_xt( xt_t xt ) { PUSH( (ucell)xt ); }
38	static inline void PUSH_ih( ihandle_t ih ) { PUSH( (ucell)ih ); }

If you're interested in the full output of "boot cdrom" with "true to ?fcode-verbose", I've put it here:

Maybe there's somewhere else where the stack is in the wrong order - I don't know that I've seen cfetch mentioned before??


This e-mail may contain confidential and privileged material for the sole use of the intended recipient.  If this email is not intended for you, or you are not responsible for the delivery of this message to the intended recipient, please note that this message may contain SEAKR Engineering (SEAKR) Privileged/Proprietary Information.  In such a case, you are strictly prohibited from downloading, photocopying, distributing or otherwise using this message, its contents or attachments in any way.  If you have received this message in error, please notify us immediately by replying to this e-mail and delete the message from your mailbox.  Information contained in this message that does not relate to the business of SEAKR is neither endorsed by nor attributable to SEAKR.

More information about the OpenBIOS mailing list