Real Time Operating Systems

GCSE Computer Science Resources
14-16 Years Old

48 modules covering every Computer Science topic needed for GCSE level, and each module contains:

  • An editable PowerPoint lesson presentation
  • Editable revision handouts
  • A glossary which covers the key terminologies of the module
  • Topic mindmaps for visualising the key concepts
  • Printable flashcards to help students engage active recall and confidence-based repetition
  • A quiz with accompanying answer key to test knowledge and understanding of the module
View the GCSE Resources →

KS3 Computing Resources
11-14 Years Old

We’ve created 45 modules covering every Computer Science topic needed for KS3 level, and each module contains:

  • An editable PowerPoint lesson presentation
  • Editable revision handouts
  • A glossary which covers the key terminologies of the module
  • Topic mindmaps for visualising the key concepts
  • Printable flashcards to help students engage active recall and confidence-based repetition
  • A quiz with accompanying answer key to test knowledge and understanding of the module
View the KS3 Resources →

Before we dig deep into real time operating system (RTOS), it is good practice to remind ourselves, what an operating system is.

An operating system is the core software, which allows a computer system to operate and execute its command as it was intended to do so.

The operating system manages the user interface, hardware, and all other software components.

Examples of operating systems are Windows, Linux, IOS, MacOS, Unix, Symbian, and Android etc.

Without these operating systems, the platform being used wouldn’t be able to function, and it would just be a collection of components generating heat aimlessly.

Operating systems generally share a number of functions such as:

  • Providing a user interface
  • Managing the computer’s memory
  • Managing the hardware

Computer systems are often intwined into electronic control equipment. They provide the data processing power to handle incoming data. These are known as embedded systems.

For instance, the control unit of the car engine has an embedded computer to handle the aspects of controlling the engine.

Another example would be a washing machine having an embedded system to carry out its specific functionality set by the user, whether its time, number of cycles etc.

All of these devices/systems require a real-time operating system (RTOS). They are designed to handle input data within a guaranteed time, whether it was in microseconds, or minutes, it ultimately depends on the task being carried out.

What Are Real Time Operating Systems?

A Real Time Operating System (RTOS), is considered to be defined as a software component which switches between tasks rapidly. This would give the impression that programs are being executed rapidly at the same time on a single processing core, however in hindsight, the processing core can only execute one single program at one given time, though the benefit of having RTOS is that it does it so quickly (switching between individual programming threads/tasks) which gives the impression to the user that multiple programs are being executed simultaneously. 

A developer is able to set priority to the incoming data streams, this allows the most important signals to be handled first. To accomplish this, it is done using a method called “priority interrupts”.

RTOS are committed to help manage the different hardware resources of general PC and also host the applications that run on the computer.

Important terminology and concepts associated with RTOS:

RTOS can be split into three categories:

Hard Real Time Systems:

  • Hard real time operating systems can never miss their deadline, otherwise if they do, they may result with calamitous consequences. If the function doesn’t meet its deadline, the system will be considered as a failure. The usefulness of a result produced by a hard real time system decreases significantly if it is delayed in its delivery.
  • An example of hard real time systems includes flight controls and medical critical care systems.

Firm Rea Time Systems:

  • These types of systems must also follow a deadline, however in the case they do miss it, the overall impact may not be disastrous, but it could cause undesired effects to the system, for instance, like a huge reduction in quality of a product.
  • Example of this would be various types of multimedia applications.

Soft Real Time Systems:

  • With soft real time systems, the deadline is not extremely strict to the millisecond like hard real time systems. These systems can occasionally miss the deadline with some acceptably low probability. Furthermore, if the deadline is missed with these systems, there is no disastrous consequence that will result from it. However as with hard real time systems, the usefulness of the result decreases over time as the delay increases.
  • An example of soft real time systems includes telephone switches, and online transaction system.

Terminology

Determinism:

  • The term deterministic is associated with a system that runs on a hard real time operating system.

Jitter:

  • Jitter is associated with the amount of error in the timing of a task over subsequent iterations of a program or loop.
  • When programmed correctly, RTOS are designed to produce a low amount of jitter.

Five key features of real time operating systems that must be considered when getting utilised

