BlogNewsTop News

Creating real-time ready systems with ACRN and Ubuntu

By April 1, 2020No Comments

Written by Alfonso Sanchez-Beato, Software Engineer at Canonical

Sometimes you really need a deterministic response time in your system. For example, a robotic arm that needs to be at the right place at exactly the right time, and you cannot avoid the need for a hard real-time (RT) operating system. But, that is only a small part of your software, and for the rest, you do not have that requirement. The options you have at that point are:

  1. Do everything from the RTOS
  2. Have two separate processors, one handling RT tasks and the other handling the non-RT payload

In the first case, development costs increase due to the more complex development environment, and you miss the convenience, update ability and high throughput of a regular Linux installation. In the second case, hardware and development costs increase due to the custom hardware set-up and the interactions between the two hardware pieces.

However, this scenario is starting to change thanks to advances in hypervisor technologies. For instance, ACRN, a Linux Foundation project, is an open-source type one hypervisor that has been developed to address the unique needs of IoT development. It opens the door to safety-critical and real-time payloads while sharing the device with OSs’ like Ubuntu and Android.

ACRN allows you to split resources amongst different operating systems. You can assign CPU cores and chunks of memory to different operating systems to make sure that RT parts are always on time, while maximum throughput is still available for the rest of the system. Reliability of the system is also assured: one OS can crash while the others are unaffected. ACRN is highly customisable and you can use it in different configurations. VMs with a different OS can launch at boot, or later as needed by the main OS (the ‘service’ OS) or the user.

ACRN and Ubuntu Demo with Zephyr

At Embedded World 2020, we showed Ubuntu running in parallel with the real-time OS Zephyr, on top of ACRN. Zephyr is an RTOS developed under the Linux Foundation umbrella and backed by industry leaders like Intel, NXP and Linaro. It supports a wide range of hardware, from MCUs to x86 boards. For the demo, we use an Intel NUC where we reserve a core and a small amount of memory for Zephyr. Ubuntu 18.04 then uses the rest of the systems resources. ACRN takes control of the system on boot and then starts Zephyr and Ubuntu. We show how Zephyr is able to perform calculations at a constant rate, unaffected by the additional Ubuntu payload. Isolation of the two operating systems is guaranteed as fatal events on one OS do not affect the other, which shows the readiness for safety-critical systems.

Demo in action: Zephyr output on the small display, Ubuntu on the big one

We expect this type of set-up to be more and more common in the future. Canonical is ready to help you in this journey to cheaper, safer, and more updatable mixed-criticality systems. Contact us to know more!