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 :
- 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.
- 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.
- 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.
Comments on this entry are closed.
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.
Thanks for the write-up.
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.
good article.
qnx (www.qnx.com) for blackberry playbook is unix flavored RTOS.
thanks.
good introduction to RTOS, I finally known what is all about.
good article. like your intro.
thanx for RTOS……!!!!
Ya!Is The Good Notes For All Cs Student Thank You To All
And Also Good Example For Real Time
Thank You…..!!!!!
very goud example
thank you
this very good material for learners:)
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.
thanks for RTOS
nice example…
hiiiii>>>>
thanks to undrstnd rtos best in my lif with gud exmpl
thnks
it s vry clr and gd…..
nice example of airbag
thanks for rtos notes
Excellent Example of Car Accident to understand the concept of RTOS !!!
Thank You Very Much !!!
Thanks for all…to give a. nice notes ….
Thanks for all..! given a valuable intro about RTOS
nice intro……….thank u……………..
nice introduction thank u
i like it, thanks
its good intro ,thank you
Very Good and it is easily understandable..
Thanks for the write – up
Nice example.I learned about RTOS clearly from you.Thanks.
Hi… I get the concept rtos for cat accident concept