What is RTOS? – Real Time Operating Systems Basics

by Himanshu Arora on February 6, 2012

Suppose a person is driving a car on a highway at a speed of 70 miles per hour. Now, somehow the car meets with an accident. Fortunately the airbag deployed at the right time and saved the life of the driver.

So, we see that airbag is a very good feature in a car which can save a life someday. But, did we think what would have happened if the airbag would have deployed a few seconds late? Yes, we would have lost a life. So just imagine the dependency on the accuracy of opening of the airbag.

So, what makes that airbag deploy at the right time? Well, welcome to the world of RTOS.

RTOS stands for Real time operating systems.

In modern times we have seen an evolution of embedded systems. Nowadays embedded systems can be found all around us. Be it on cellphones, air conditioners, digital homes, cars etc. Little we realize their contribution in making our life comfortable and safe. Safety is one aspect in which we are now depending more and more on these computerized embedded systems. The heart of these systems is the OS they use. Most of these systems use RTOS.

What is an RTOS?

As the name suggests, there is a deadline associated with tasks and an RTOS adheres to this deadline as missing a deadline can cause affects ranging from undesired to catastrophic. The example we discussed in the beginning of this article is an example of catastrophic affect of an RTOS missing a deadline.

As discussed above that the embedded systems are becoming more and more complex today and with each passing generation their intrusion in our daily lives will become deeper. This means they will bear more and more responsibilities on their shoulders to solve real time problems to make our life easier. But, this requires more and more complex real time applications that RTOS will have to manage effectively.

Some of the most widely used RTOS are :

  • LynxOS
  • OSE
  • QNX
  • RTLinux
  • VxWorks
  • Windows CE

Classification of RTOS

RTOS can be classified into three types :

  1. Hard RTOS : These type of RTOS strictly adhere to the deadline associated with the tasks. Missing on a deadline can have catastrophic affects. The air-bag example we discussed in the beginning of this article is example of a hard RTOS as missing a deadline there could cause a life.
  2. Firm RTOS : These type of RTOS are also required to adhere to the deadlines because missing a deadline may not cause a catastrophic affect but could cause undesired affects, like a huge reduction in quality of a product which is highly undesired.
  3. Soft RTOS  :  In these type of RTOS, missing a deadline is acceptable. For example On-line Databases.

Features of RTOS

An RTOS must be designed in a way that it should strike a balance between supporting a rich feature set for development and deployment of real time applications and not compromising on the deadlines and predictability.

The following points describe the features of an RTOS (Note that this list is not exhaustive) :

  • Context switching latency should be short. This means that the time taken while saving the context of current task and then switching over to another task should be short.
  • The time taken between executing the last instruction of an interrupted task and executing the first instruction of interrupt handler should be predictable and short. This is also known as interrupt latency.
  • Similarly the time taken between executing the last instruction of the interrupt handler and executing the next task should also be short and predictable. This is also known as interrupt dispatch latency.
  • Reliable and time bound inter process mechanisms should be in place for processes to communicate with each other in a timely manner.
  • An RTOS should have support for multitasking and task preemption. Preemption means to switch from a currently executing task to a high priority task ready and waiting to be executed.
  • Real time Operating systems but support kernel preemption where-in a process in kernel can be preempted by some other process.

Some Misconceptions related to RTOS

  • RTOS should be fast. This is not true. An RTOS should have a deterministic behavior in terms of deadlines but its not true that the processing speed of an RTOS is fast. This ability of responsiveness of an RTOS does not mean that they are fast.
  • All RTOS are same. As already discussed we have three types of RTOS (Hard, firm and soft).
  • RTOS cause considerable amount of CPU overhead. Well, again this is not true. Only 1%-4% of CPU time is required by an RTOS.

In the future article of the RTOS series, we will discuss in detail about the architecture of an RTOS.


Linux Sysadmin Course Linux provides several powerful administrative tools and utilities which will help you to manage your systems effectively. If you don’t know what these tools are and how to use them, you could be spending lot of time trying to perform even the basic administrative tasks. The focus of this course is to help you understand system administration tools, which will help you to become an effective Linux system administrator.
Get the Linux Sysadmin Course Now!

If you enjoyed this article, you might also like..

  1. 50 Linux Sysadmin Tutorials
  2. 50 Most Frequently Used Linux Commands (With Examples)
  3. Top 25 Best Linux Performance Monitoring and Debugging Tools
  4. Mommy, I found it! – 15 Practical Linux Find Command Examples
  5. Linux 101 Hacks 2nd Edition eBook Linux 101 Hacks Book

Bash 101 Hacks Book Sed and Awk 101 Hacks Book Nagios Core 3 Book Vim 101 Hacks Book

{ 17 comments… read them below or add one }

1 Alan Smith February 6, 2012 at 5:30 am

Where does an OS become realtime?

HP NonStop machines can process thousands of transactions per second.
Now that is pretty fast, but not classed as realtime.

2 Russell February 6, 2012 at 10:22 am

Thanks for the write-up.

3 Matteo February 7, 2012 at 4:49 am

Good and deep intro.
However, the airbag example is a bit misleading, and gives the opportunity to clarify: most people, upon hearing the RTOS name, think about “low-latency”, which is the case for the airbag system. You don’t expect the airbag sensor to be activated, but you must be able to respond to it with bounded latency. An RTOS is not necessarily low-latency, but it needs to be low-jitter: the tasks could be scheduled to run every hour, but you must be dead sure that it will really be every hour. Of course, the ability to be low-latency helps a lot, since you can be sure that when your once-an-hour timer elapses, you will be able to preempt anything you’re doing and serve it in bounded time, but it’s not a mandatory feature. Schedulability theorems and real-time schedulers will help you determine if your system can schedule the periodic tasks you’re planning to run, be it once every microsecond or every hour, like a PID control or a sensor data logger.

4 Ron February 7, 2012 at 8:43 am

good article.

qnx (www.qnx.com) for blackberry playbook is unix flavored RTOS.

thanks.

5 bartek February 8, 2012 at 3:23 pm

good introduction to RTOS, I finally known what is all about.

6 ramsse February 8, 2012 at 6:32 pm

good article. like your intro.

7 manisha July 16, 2012 at 8:14 am

thanx for RTOS……!!!!

8 Rajeswari August 6, 2012 at 7:18 am

Ya!Is The Good Notes For All Cs Student Thank You To All
And Also Good Example For Real Time
Thank You…..!!!!!

9 sreenivas August 14, 2012 at 12:37 am

very goud example
thank you

10 MANJUNATH September 25, 2012 at 9:01 am

this very good material for learners:)

11 Moyeedul January 12, 2013 at 10:43 pm

A real-time system is an embedded system that takes in real signals from the outside world as inputs to the system. These systems have to be real-time in order to deal with real signals.

12 Shabnam January 13, 2013 at 1:18 am

thanks for RTOS
nice example…

13 sapan yadav April 30, 2013 at 11:51 pm

hiiiii>>>>
thanks to undrstnd rtos best in my lif with gud exmpl
thnks

14 yuvin September 24, 2013 at 12:00 am

it s vry clr and gd…..

15 nitin nakum October 3, 2013 at 2:46 am

nice example of airbag

16 Ambu February 13, 2014 at 3:12 am

thanks for rtos notes

17 Prashant Pounikar April 13, 2014 at 1:37 am

Excellent Example of Car Accident to understand the concept of RTOS !!!
Thank You Very Much !!!

Leave a Comment

Previous post:

Next post: