Saturday 18 July 2015

Real time Operating System

Real Time Operating System


A real Time Operating System is designed for real time applications, intended to serve real time application requests such applications include embedded systems, industrial robots, scientific research equipment etc.  The operating systems appear to allow multiple programs to execute simultaneously.
 In reality, each processor core can only be running a single thread of execution at any given point in time for example, if we are playing music and browsing internet simultaneously in a single core processor it might appear both are running same time. In reality what happens is that processor execute any one of the above program let's say play music at first for a while and then stop music and execute internet browser for a while then switch back to music and continue this switching between the tasks as shown below. This is called multitasking.



The multitasking in an operating system allow multiple programs(tasks) to execute at a time  and a part of operating system called scheduler is responsible to decide which program to run when, and provides the illusion of simultaneous execution by rapidly switching between each program. The scheduler in an RTOS is designed to provide a predictable execution pattern, scheduler uses priority to know which thread of execution run next. 







The kernel is the central part of an operating system that is responsible for inter task communication, task management and task synchronization. The Real Time Scheduler is the part of the RTOS kernel that is responsible for deciding which task should be executing.


Why RTOS?

There are many reasons why we are using RTOS in embedded systems some of them are:

Meet real-time deadlines:

In a desktop computer a response falling outside of the limit will not render the computer useless. For example, key presses must be visibly registered within a certain time of the key being pressed. Registering a key press outside of this time could result in the system seeming unresponsive, but not unusable. The objectives of real time embedded systems are likely to be quite different to that of desktops especially when the embedded system is expected to provide ‘hard real time’ behavior. Hard real time functions must complete within a given time limit  failure to do so will result in absolute failure of the system. The airbag triggering mechanism in a car is an example, airbag must deploy within a given time limit of an impact. A response falling outside of this time limit can result in the driver sustaining injuries. And let's say another example, controlling switches or valves in a nuclear power plant, a failure or delay of switching may cause to blow up the entire plant. In these type of applications the time is crucial and we have to use real time operating System to ensure the response in time.

Manage complexity:

In real time operating system we are using independed tasks/threads for each functionality, each task is a small program in its own right so that task management, intertask communication and synchronization is easy and more manageable.


Modularity, Cleaner interfaces,Easier testing,Code reusability,Improved efficiency etc.




Real Time Operating System Examples







No comments:

Post a Comment