Real Time Linux Project Revitalized
Written by Harry Fairhead   
Tuesday, 27 October 2015

More and more microcontrollers are nothing of the sort - they are full machines running Linux. However, a powerful processor isn't enough you also need the OS to let you take advantage of it in real time. 

 

linuxfoundationbanner

If you are developing code for embedded hardware then often there is no operating system to get in the way and you are in complete control of the processor. This is simple and its often cheap but it suffers from a number of drawbacks. If you want your device to join the Internet of Things IoT then you generally need sophisticated services like WiFi and Bluetooth not to mention a file system. 

As a result there is a trend for small microcontrollers, typified by the Arduino, to be replaced by complete systems on a chip such as the Raspberry Pi or the Intel Edison. These are much more powerful, but to supply the services they run something like Linux. As time passes the Linux based controller is likely to become the norm for all but the most simple of requirements. But there is a problem. 

If you have the processor all to yourself then you can determine, what happens and when. Subject to the processor being fast enough you can set how long  process takes and always be ready to receive input or send output to the real world. This is real time processing at its simplest. However if you have an operating system like Linux between you and the processor then you don't get to determine what happens when. The operating system can suspend your program at any time it needs to use the processor for something else. You can no longer guarantee how long a process might take. This can be a serious problem if for example your program is supposed to respond to an emergency condition and it isn't running because a system service has a higher priority. 

Hence you need a real time version of Linux and this something that a number of people have worked on for some time. 

Real Time Linux development was rolled into the mainline Linux kernel in 2.6.22 back in 2006. It introduced two real time scheduling algorithms that were almost enough to make Linux real time but not quite. Usually it is referred to as "soft realtime" to make the distinction between what it does and the requirements of a "hard realtime" system with guarantees of service times. 

Oddly many programmers don't realize that this is the case and still go off looking for a replacement for Linux that is more real time. Of course there are some applications for which soft realtime isn't good enough. To meet this need the Linux Foundation recently announced the new Real-Time Linux Collaborative Project with backing from  Google, National Instruments, OSADL, Texas Instruments, Altera, ARM, Intel and IBM.

So what is the project going to add to Linux?

The answer seems to be real time preemption and a high resolution timer layer. The key idea is that the highest priority task gets to run, even if this means preempting an operating system task. This is aimed at reducing the latency of thread switching from an unbounded milliseconds wait to microseconds.

This doesn't quite provide guarantees on service times, because there are parts of the Linux system which are not preemptable, and hence the wait could be longer than promised in the worst case.  In other words, there are still going to be people calling it "soft" rather than "hard" realtime because it still isn't deterministic. However, the majority of applications can live with real time preemption and this makes Linux much more attractive on small systems.

tuxicon

More Information

The Linux Foundation Announces Project to Advance Real-Time Linux

Real-Time

Related Articles

Exploring Edison - Almost Real Time Linux 

GNU Hurd 0.6 Released

 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on, Twitter, FacebookGoogle+ or Linkedin

 

Banner


Microsoft Introduces Vector Abstractions Library For .NET
21/11/2024

Microsoft has announced a preview release of the Microsoft Extensions VectorData Abstractions library, which can be used to help integrate vector stores into .NET applications and libraries.



pg_parquet - Postgres To Parquet Interoperability
28/11/2024

pg_parquet is a new extension by Crunchy Data that allows a PostgreSQL instance to work with Parquet files. With pg_duckdb, pg_analytics and pg_mooncake all of which can access Parquet files, is  [ ... ]


More News

 

espbook

 

Comments




or email your comment to: comments@i-programmer.info

 

Last Updated ( Tuesday, 27 October 2015 )