Porting A Real-Time Operating System for Embedded IoT Devices to Linux as Part of the OpenSwarm Project

Luiz Sampaio, Kate O’Riordan, Dara O’Sullivan, Brian Coffey, Thomas Watteyne

 

2nd International Workshop on MetaOS for the Cloud-Edge-IoT Continuum (MECC 2025), Rotterdam, NL, 31st March 2025.

Abstract: The Horizon Europe OpenSwarm project develops the next generation swarm devices; those are deeply embedded and use real-time operating systems. These real-time operating systems fulfill strong real-time requirements needed by protocol stacks. However, as the OpenSwarm use cases are complex, development cycles become longer and more costly, and application developers require better tools to increase productivity. This paper introduces the port of 𝜇C/OS-II to Linux, enabling quick prototyping of RTOS applications on a controlled environment without the need to continuously reflash microcontrollers to test and debug. Additionally, it allows applications to leverage existing tools in a Linux environment. We present an improved interrupt context switch implementation than the default port, ensuring that interrupts on Linux run to completion, mimicking bare metal behavior. Moreover, we measure the interrupt response, recovery and context switch latencies for both bare metal and Linux version of 𝜇C/OS-II. The worst-case time for context switch on Linux is 396.5 𝜇s, the mean value is 391.1 𝜇s with a standard deviation of 4.68 𝜇s.