Real Time Operating System (RTOS)

Hasan Can Özbek
8 min readJan 4, 2024

--

OPERATING SYSTEMS

When we look inside a computer, we see only a stack of semiconductor circuits. The circuits can only do one thing. For example, if you design a circuit that unlocks a door, you can only use it to unlock the door. If you want to use this circuit to lock the door, you will see that it does not even have such a capability. Because circuits are structures created for special purposes.

But we use computers (even though they are made of similar circuits) to do many things in our daily lives. It is obvious that circuits do not provide us with this flexibility.

The software that manages the computer hardware in a way that allows us to give different inputs and get different outputs, and acts as a translator between end users and the hardware, is called an operating system.

Operating system lies in the category of system software. It basically manages all the resources of the computer. An operating system acts as an interface between the software and the computer hardware. The operating system is designed in such a way that it can manage the overall resources and operations of the computer.

Operating system is a fully integrated set of specialized programs that handle all the operations of the computer. It controls and monitors the execution of all other programs that reside in the computer, which also includes application programs and other system software of the computer. Examples of general purpose operating systems are Windows, Linux, Mac OS, etc.

An operating system (OS) is a collection of software that manages computer hardware resources and provides common services for computer programs. The operating system is the most important type of system software in a computer system.

Functions of the Operating System

Resource Management: The operating system manages and allocates memory, CPU time, and other hardware resources among the various programs and processes running on the computer.

Process Management: The operating system is responsible for starting, stopping, and managing processes and programs. It also controls the scheduling of processes and allocates resources to them.

Memory Management: The operating system manages the computer’s primary memory and provides mechanisms for optimizing memory usage.

Security: The operating system provides a secure environment for the user, applications, and data by implementing security policies and mechanisms such as access controls and encryption.

Job Accounting: It keeps track of time and resources used by various jobs or users.

File Management: The operating system is responsible for organizing and managing the file system, including the creation, deletion, and manipulation of files and directories.

Device Management: The operating system manages input/output devices such as printers, keyboards, mice, and displays. It provides the necessary drivers and interfaces to enable communication between the devices and the computer.

Networking: The operating system provides networking capabilities such as establishing and managing network connections, handling network protocols, and sharing resources such as printers and files over a network.

User Interface: The operating system provides a user interface that enables users to interact with the computer system. This can be a Graphical User Interface (GUI), a Command-Line Interface (CLI), or a combination of both.

Backup and Recovery: The operating system provides mechanisms for backing up data and recovering it in case of system failures, errors, or disasters.

Virtualization: The operating system provides virtualization capabilities that allow multiple operating systems or applications to run on a single physical machine. This can enable efficient use of resources and flexibility in managing workloads.

Performance Monitoring: The operating system provides tools for monitoring and optimizing system performance, including identifying bottlenecks, optimizing resource usage, and analyzing system logs and metrics.

Time-Sharing: The operating system enables multiple users to share a computer system and its resources simultaneously by providing time-sharing mechanisms that allocate resources fairly and efficiently.

System Calls: The operating system provides a set of system calls that enable applications to interact with the operating system and access its resources. System calls provide a standardized interface between applications and the operating system, enabling portability and compatibility across different hardware and software platforms.

Error-detecting Aids: These contain methods that include the production of dumps, traces, error messages, and other debugging and error-detecting methods.

There are many types of operating systems. In this article, we will discuss one of them, the real-time operating system (RTOS).

REAL TİME OPERATING SYSTEM

Real-time operating systems (RTOS) are used in environments where a large number of events, mostly external to the computer system, must be accepted and processed in a short time or within certain deadlines. such applications are industrial control, telephone switching equipment, flight control, and real-time simulations. With an RTOS, the processing time is measured in tenths of seconds. This system is time-bound and has a fixed deadline. The processing in this type of system must occur within the specified constraints. Otherwise, This will lead to system failure.

Examples of real-time operating systems are airline traffic control systems, command control systems, airline reservation systems, heart pacemakers, network multimedia systems, robots, etc.

The real-time operating systems can be of 3 types:

Hard Real-Time Operating System: These operating systems guarantee that critical tasks are completed within a range of time.

For example, a robot is hired to weld a car body. If the robot welds too early or too late, the car cannot be sold, so it is a hard real-time system that requires complete car welding by the robot hardly on time., scientific experiments, medical imaging systems, industrial control systems, weapon systems, robots, air traffic control systems, etc.

Soft Real-Time Operating System: This operating system provides some relaxation in the time limit.

For example — Multimedia systems, digital audio systems, etc. Explicit, programmer-defined, and controlled processes are encountered in real-time systems.

