For my current project I would like to have some parts of the firmware interchangeable by loading applications from SD card.
One way is to run the application as a ChibiOS thread. But how can I link my application against the main firmware? In need a way to interact with the main firmware.
I have noticed that other RTOS offer a binary format for executable and provide dynamic linking. In my case static linking would be enough because the main firmware is unlikely to change. Any ideas?
External binary applications
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: External binary applications
Hi,
The main problem is that the loaded application does not know where the OS entry points are, there is not a single API call like standalone OSes do.
There are several solutions to this:
1) A function vectors table and call APIs through pointers.
2) A real entry point for the OS but this would require an header with wrapper functions.
3) Symbols extracted from the map file and generation of an header using a tool (a perl script or something). The headers would mimic ch.h and hal.h.
It would be risky too because ChibiOS does not support protection, a faulty application would bring the system down.
Giovanni
The main problem is that the loaded application does not know where the OS entry points are, there is not a single API call like standalone OSes do.
There are several solutions to this:
1) A function vectors table and call APIs through pointers.
2) A real entry point for the OS but this would require an header with wrapper functions.
3) Symbols extracted from the map file and generation of an header using a tool (a perl script or something). The headers would mimic ch.h and hal.h.
It would be risky too because ChibiOS does not support protection, a faulty application would bring the system down.
Giovanni