External binary applications

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome. This forum is NOT for support.
Post Reply
Lupin
Posts: 7
Joined: Fri Jan 04, 2013 10:52 pm

External binary applications

Post 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?
User avatar
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

Post 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
Post Reply