RTOS (Real time operating system)

RTOS
(Real Time Operating System)

Before proceeding to RTOS, we need to have a brief idea of the following terms.

An Operating System is a system software which acts as an interface between the user/application and the hardware of the computer.

This is crudely done as follows;

  • User interacts with the Computer system generally using some Application Software.
  • The Application Software then interacts with the Operating System and makes it the desired request to achieve the necessary task from the hardware.
  • The Operating System then interacts with the Hardware or necessary resource to achieve the desired task.

Real time: The actual time in which the process or events occur. Something similar to live-telecast of television.
Example: We watch football match or a cricket match live (i.e. in real time)

Interrupt (in Computer Science): An interrupt is a computer signal from your computer’s hardware-device to the CPU and is usually generated when any I/O is required.
There are basically two kinds of interrupts – Hardware interrupts, Software interrupts

  • Hardware interrupts are generated when any key is pressed, when the mouse is used (like it is moved, clicked,....), etc
  • Software interrupts are generated by a program requiring disk input/output, printer usage, etc.

RTOS | Computer Programming for Beginners | https://pradeepsir4students.blogspot.com

Event Driven Systems (in computer science): An event-driven System is a computer program/application that is written to respond to actions generated by the user or the system. Here an event is any identifiable occurrence that has significance for system hardware or software.
Example: When we press an electric-switch, its state changes from ON to OFF or from OFF to ON, these changes in state can be read by a computer system as an EVENT (or EVENTS). If the event/events has/have an associated program/programs, then it would trigger/invoke the respective program into execution. This is roughly what an Event-driven System means.

Time Sharing (in computer Science): It is the sharing of a resources among multiple users by means of multiprogramming and multi-tasking simultaneously.
It allows a large number of users to interact simultaneously with a single computer.

The basic idea of Time-sharing is that, when a single user is using a computer-system such as a PC, he/she inputs/outputs a large chunk of data/information at a very short time-interval, followed by a long pause before the next similar task. This is an ideal time for most of the computer resources including the CPU.
Example: When we are reading a web-page on the internet, our computer-system almost remains idle, until we hit a link, click a button, or browse for another page.


RTOS | Computer Programming for Beginners | https://pradeepsir4students.blogspot.com

TOP

Time-sharing thus allows multiple users to log-on to the same computer system and work simultaneously by utilising the ideal time between tasks of each user for the other needy users. Thus, the computer system stays less idle, and can be utilised to a greater potential.

Latency (in computer science): It is a delay before a transfer of data begins following an instruction for its transfer. That is, Latency is the time-lag between an instruction of data transfer and the beginning of the actual data transfer.

Latency also refers to time-lag or delay when a computer-system component is waiting for another computer-system component to do something. This time-lag is called latency.

In Operating System, Latency is the time-lag between a specific process-instruction and the moment when the relevant hardware actual achieves the task requested by the instruction.

Latency are of various kinds – network latency, operating system latency, interrupt latency, thread switching latency, etc.

Interrupt Latency: It is the time-lag between the interrupt generation by an entity of the system and the moment when the source-entity is serviced.
The shorter the interrupt latency, the faster will the interrupts be processed.
It depends upon various parameters of the computer system, on of them is the manner in which the operating system manages the interrupt requests (IRQs).

RTOS | Computer Programming for Beginners | https://pradeepsir4students.blogspot.com

Thread Switching Latency: It is the time required by the operating system in switching from one thread execution to another thread execution.
In order to switch execution from one thread to another, the OS must first copy/save all the data of the current thread into the memory and only then can it load the execution data of another thread from the memory. Thus thread switching latency indirectly depends upon how quickly an operating system can transfer the thread’s data to and from the memory.

Throughput: It is the amount of work (i.e. jobs, tasks or the amount of data processed) that can be performed or the amount of output that can be produced by a computer system or its component in a given period of time. Higher the throughput the better/faster is the operating system.
Throughput also depends upon several factors. Such as – CPU, OS performance, memory-size, etc.

Pre-emptive Scheduling Algorithm: In this kind of resource (mainly the CPU) sharing/utilisation, the processes requiring the resources (like CPU) are prioritised. On the basis of their priorities they are allocated the resource (like CPU).
The resources (mainly CPU cycles) are allocated to the process for the small amount of time and then is taken away generally when a more prioritised process is encountered, and the old incomplete process is again placed back in the ready queue if that process still has CPU time left.

RTOS | Computer Programming for Beginners | https://pradeepsir4students.blogspot.com

TOP

RTOS (Real Time Operating System)

A real-time operating system (RTOS) is any operating system (OS) intended to serve real-time applications that process data in real time (i.e. as it comes in), without buffer delays. A real time system is a time bound system which has well defined fixed time constraints. Processing must be done within the defined constraints or the system will fail.

What kind of systems should use RTOS?
The systems where failure to respond within a very-short pre-determined interval of time might always or mostly lead to catastrophic results like death of one or more individual; will require the use of RTOS.

RTOSs either are event driven or time sharing. Event driven systems switch between tasks based on their priorities while time sharing systems switch the task based on clock interrupts. Most RTOS’s use a pre-emptive scheduling algorithm.

A key characteristic of an RTOS is the level of its consistency concerning the amount of time it takes to accept and complete an application's task. Based on this, they are broadly classified into two types. Namely – Hard RTOS and Soft RTOS.

A hard RTOS processes the requests / tasks each time deterministically in a specified time frame consistently. Very rarely, if the time constraint is not met, then the process fails.
They are used in places where failure to meet response time deadline might lead to catastrophic (i.e. very very dangerous) situations.
Example: Nuclear systems, pacemaker, avionics (i.e. electronic systems of aircrafts), defence systems, aircraft control systems, etc.

RTOS | Computer Programming for Beginners | https://pradeepsir4students.blogspot.com

A soft RTOS on the other hand processes the requests / tasks most of the time in a specified time frame. They are used in places where failure to meet the response time deadline occasionally does not have any serious consequences, but of course frequent failures could be catastrophic / very dangerous.
Example: Computer’s sound system, multimedia, interactive video-games, Seismic sensors, most modern general Oss like windows 7, 10 can also behave as a soft RTOS, some parts of banking system, etc.

An RTOS has an advanced algorithm for scheduling generally using pre-emptive schedule algorithm. A real-time OS is more frequently dedicated to a narrow set of applications.

Key factors in a real-time OS are minimal interrupt latency and minimal thread switching latency. A real-time OS is valued more for how quickly and how predictably it can respond than for the amount of work it can perform in a given period of time i.e. it should have a lower latency even if it compromises slightly on throughput.

RTOS | Computer Programming for Beginners | https://pradeepsir4students.blogspot.com

TOP

No comments:

Post a Comment

Note: only a member of this blog may post a comment.