Like how would I find the entry point in memory, and then capture the returned values. Or for instance, how would I determine the input variables locations that the compiled C code is expecting as inputs, albeit special registers or the stack?
This is an abstract conceptual question with no actual goal or project application at the moment. It would be nice to utilize Arduino libraries in FORTH by writing a function and then encapsulating the compiled binary in a FORTH Dictionary Word definition.
Obviously measures must be taken to preserve the FORTH interpreter's pointers, stacks, and special registers. Is this ever worth the effort as opposed to sucking it up and rewriting the whole thing from scratch, delving into all the underlying mess of peripheral hardware documentation, or is there some typical way to streamline?
As a further aside, does one ever do this within a Unix like system? Like let's say I want to only use a single python method present in llama.cpp in the source that has been compiled and cached in another directory. I want to call this method from inside a function written in my .bashrc file. I have called Python executables from bash functions many times, but never some random subroutine.
Looks like there are no problems with kernels scanned from around 2021.
https://linux-hardware.org/?view=computers&vendor=Alienware&model=X51+R2