Here is one way I tried it before - There is one “Loader” which loads various applications (called components afterwards).
In your description, you want FreeRTOS to be part of loader as well. Each component has an header at the beginning which provides the loader necessary information to load the component:
The way loader discovers various components is that FLASH and RAM are pre-partitioned for each component and therefore, the starting location of each component is fixed. Here is a sample partition:
The loader is the first image that boots up and then loads all the components. The way you enable communication between components is by adding one indirection. The loader maintains a list of all the functions exported by each component. The loader has a function GetProcAddress
which always resides at a fixed address and therefore, any component can all it. When a component wants to call a function exported by another component, it calls GetProcAddress
to get the address of that function and then calls the function using the obtained address.
There is a agreed upon list of function ids among all components which is used to identify functions in GetProcAddress
.
Does this sound like something you are looking for?
Thanks.