Real-time operating systems rely on kernel designs to expedite process communication and synchronization functionalities.

How to Design a Real-Time Operating System (RTOS)

Contributed by | IntervalZero

Most operating systems are put together based on kernel designs. Kernel design has been used for almost 4 decades because it separates the operating system from the different applications running on it. The different applications are allocated in different memory locations. The OS processes utilize kernel functionality through conducting system calls. System calls are software interrupts that allow users to switch from the operating system to applications and vice versa. Therefore, the kernel must install an interrupt handler that tackles different modes of operation in order to ensure effective switches. The interrupt handler is enabled in the program status (i.e., the supervisor mode and user mode). As such, protection is conducted on the modern system on a chip (SoCs) at the peripheral side. However, some processor registers can be changed if the CPU indicates a particular execution mode like master mode through additional HW signals.

rtos

All processes outside the operating system are implemented within the user mode and cannot execute any instructions availed in supervisor mode only. Meaning that user mode instructions hold a non-critical subset of instructions under the supervisor mode. During a process runtime, the supervisor mode under the PSW is disabled and only gets enabled once an interrupt like external interrupt or system call occurs. The OS activates the user mode once the user process is activated. Note that, a user process contains a virtual memory address space that separates it from the kernel entirely. However, this feature is only available to embedded microcontrollers that constitute a memory management unit that allows the use of virtual memory. Virtual memory usage must be upheld without other unbound memory accesses such as swapping on an external disk or changing (TLB) translation lookaside buffer entries by examining a dynamically sized page table.

To utilize the functionality offered by the OS kernel design, you must identify an interface that allows applications to run effectively while using it. The interface is known as the application binary interface (ABI). ABI delineates a registered usage convention, a set of system calls, a stack layout and facilitates binary compatibility. On the other hand, an API (application programming interface) facilitates source code compatibility by defining a set of function signatures that offer a fixed interface for calling the required functions. The kernel can have many designs, but it must provide basic activities like; process communication, process synchronization, process management and interrupt handling.

Process management ensures that process termination, creation, dispatching, scheduling, and switching context among other related activities run as required. In a real-time operating system, interrupt handling differs from the standardized implementation of a regular operating system. Interrupts in regular operating systems can preempt all running processes unexpectedly. This leads to unbound delays that are intolerable in a real-time operating system. As such, handling of interruptions is assimilated into the scheduler so that it is scheduled along with other important processes and feasibility is guaranteed even when interruption requests are made.

 

Summary

Real-time operating systems rely on kernel designs to expedite process communication and synchronization functionalities. Note that, ordinary semaphores cannot be used within a real-time operating system because the caller may experience unacceptable delays in case a priority inversion problem occurs. Hence, the synchronization mechanism must support a resource access protocol like; priority ceiling, priority inheritance or stack resource policy. You can use a microkernel, monolithic kernel or hybrid kernel based on your RTOS needs.

 

The content & opinions in this article are the author’s and do not necessarily represent the views of RoboticsTomorrow

Comments (2)

This article will give a new way to the developers to create a new operating system or to change and edit on their currently running OS. iphone support thinks this is the future of developing. Apart from Kernel which is being used for more than four decades.

Thanks for sharing a blog on RTOS Training. Designing a Real Time Project will helps to make address space available. With the help of RTOS Training Program you will lean all concepts from Basic to Advanced Level.

Post A Comment

You must be logged in before you can post a comment. Login now.

Featured Product

3D Vision: Ensenso B now also available as a mono version!

3D Vision: Ensenso B now also available as a mono version!

This compact 3D camera series combines a very short working distance, a large field of view and a high depth of field - perfect for bin picking applications. With its ability to capture multiple objects over a large area, it can help robots empty containers more efficiently. Now available from IDS Imaging Development Systems. In the color version of the Ensenso B, the stereo system is equipped with two RGB image sensors. This saves additional sensors and reduces installation space and hardware costs. Now, you can also choose your model to be equipped with two 5 MP mono sensors, achieving impressively high spatial precision. With enhanced sharpness and accuracy, you can tackle applications where absolute precision is essential. The great strength of the Ensenso B lies in the very precise detection of objects at close range. It offers a wide field of view and an impressively high depth of field. This means that the area in which an object is in focus is unusually large. At a distance of 30 centimetres between the camera and the object, the Z-accuracy is approx. 0.1 millimetres. The maximum working distance is 2 meters. This 3D camera series complies with protection class IP65/67 and is ideal for use in industrial environments.