[OpenBIOS] C bindings
Samuel Rydh
samuel at ibrium.se
Thu Oct 30 17:16:33 CET 2003
On Thu, Oct 30, 2003 at 02:50:09PM +0100, Stefan Reinauer wrote:
> > 1. Call C-functions from forth code by pushing the address
> > of the function on the stack. Something like
> >
> > call ( function_addr -- <whatever> )
>
> see attachment.
Great! I'm trying to make it simple to track the latest openbios
source so I'm avoiding MOL specific modifications whenever
possible...
> > 2. Be able to invoke the forth interpreter from C-code
> > (I think this can be implementable without modifying
> > the kernel code, but I haven't looked into it yet).
>
> this can be done for example with
> kernel/openbios.c:void openbios(ucell dictstart, ucell dictend)
> or directly by calling enterforth(). Note that the engine does
> not allow running multiple concurrent instances (yet).
Well, I don't need concurrent instances, just recursive.
enterforth() seems to be able to handle that. What I need though
is runtime translation of C-string forth into tokens. I.e. basically
I need to do the same stuff as interpret does. I will look into it;
I doubt it will be a problem.
/Samuel
More information about the OpenBIOS
mailing list