Reliability:

Any RTOS that gets utilised must be extremely reliable. In RTOS, reliability comes from the operational end of the system. The system must be able to function for a respectively long time without any human interference. In this sense, reliability also refers to the system being able to choose the right or most profitable action for current operations.

Predictability:

A RTOS must be able to execute actions within a specified time frame and produce excepted results. The targets, which get achieved, are set during the production phase or procedural planning.

Performance:

Ultimately as with many other platforms, RTOS are designed to make the work easier. It does so by solving the problems provided, which therefore reduce the workload.

Manageability:

To reduce the cost of implementation, software and hardware associated with RTOS must be manageable (of reasonable size).

Scalability:

RTOS must be able to adapt to downgrades/upgrades, or any modifications. Such provisions must be made during the design phase and installed in any RTOS.

Functionality and features of RTOS include:

  • To be extremely focused on the environment.
  • Requiring special/complex algorithms for speedier processing.
  • RTOS can respond and interact with analog.
  • RTOS are considered to be “reactive” in a harsh environment.
  • RTOS are business compatible and user friendly.

The difference between and General-Purpose Operating System and a Real Time Operating System

The difference between general purpose OS such as Linux, IOS etc. and RTOS found in embedded systems, is the response time to external events. It is true the general purpose OS always try to stay responsive to the user, however they provide a “soft” real time response, which is considered to be non deterministic, as there no real guarantee that each task will get completed.

Whereas RTOS provide what is called a “hard” real time response, thus providing the user  with fast, extremely deterministic reaction to external events.

Setting priorities:

  • Most general purpose operating systems allow the programmer to specify a priority for the overall application and for different tasks when programming applications, moreover these priorities will serve as a signal, dictating which operations the developer feels are most important.
  • However general purpose operating systems don’t follow the programmers priorities very strictly, this is because operating systems are optimised to run a variety of applications and processes at the same time, making sure that all tasks receive at least some processing time. Therefore it ultimately means that some low priority tasks may get an extreme boost in priority, even higher than high priority tasks. This means that some of the developers priorities may not be followed.
  • However in RTOS, the programmers priorities are much more strict, and they must be followed. Meaning a high priority task must be using 100% of the processor and that no other low priority task will operate until the high priority task finishes.

Interrupt latency:

  • Interrupt latency is measured as the amount of time between the device generates an interrupt and when that device is serviced.
  • Operating systems may not respond to an interrupt immediately, whereas RTOS must make sure that all interrupts will be served with a certain deadline.

Performance:

  • While yes it is true that in some case RTOS may provide better performance than general purpose OS due to less multitasking between applications and services, this rule is not completely correct.
  • The actual performance will depend on other peripherals such as CPU speed, memory architecture, program characteristics etc.
  • One thing is for sure though, RTOS can provide more precise and predictable timing characteristics than general-purpose operating systems.

Real Time Operating System characteristics

  • When RTOS are switching between tasks, it has to choose the most appropriate task to load and execute next.
  • In order to do so, there are several scheduling algorithms, which get utilised, including:

Round Robin, Co-operative, and Hybrid scheduling, though the one that is most prominent is: Pre-emptive scheduling algorithm.

Round Robin Scheduling:

  • In a round robin scheduler, each process is given/assigned a fixed time slot, moreover, the process needs to complete its execution, otherwise the task loses its flow and data generation.

Co-operative Scheduling:

  • The task will run, until the execution is completed.

Hybrid Scheduling:

  • The kernel can only be set up in one way, in any one build, this makes sure that all tasks within the same build use the same scheduling policy. This insures that a scheduling policy per task cannot be set.

Pre-emptive Scheduling Algorithm:

  • In this algorithm, each task has a priority value unique to itself. The faster the required response, the higher the priority level assigned. The task, which is being executed, is regarded to be the highest priority task that is able to be executed. This results in a highly responsive system.

Main features of RTOS include:

  • They occupy a very small amount of memory.
  • Consume fewer resources.
  • The response time RTOS are extremely predictable.
  • If a platform was interrupted, the kernel saves the state of the interrupted task and then determines which task should be executed next.