A separate process is changed by handling a single external event. The process is activated upon the occurrence of the related event signaled by an interrupt.

Multitasking operation is accomplished by scheduling processes for execution independently of each other. Each process is assigned a certain level of priority that corresponds to the relative importance of the event that it services. The processor is allocated to the highest-priority processes. This type of schedule, called, priority-based preemptive scheduling is used by real-time systems.

Firm Real-time Operating System: RTOS of this type have to follow deadlines as well. In spite of its small impact, missing a deadline can have unintended consequences, including a reduction in the quality of the product. Example: Multimedia applications.

Advantages Of Real-Time Operating Systems

· Maximum consumption: Maximum utilization of devices and systems. Thus more output from all the resources.

· Task Shifting: Time assigned for shifting tasks in these systems is very less. For example, in older systems, it takes about 10 microseconds. Shifting one task to another and in the latest systems, it takes 3 microseconds.

· Focus On Application: Focus on running applications and less importance to applications that are in the queue.

· Real-Time Operating System In Embedded System: Since the size of programs is small, RTOS can also be embedded systems like in transport and others.

· Error Free: These types of systems are error-free.

· Memory Allocation: Memory allocation is best managed in these types of systems.

Disadvantages Of Real-Time Operating Systems:

The disadvantages of real-time operating systems are as follows-

· Limited Tasks: Very few tasks run simultaneously, and their concentration is very less on few applications to avoid errors.

· Use Heavy System Resources: Sometimes the system resources are not so good and they are expensive as well.

· Complex Algorithms: The algorithms are very complex and difficult for the designer to write on.

· Device Driver And Interrupt Signals: It needs specific device drivers and interrupts signals to respond earliest to interrupts.

· Thread Priority: It is not good to set thread priority as these systems are very less prone to switching tasks.

· Minimum Switching: RTOS performs minimal task switching.

Regular OS Vs Real Time OS

ARINC 653

ARINC 653 stands for Avionics Application Software Standard Interface. It is a software standard for real-time operating systems (RTOS) used in aviation systems.

Its objectives are the following:

Security: To protect against software errors and interruptions in critical avionics systems.

Performance: Ensure stable and predictable system operation to meet real-time requirements.

· Isolation: To separate software of different security levels and ensure that a failure or delay in one does not affect the other.

ARINC 653 defines the following key features:

· Partitioning: Dividing application software into separate partitions. Each partition has its own resources (processor, memory, peripherals) and priorities. This means that failure in one partition does not affect other partitions.

· Scheduling: The mechanism that ensures that application software completes certain tasks within a certain period of time. It is very important for the proper functioning of the system.

· Access control: The system for restricting and regulating application software access to resources and data. Critical for security and error prevention.

· Error handling: The mechanism that determines how the application software reacts when an error occurs. Improves the reliability of the system.

· Memory management: The system that determines how application software uses memory. It ensures that sufficient memory is provided and memory utilization is efficient.

ARINC 653 is a crucial standard for ensuring safety and performance in aviation systems. It is often used in critical applications such as flight control systems, navigation systems and communication systems.

POSIX

POSIX, or “Portable Operating System Interface for Unix”, is a standard for operating systems. It can be thought of as a set of rules that basically govern how the system can be accessed by programmers and what functions it can provide.

The main purpose of POSIX is to ensure program portability. That is, a program written on a POSIX-compliant operating system can be easily run on any other POSIX-compliant system, and can be ported with minimal or no changes. This way, developers can more easily adapt their code to different platforms.

So, what functions does POSIX cover? This is actually quite a broad spectrum:

· File System Access: Basic file system operations such as creating, reading, writing, deleting files and directories.

· Process Management: Process creation, termination, pause, etc.

· Memory Management: Includes mechanisms such as memory allocation, release, protection.

· I/O Management: Supports communication with peripherals such as keyboard, screen, disk, network.

· Signal Management: Signaling mechanism used to report and manage system and program errors.

· Time Management: Provides functions such as date and time information, timers.

· Text Processing: Provides text processing tools such as regular expressions, arrays, memory management.

· Mathematical Functions: Provides basic mathematical and trigonometric functions.

This is only a fraction of the functions that POSIX provides. In total, the POSIX standard provides a very comprehensive framework, and most operating systems perform their basic functions through this standard.

So, what are the benefits of POSIX?

· Code Portability: Makes it easy to port code across different platforms.

· Standardization: Improves compatibility between different operating systems.

· Ease of Development: Provides a common API for programmers and reduces learning time.

· Code Quality: Using a standard interface also improves code quality.

Overall, POSIX is a very useful standard for programmers. It ensures code portability, compatibility with different platforms and simplifies the development process.

--

--