-
Notifications
You must be signed in to change notification settings - Fork 274
Building an application
Trampoline is a static configuration RTOS. All data structures used by Trampoline are created and initialized before the compilation. A part of the RTOS is generated according to the specific requirements of the application. On the other hand an application can't create objects dynamically (tasks, alarms, ...).
This approach has many assets:
- It allows to reduce the amount of memory needed: descriptors can be optimized because their number is known. Static descriptors are stored in flash memory, this reduce the amount of RAM used and improve safety;
- It allows to improve the robustness of the system: the API is simple and easy to use, dead code is removed according to the configuration, safety mechanisms like runtime monitoring may be included;
- The system is predictable and offline analysis may be performed.
The picture below shows the building process of the executable of an application using Trampoline.
To avoid to define by hand the structures used by the RTOS, a dedicated language, OIL is used. OIL is a simple language to define the objects of the application: tasks, resources, events, messages, ... The following OIL snippet describe a task with priority 20, which is not activated when the OS is started (AUTOSTART attribute), which can be preempted (SCHEDULE attribute) and needs 256 bytes of stack.
TASK periodicTask {
PRIORITY = 20;
AUTOSTART = FALSE;
SCHEDULE = FULL;
STACKSIZE = 256;
};
From this description, an OIL compiler (goil for Trampoline) generates data structures, code and compile and link scripts. The OIL compiler verify the coherency of the described software architecture, compute automatically some values like the ceiling priority of resources or event masks. The OIL compiler uses a set of templates. This allow to add a new hardware target without modifying the OIL compiler. Adding templates to generate additional files is possible too.