All About Real-Time Operating Systems for Embedded Applications

0
547

An embedded application is software that is placed permanently inside a device to perform a particular set of functions. Examples of standalone embedded systems include Digital Cameras, Digital Wristwatches, MP3 players and appliances such as Refrigerators, Washing Machines, and Microwave Ovens, Temperature Measurement Systems and Calculators. In this article, we will try to learn about Real-Time Operating Systems for Embedded Applications.

Typically, embedded computing systems are essential to the operation of electronic devices and systems across a wide range of industries. They consist of both computer hardware and software components, which combined are designed to perform a specific task within a more extensive mechanical or electrical system. Mobile embedded systems are small-sized systems that are designed to be portable. Digital Cameras are an example of this. Networked embedded systems are connected to a network to provide output to other systems. Examples include Home Security Systems and Point of Sale (PoS) systems.

Embedded systems consist of a microcontroller with on-board memory, a power supply, and communication ports for transmitting data to other devices. Embedded software programs tell the microcontroller how to respond in real time to data collected from the environment through peripheral sensors and devices.

Developers use a variety of programming languages in embedded systems. The most used languages include C, C++, Python, MicroPython, and Java.

An operating system is a program that serves as a bridge between the system hardware and the user. Furthermore, it manages all interactions between system software and hardware. Real-time is a guaranteed level of computer responsiveness within a specified time constraint, usually milliseconds or microseconds, between an event and its response deadline. Real-time describes a human sense of time (rather than machine time) that seems immediate.

Real-time features are technological advancements that enable people to have a real-time experience. If someone sends us a WhatsApp message, we expect to receive it immediately. If we order meals, we want to know when they will arrive, and if we book a cab using an app, we want to know where the vehicle is at the moment.  

A real-time operating system (RTOS) is an operating system intended to serve real-time applications that process data as it comes in. Real-time systems are concurrent which means they can respond to several processes at a time. The most widely used embedded operating system is embedded Linux. Yotco is the most popular of the embedded Linux systems. Other popular embedded operating systems include Android, FreeRTOS, QNX, and VxWorks.

An embedded system is often hidden inside a device such that the user does not interact directly with the embedded system itself. Embedded systems typically receive input from sensors or a connected data source instead of directly from the user. In the context of embedded systems, engineers implement real-time computing by installing a special type of operating system onto the embedded device. Operating systems can be conceptualized as the bridge between embedded hardware and software. 

Real-time embedded systems combine the functionality of a real-time operating system with a microcontroller (hardware) and unique application (software) to solve a problem. There are three types of RTOS that differ in function based on the time constraints associated with their application.

Hard RTOS – A hard RTOS is implemented when it is crucial that no deadlines are missed and all tasks are completed within the prescribed time frame. In a hard RTOS, delays in the system are strictly time-bound to ensure that deadlines are met at a 100% rate and any missed deadline is considered a system failure.

As an example, consider the airbag in a conventional family sedan. When the vehicle stops abruptly in the case of a collision, the airbag must be deployed in a split second to be effective for passengers. This means that the embedded microcontroller which controls the airbags must detect that a collision is happening and electronically trigger the release of vehicle airbags – all in just a fraction of a second. This capability is made possible by the technology of real-time computing.

Firm RTOS – In a firm RTOS, errors are occasionally permissible but there is an understanding that missed deadlines result in degraded performance of the device. A device using a firm RTOS may occasionally miss a deadline, but the application can recover as long as failures are relatively infrequent. 

Consider a video game console that runs a game engine. It must schedule tasks and complete them on time for the game to run smoothly, but a little bit of lag or an occasional hiccup in performance does not necessarily ruin the experience for the player. 

Soft RTOS – In a soft RTOS, user experience is optimized when tasks are completed on-time but performance is not totally degraded when deadlines are missed.

A cardiac pacemaker could be an example of a soft real-time embedded system. Pace-makers control the heartbeat by sending electronic pulses to the heart when the attached electrical nodes detect cardiac arrhythmia in the patient. The electrical pulses help the patient’s heart return to a normal beating pattern. While pacemakers provide a necessary and life-saving function, they can function effectively even while missing the occasional task deadline.

Here are important differences between GPOS and RTOS:

General-Purpose Operating System (GPOS)Real-Time Operating System (RTOS)
It is used for desktop PC and laptops.It is only applied to the embedded application.
Process-based Scheduling.Time-based scheduling is used like round-robin scheduling.
Interrupt latency is not considered as important as in RTOS.Interrupt lag is minimal, and is measured in a few microseconds.
No priority inversion mechanism is present in the system.The priority inversion mechanism is current. So it can not modify by the system.
Kernel’s operation may or may not be preempted.Kernel’s operation can be preempted.
Priority inversion remains unnoticedNo predictability guarantees

About the author:

Seema Joshi has been in the industry for the last 28 years, working on core design development for various Embedded Systems requiring RTOS. She has successfully completed various projects working on RTOS with Embedded Systems as the core.