* Samuel Rydh <samuel(a)ibrium.se> [031030 13:03]:
Wouldn't it make sense to add some C-bindings to
kernel? I have examined all the built-in tokens and as far
as far as I can tell there is currently no way to call an
external function (well, save abusing the inb/outb mechanism).
true. it is definitely needed.
To make the C-code and the forth code interoperate, I
like to be able to
1. Call C-functions from forth code by pushing the address
of the function on the stack. Something like
call ( function_addr -- <whatever> )
2. Be able to invoke the forth interpreter from
(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).