Probably making assumptions on how the startup is organized is not such a good idea, it makes porting the RTOS on a different compiler more complicated.
I am thinking to modify the board files this way:
- Optionally export an __early_init() function (most startup files support the concept of early initialization), this is basically the old hwinit0().
- Export a boardInit() function that has to be invoked from the main() function.
- halInit() and chSysInit() will have to be explicitly invoked from the main() function too, no more hidden initializations.
The changes will make the board files usable regardless the specific compiler and its startup files.
Another reason to do this is that I don't want to make demos for GCC, IAR, Keil etc. The demos will be generic and compilable using any supported compiler, I will just put the build files for IAR, Keil etc in subdirectories within the demo alongside the GNU makefile.
Giovanni