-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 19-Oct-06, at 7:19 AM, Andrew Lentvorski wrote:
Marc Feeley wrote:
Andrew, that's a neat project! For a long time I have been thinking of running Gambit "on the bare metal" and, although I have never tried to do it, the runtime system has been designed so that there are few dependencies on a specific OS. The C code generated by the compiler is very plain (it only uses the header files limits.h, wchar.h, float.h, setjmp.h, and math.h). The OS dependent stuff is mostly contained in the lib/os*.c files.
I located main() inside gambit.h after peeling apart the preprocessor stuff with -E. This then calls ___main_char or ___main_UCS_2 inside os_base.c.
I need to initialize some things (interrupts, keyboard, display, timers, wifi, etc.) before letting Gambit take over. Where should I hook in? Should I hook in before letting the call float through to ___main_char or ___main_UCS_2, or is there somewhere else that I should break out and start initializing?
Thanks, -a
You can either add your initialization code to ___main_* in lib/ os_base.c , or start Gambit from your own main (see the examples in tests/client.c and examples/pthread to see how to do this).
Marc