Page 1 of 1

External binary applications

Posted: Wed Jan 30, 2013 5:14 pm
by Lupin
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?

Re: External binary applications

Posted: Wed Jan 30, 2013 10:04 pm
by Giovanni
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