Description
Hi there, to continue discussion on #907 , i made some tests and updated the build of my baremetal port to the latest TIC80 sources.
In the end, modifications on the codebase is limited to the following:
- fs.c: this is the biggest change, most of the primitive functions in here need a different implementation.
- tic80_types.h: need changes to avoid a type conflict.
- CMakeList.txt: a block for Baremetal is added at the beginning as a preamble, to set all variables etc.
Everything else is new files that could go in any folder.
The strategy i used is to build tic80lib as usual (i haven't added a new target) with BAREMETAL switch, which is basically just crosscompiling it to ARM with some custom stuff for RPI. Then i made a separate program (the kernel), based on circle examples code, that link to the tic80lib.a. This is a separate Makefile that include stuff from circle and circle-stdlib, not sure it is possible to include it in the main CMake build file.
I think we could put the kernel on src/system/baremetalrpi and the Makefile on build/baremetalrpi, or some similar combination. In build/baremetalrpi i can put a readme with all steps to checkout circle and build everything.
If you're ok i can prepare a pull request (in a couple of weeks, i'm leaving for vacation soon :D ). Obviously everything can be changed later if we find a better fit.
I was able to build TIC80 with all languages except squirrel (for some reason it breaks crosscompilation, i think it has some dangling arm switch inside somewhere).