Real Time Operating System Architecture

There are 6 main components in RTOPS, and they are:

Scheduler:

The scheduler in a RTOS tells the system in which order the tasks must be executed. Task order is based on priority.

Symmetric Multiprocessing:

In order for parallel processing to be done, this characteristic encompasses a number of different tasks that the RTOS can handle.

Function Library:

This is an important component in the RTOS as the function library acts as an interface, which aids the developer to connect kernel and application code.

In order for the application to provide the desired results, the kernel receives requests using the function library.

Memory Management:

This component is required in the system to allocate memory to every program. This element is regarded to be one of the most important components in RTOS.

Fast Dispatch Latency:

This component acts as an interval between the termination of a task, which can be identified by the operating system and the actual time taken by the thread, which is in the ready queue that has started processing.

User-Defined Data Objects and Classes:

RTOS makes use of programming languages like C++ or C.

Real Time Operating System Advantages

Maximum Consumption/Improved Efficiency:

  • RTOS allows the system to provide the user with maximum output as it gives maximum consumption to the system, while using the resources and keeping all devices active.
  • There is little or no down time whilst using these systems.
  • RTOS can be entirely event driven, therefore this leads to no processing time to be wasted, which increases efficiency, as the system doesn’t look for events which haven’t occurred.

Task Shifting:

  • In RTOS, there is very little time assigned for time shifting, which results in higher efficiency.

Focus on Application:

  • RTOS focuses its importance on applications, which are operationally running, rather ones which are idle.

Real Time Operating Systems In Embedded Systems:

  • RTOS program size nature is regarded to be small, this allow them to be used in embedded systems.

Error Free:

  • One of RTOS biggest advantages is that it is error free, meaning that when a task is being performed, there is zero chance of an error occurring.

24/7 systems:

  • Due to less task shifting, this gives maximum output, hence allowing systems which utilise RTOS to have the potential to run 24/7.

Priority Based Scheduling:

  • This refers to the scheduler, which is responsible for deciding which task should be executed at a particular time. RTOS has the ability to resume and suspend task at a later time throughout a tasks lifetime.

Modularity:

  • RTOS can be considered to be a modular system, as it separates the core kernel from the middleware, protocols, and applications.
  • This makes development less complex and reduces the memory footprint of the RTOS. This feature in RTOS allows for embedded systems to be made to specific devices, which reduces the strain on RAM and Flash memory.

Easier Testing:

  • Modularity allows for modular task based testing.

Code Reuse:

  • Also due to its modularity, RTOS applications made on a similar platform will lead to a development of a library, which can act as a standard on how tasks can be executed. This will decrease development time, and increase productivity and allow developer to create API’s which can be reused an re-implemented.

Real Time Operating System Disadvantages

Limited Tasks:

  • In an RTOS, there are a very small number of tasks that are executed at the same time. The system concentrates on a few applications to avoid errors.

Uses Heavy System Resources:

  • At times systems resources may not be efficient, and can be expensive.

Low Amount of Multi-Tasking:

  • As mentioned in the first point, RTOS are very limited to a smaller number of tasks, which also means that these systems cannot multitask. Therefore RTOS are not preferred to be used with multi-thread systems because of the poor thread priority.

Complex Algorithms:

  • The algorithms used in RTOS can be extremely complex, which becomes difficult for developers who are trying to edit/modify the algorithm.

Complex Structure:

  • To prevent accidental destruction of data and to protect data from unauthorised access, more controls have to be built into the software and network.

Device Driver and Interrupt Signals:

  • In-order to respond to interrupts in the quickest time possible, RTOS require specific device drivers and interrupt signals.

Thread Priority:

  • RTOS are less likely to switch tasks, therefore a threading priority is not recommended.

Other factors to consider to make the most of the system:

  • RTOS are not independent of the system they operate in, therefore to maximise performance, other factors such as memory, CPU, as well as error handling etc. must be considered.

Expensive:

  • RTOS can be expensive due to them requiring plenty of resources.

Summary and Facts

