Trampoline OSEK-VDX & AUTOSAR Compliant Open Source Real-Time Operating System Jean-Luc Béchennec, Mikaël Briday, Sylvain Cotard, Sébastien Faucou, Yvon Trinquet Journée ACTRISS Outils. November 7, 2012 J-L Béchennec et al. (IRCCyN) Trampoline Open Source RTOS Journée ACTRISS, 2012/11/7 1 / 16
History and Motivation History and Motivation 2005 Start of development, Goals: 1) automotive industry standard compliant RTOS, 2) Open Source RTOS for teaching and research purposes. Early 2007 Start of O4A (Open for AUTOSAR) PREDIT project, Validate OSEK compliance, Add AUTOSAR 2 compliance. Start of cooperation with See4sys. Late 2008 Start of O4A II PREDIT Project, Add AUTOSAR 3 compliance. Late 2010 Start of RESPECTED ANR Project, currently adding Multicore support and modular scheduler. J-L Béchennec et al. (IRCCyN) Trampoline Open Source RTOS Journée ACTRISS, 2012/11/7 2 / 16
How it works A static RTOS Static means no object creation or deletion at runtime. Tasks, resources (mutex), events (signalization),... are all known at compile time. Trampoline encompasses: A real-time kernel (trampoline os); A communication extension (trampoline com and trampoline ioc); An off-line kernel configuration tool (goil); A virtual environment to prototype applications on POSIX workstations (viper); A runtime verification tool (enforcer). J-L Béchennec et al. (IRCCyN) Trampoline Open Source RTOS Journée ACTRISS, 2012/11/7 3 / 16
Architecture How it works OS Task Interrupt Alarm Resource Event ISR Schedule Table Counter Global Time Application com/ioc Kernel Interrupt dispatcher Counter manager Scheduler BSP Interrupt handler System Call handler Context switching Memory protection manager J-L Béchennec et al. (IRCCyN) Trampoline Open Source RTOS Journée ACTRISS, 2012/11/7 4 / 16
Workflow How it works System Configuration Templates Kernel C Sources OS infrastructure C + Assembly Sources Application OIL description GOIL v2 Compiler Application Description + generated code. C Source(s) C Compiler + Linker Application C Source(s) Binary executable J-L Béchennec et al. (IRCCyN) Trampoline Open Source RTOS Journée ACTRISS, 2012/11/7 5 / 16
A word about Enforcer How it works T 0 b 0 T 2 T 1 r 21 b 1 s 00 r 10 s 11 r 21 false Monitoring service true Event Event analysis Monitor update True occurs False occurs Event table Event Handler Monitor update Transition table J-L Béchennec et al. (IRCCyN) Trampoline Open Source RTOS Journée ACTRISS, 2012/11/7 6 / 16
OIL example How it works CPU only_one_periodic_task { OS config { STATUS = EXTENDED ; BUILD = TRUE { APP_SRC = " periodic.c"; TRAMPOLINE_BASE_PATH = "../../.."; APP_NAME = " periodic_exe "; }; }; APPMODE std {}; ALARM one_second { COUNTER = SystemCounter ; ACTION = ACTIVATETASK { TASK = my_periodic_task ; }; AUTOSTART = TRUE { APPMODE = std ; ALARMTIME = 100; CYCLETIME = 100; }; }; TASK my_periodic_task { PRIORITY = 1; AUTOSTART = FALSE ; ACTIVATION = 1; SCHEDULE = FULL; }; }; J-L Béchennec et al. (IRCCyN) Trampoline Open Source RTOS Journée ACTRISS, 2012/11/7 7 / 16
platforms, memory footprint and conformance checking Porting Porting is quite easy. It is estimated to 1 week of work for someone who know the target by See4sys. It consists in: Writing the BSP (Interrupt handler, System Call handler, Context switching); Writing the templates to generate the hardware dependent task and ISR descriptors; Writing the OIL description of the available interrupt sources. Currently the following targets are supported: POSIX PowerPC (32 bits ISA and VLE ISA) ARM (32 bits ISA, Thumb soon) C166 AVR J-L Béchennec et al. (IRCCyN) Trampoline Open Source RTOS Journée ACTRISS, 2012/11/7 8 / 16
platforms, memory footprint and conformance checking Small Memory Footprint All descriptors are stored in static variables, initialized at compile time All static fields can be mapped in ROM All dynamic fields have to be mapped in RAM Basic task / ISR Extended task Alarm Resource Static descriptor 4 ptr + 4 bytes 3 ptr + 2 bytes - Dynamic descriptor 1 ptr + 2 bytes 1 ptr + 4 bytes 3 ptr + 4 bytes 2 ptr + 2 bytes Could be improved by using bitfields instead of uint8, but portability would be decreased Simple applications run on 8 bit CPU, RAM < 2KB, ROM < 8KB J-L Béchennec et al. (IRCCyN) Trampoline Open Source RTOS Journée ACTRISS, 2012/11/7 9 / 16
platforms, memory footprint and conformance checking Conformance Checking OSEK conformance has been specified in the MODISTARC ESPRIT project. MODISTARC defines: the testing methodology the test plan the test procedure We implemented a test suite that includes the MODISTARC test plan/procedure + additional tests + AUTOSAR tests = 142 tests. The test suite is packaged with Trampoline under the GPL licence J-L Béchennec et al. (IRCCyN) Trampoline Open Source RTOS Journée ACTRISS, 2012/11/7 10 / 16
More to come Roadmap Work in progress within ANR RESPECTED (LEAT, LAAS, IRCCyN, See4sys): Multicore kernel design Formal verification of synchronization schemes Modularization: plugging other schedulers; plugging API. J-L Béchennec et al. (IRCCyN) Trampoline Open Source RTOS Journée ACTRISS, 2012/11/7 11 / 16
Diffusion Who is using Trampoline in Teaching? Université de Nantes Ecole Centrale de Nantes Université de Rennes INSA Toulouse J-L Béchennec et al. (IRCCyN) Trampoline Open Source RTOS Journée ACTRISS, 2012/11/7 12 / 16
Diffusion Who is using Trampoline in Research? Caroline Lu PhD (LAAS/Renault) Robustesse du logiciel embarqué multicouche par une approche réflexive : application à l automobile Dominique Bertrand PhD (IRCCyN) Contribution à la robustesse des systèmes temps-réel embarqués Sylvain Cotard PhD (IRCCyN/Renault) Méthode d exploitation sûre des systèmes temps réel embarqués multicœur et multiprocesseur Hélène Martorell PhD (LAAS/Renault) Architectures et processus de développement permettant la mise à jour dynamique de systèmes embarqués automobiles Method and tools for mixed-criticality real-time applications within PharOS. Lemerre, Matthieu, and al. Object/Component/Service-Oriented Real-Time Distributed Computing Workshops (ISORCW), 2011 14th IEEE International Symposium on. IEEE, 2011. Model checking Trampoline OS: a case study on safety analysis for automotive software, Yunja Choi, Software Testing, Verification and Reliability, Wiley, 2012. Bayesian Software Health Management for Aircraft Guidance, Navigation, and Control. Johann M. Schumann, Timmy Mbaya, and Ole J. Mengshoel. Annual conference of the prognostics and health management society 2011 (PHM-11), 2011. J-L Béchennec et al. (IRCCyN) Trampoline Open Source RTOS Journée ACTRISS, 2012/11/7 13 / 16
Diffusion Who is using Trampoline in the Industry? See4sys: Trampoline is included in their AUTOSAR Basic Software offer; PSA: As part of collaboration with See4sys; Renault: In various CIFRE PhD Thesis; Other car manufacturers (at least 2); Dunasys: Currently for evaluation. J-L Béchennec et al. (IRCCyN) Trampoline Open Source RTOS Journée ACTRISS, 2012/11/7 14 / 16
To conclude Open Source distribution and spreading 4000 downloads per year; Eases the research works; Eases the collaborations; Interesting for teaching; Not an obstacle for industry; Small community; Many contacts with students / academics / engineers. J-L Béchennec et al. (IRCCyN) Trampoline Open Source RTOS Journée ACTRISS, 2012/11/7 15 / 16
To conclude Questions? J-L Béchennec et al. (IRCCyN) Trampoline Open Source RTOS Journée ACTRISS, 2012/11/7 16 / 16