What Are Real Time Operating Systems?

  • The difference between general purpose OS such as Linux, IOS etc. and RTOS found in embedded systems, is the response time to external events.
  • Real Time Operating Systems (RTOS) are systems that are subjected to real time, meaning that the response should be guaranteed within a specified timing constraint, or the system should meet a specified deadline. Examples are of RTOS systems are: i.e. a washing machine finishing its cleaning cycle, or a flight control system.
  • A RTOS is a time bound system, which has well defined, fixed-time constraints. Processing must be completed within the defined constraints or the system will fail.

There are three types of RTOS:

  • Hard real time system
  • Firm real time system
  • Soft real time system

Five key features of real time operating systems that must be considered when getting utilised:

  • Reliability
  • Predictability
  • Performance
  • Manageability
  • Scalability

Real Time Operating System characteristics:

  • Round Robin Scheduling
  • Co-operative Scheduling
  • Hybrid Scheduling
  • Pre-emptive Scheduling Algorithm

Main features of RTOS include:

  • They occupy a very small amount of memory.
  • Consume fewer resources.
  • The response time RTOS are extremely predictable.
  • If a platform was interrupted, the kernel saves the state of the interrupted task and then determines which task should be executed next.

Why use Real Time Operating Systems?

  • These operating systems offer priority based scheduling, which ultimately allows the separation of analytical processing from non-critical processing.
  • RTOS systems provide API functions, that allow cleaner and smaller application code to be created and reused.
  • There are fewer interdependencies between models due to the abstracting time dependencies and task base designs.
  • Modular task based development is offered by RTOS, which allows modular task based testing.
  • Modular development is encouraged as a task, and clearly defined roles will be provided. This allows developers/teams/designers to work independently on their parts of the project.
  • No time wasting on processing time as RTOS is event driven.

Real Time Operating System Architecture:

  • There are 6 main components in RTOPS, and they are:
    • Scheduler
    • Symmetric Multiprocessing
    • Function Library
    • Memory Management
    • Fast Dispatch Latency
    • User-Defined Data Objects and Classes

Real Time Operating System Advantages:

  • Maximum Consumption/Improved Efficiency
  • Task Shifting
  • Focus on Application
  • Real Time Operating Systems In Embedded Systems
  • Error Free
  • 24/7 systems
  • Priority Based Scheduling
  • Modularity
  • Easier Testing
  • Code Reuse
  • Improved Efficiency

Real Time Operating System Disadvantages:

  • Limited Tasks
  • Uses Heavy System Resources
  • Low Amount of Multi-Tasking
  • Complex Algorithms
  • Complex Structure
  • Device Driver and Interrupt Signals
  • Thread Priority
  • Other factors to consider to make the most of the system
  • Expensive

Examples of Real Time Operating Systems:

  • Airline reservation system
  • Air traffic control system
  • A system that provides immediate updating
  • Any system which provides live information on stock prices
  • Defence application systems, like RADAR.
  • Network multimedia systems
  • Command control systems
  • Anti-lock brake system
  • Heart pacemaker

References:

  1. https://ukdiss.com/examples/real-time-operating-systems-advantages-disadvantages.php
  2. http://www.itrelease.com/2014/07/advantages-disadvantages-real-time-operating-systems/
  3. https://www.guru99.com/real-time-operating-system.html
  4. https://www.highintegritysystems.com/rtos/what-is-an-rtos/
  5. https://en.wikipedia.org/wiki/Real-time_operating_system
  6. https://en.wikipedia.org/wiki/Real-time_operating_system
  7. https://www.ni.com/en-gb/innovations/white-papers/07/what-is-a-real-time-operating-system–rtos–.html
  8. https://www.freertos.org/about-RTOS.html
  9. https://www.geeksforgeeks.org/real-time-systems/
  10. https://en.wikipedia.org/wiki/Concurrency_(computer_science)
  11. https://www.intervalzero.com/rtos/6-advantages-of-real-time-software/
  12. https://en.wikipedia.org/wiki/Operating_system
  13. https://edu.gcfglobal.org/en/computerbasics/understanding-operating-systems/1/
  14. http://circuitstoday.com/gpos-versus-rtos-for-an-embedded-system
  15. https://rootleveltech.com/difference-in-a-rtos-and-a-gpos/

Leave a Comment