Real-time operating system:-




 Operating system:-


 ➢ It is an interface between the user and the hardware. 

 ➢ It is software that performs all basic tasks like file management, memory management, process management, handling input/output devices, and controlling peripheral devices such as disk drives and printers.


Operating system:-




Real-time operating system 


 ➢ It is an operating system that is planned to serve real-time applications that processes the data as it comes in without buffer delay. 

➢ It has a very short processing time. 

➢ A key characteristic of an RTOS is labeled of its consistency, conserving the amount of time it takes to accept and complete an application task.

  The kernel:-

 ➢ The kernel is the core of the operating system. 

 ➢ Kernel is responsible for managing the system resources. 

 ➢ The communication among the hardware and other system services.




Tasks performed by Kernel 

 ➢ Process management : 

 ➢ A program or a part of the program in execution is called Process. 

 ➢ Managing these processes is known as Process Management. 

 ➢ It includes setting up memory spaces for the process, loading the process's code into memory space, allocating system resources, and terminating the process.

➢ Memory management : 

➢ It performs the task : 

1. Keeping track of memory areas utilized by different processes at different times. 

2. Dynamic memory allocation and deallocation.


➢ File system management : 

➢ File is a collection of related information. 

➢ A file is a program of text files, image files, word documents, and audio/video files. 

➢ The creation, deletion, and alteration of files. 

➢ Saving of files in the secondary storage memory. Tasks performed by Kernel 


➢ Device management : 

➢ Device can be either an input or output device. 

➢ It is used to communicate between different input/output devices. 

➢ It performs the task: 

1. Loading and unloading of device drivers. 

2. Exchanging information between devices.


➢ Secondary storage management : 


➢ It deals with managing secondary storage memory devices. 

➢ Disk storage allocation. 

➢ Free disk space management.  


Types of RTOS 

 The classification of RTOS is based on the important factor “ Time”. 


❖ Hard RTOS: 

➢ RTOS that needs to follow a timeline very strictly is hard RTOS. 

➢ ABS needs to respond in real-time without delay. 

➢ A late response in such a system can be fatal and these systems are preferred as Mission critical systems. 

➢ It does not use virtual memory.


❖ Soft RTOS: 

➢ RTOS that does not meet the time deadlines are Soft RTOS. 

➢ The time delay should be in a specific range and this range is known as quality of service. 

➢ ATM can be an example of SRTOS.


real-time characteristics 


 ➢ In real-time systems, especially hard real-time systems, the timely response of the system is absolutely essential. 

➢ As the design of a real-time embedded system is mission-critical, designers need to know about its performance and behavior. 


❖ Real-time and Reactive operation : 

➢ The time taken by a real-time operating system to respond to an event is crucial. 

➢ Worst case performance is the maximum time taken by the processor/controller to start the Interrupt service routine. 

➢ This is known as Maximum ISR Latency. 

➢ This should be the minimum for a good embedded system.


❖ Deterministic Nature 

➢ If the Worst case performance time is known, the system can be better designed. 

➢ The deterministic nature of RTOS leads to a design with perfectly calculated worst-case response time and interrupt latency. 

➢ Interrupt latency is the total time taken from an interrupt signal’s arrival at the processor to the start of the associated ISR. 


❖ Time required to Perform Context Switch 

 ➢ It is the time taken by the microcontroller to switch between two execution sequences. 

 ➢ The primary program and the secondary ISR. 

 ➢ This time is processor specific and will vary from one processor to another. 

 ➢ Minimum context switch time will make a better real-time operating system. 


❖ I/O Device Flexibility 

➢ Compatibility of RTOS with more I/O devices and device drivers make the system versatile.



The selection process of an RTOS:-

➢ Several real-time embedded systems are available. 

➢ Choosing the correct RTOS is a crucial task. 

➢ The RTOS selected will play a major role in the performance of the embedded system. 

➢ Several factors need to be analyzed before the selection of RTOS. 

➢ There will be Functional and Non-Functional needs to be considered for selecting the correct RTOS. 



Functional requirements 

 ➢ Processor Support : 

 ➢ It is essential that the RTOS be selected to support the processor or controller. 

 ➢ Processor architecture should be accessible by the RTOS selected. 

 ➢ Memory Requirements : 

 ➢ OS requires RAM to load the services provided and ROM to store OS files. 

 ➢ Adequate size of RAM and ROM required for the RTOS should be available in the hardware of the system. 

 ➢ RTOS will not function efficiently if these requirements are not satisfied.


➢ Real-time capabilities : 

➢ It is important that ES should respond to real-time events.  

➢ Kernel and Interrupt Latency : 

➢ Interrupt latency or the time required for the interrupt service routine to start execution, plays a key role in calculating the crucial response time of an ES. 

➢ Kernel can enable, disable and set priorities of interrupt and are essential components of RTOS selection.


➢ Support for networking and communication : 

➢ It depends upon the RTOS selected, which communication devices can be used for interfacing and networking. 

➢ The interfaces required by the ES should be accessible by the RTOS to be selected 

➢ Development Language Support: 

➢ Certain OS includes runtime libraries for running applications written in certain languages.   



Non Functional requirements 

➢ Custom developed or Off The Shelf: 

➢ OS developed for a specific ES can only be used for that system. 

➢ OS can be developed using open-source software. 

➢ Another option is to use any ready-made available OS. 

➢ This ready-made product is said to be off the shelf product. 


➢ Cost: 

 ➢ Before choosing an OS, the total cost of buying and maintaining the OS has to be taken into account.


➢ Development and Debugging Tool Availability : 

➢ Embedded program development tools are the ones responsible for programming the ES. 

➢ OS used must support these development tools. 

➢ Ease of Use: 

➢ Ease to use and user-friendly interface and commands are other important factor to be considered in the choice of RTOS.


➢ After sales : 

 ➢ For commercial RTOS, support after sale and implementation are critical. 

 ➢ The entire ES is designed, developed as per the custom design, and deployed. 

 ➢ After investing cost and resources into this system, users expect the system to last long. 

 ➢ Hence the factor of after-sale support is an important factor in the decision-making of RTOS.


Real-time operating systems (RTOS) are commonly used in embedded systems to provide reliable, deterministic, and predictable performance. Embedded systems are typically used in applications where there is a need for a dedicated, customized, and specialized computer system to perform specific functions.

An RTOS in an embedded system provides several benefits, including:

  1. Predictability: An RTOS ensures that tasks are executed within specified time frames, providing predictable performance for real-time applications.

  2. Efficiency: An RTOS is designed to run on embedded systems with limited resources, such as memory and processing power, providing efficient performance.

  3. Task management: An RTOS provides a mechanism for task management, allowing for the scheduling and prioritization of tasks, and ensuring that tasks are executed promptly.

  4. Interrupt handling: An RTOS provides a mechanism for interrupt handling, allowing the system to respond quickly to external events, such as sensor inputs or user interactions.

  5. Debugging: An RTOS provides tools for debugging and testing, allowing developers to identify and fix issues in real-time applications.

RTOSes are used in a wide range of embedded systems, including automotive systems, industrial control systems, medical devices, and telecommunications equipment. For example, an RTOS may be used in a medical device to ensure that a specific function is performed within a specified time frame, such as delivering a dose of medication to a patient. In an automotive system, an RTOS may be used to control the engine and transmission and to manage the operation of safety features such as airbags.

Overall, an RTOS is an important component of many embedded systems, providing the necessary functionality and performance required for real-time applications.





In addition to the benefits mentioned earlier, real-time operating systems (RTOS) also provide several other advantages in embedded systems:

  1. Modularity: An RTOS provides a modular approach to software development, allowing developers to break down complex applications into smaller, more manageable components. This approach makes it easier to develop and maintain software in embedded systems.

  2. Safety and reliability: RTOSes provide a mechanism for isolating and protecting critical system functions from non-critical functions. This helps to ensure the safety and reliability of the system.

  3. Portability: RTOSes are designed to be highly portable, allowing the same software to be run on different hardware platforms with minimal modifications. This provides flexibility in designing embedded systems that can be used across different devices and applications.

  4. Customizability: RTOSes are highly customizable, allowing developers to tailor the system to meet the specific requirements of their application. This includes customizing the scheduling algorithm, task management, and memory allocation.

  5. Scalability: RTOSes are designed to be scalable, allowing developers to add or remove components as required without affecting the overall performance of the system. This makes it easy to expand the capabilities of an embedded system over time.

Overall, real-time operating systems provide a reliable and efficient mechanism for developing embedded systems with real-time requirements. The modularity, safety, portability, customizability, and scalability of RTOSes make them a popular choice for a wide range of applications, including automotive, industrial, medical, and telecommunications systems.


RTOSes typically use a preemptive scheduling algorithm to ensure that tasks are executed promptly. This means that the RTOS can preempt a lower-priority task to allow a higher-priority task to execute. This approach ensures that real-time tasks are executed on time, even in the presence of other non-real-time tasks.

The scheduling algorithm used in an RTOS is critical to ensuring the system meets its real-time requirements. Common scheduling algorithms used in RTOSes include fixed-priority preemptive scheduling, round-robin scheduling, and earliest-deadline first scheduling.


In addition to scheduling, RTOSes provide several other services that are important for embedded systems. These include:


  1. Interrupt handling: An RTOS provides a mechanism for handling interrupts promptly. Interrupts are used to signal events to the system, such as sensor inputs or user interactions.

  2. Memory management: An RTOS provides a mechanism for managing memory in embedded systems. This includes allocating and deallocating memory for tasks, as well as ensuring that memory is used efficiently.

  3. Communication services: An RTOS provides a mechanism for inter-task communication in embedded systems. This includes message queues, semaphores, and other synchronization mechanisms.

  4. Device drivers: An RTOS provides device drivers for communicating with hardware devices, such as sensors, actuators, and communication interfaces.

  5. Debugging and testing: An RTOS provides tools for debugging and testing embedded systems, including performance analysis, profiling, and trace analysis.

Overall, RTOSes provide a comprehensive set of services for developing embedded systems with real-time requirements. The preemptive scheduling algorithm, interrupt handling, memory management, communication services, device drivers, and debugging tools provided by RTOSes make them essential components of many embedded systems.




Real-time operating systems (RTOS) have several advantages in embedded systems, including:

  1. Deterministic response time: RTOSes are designed to provide deterministic response times, which means that the time it takes for a task to be executed is known and predictable. This is important in real-time systems where tasks need to be executed within specific time constraints.

  2. Priority-based scheduling: RTOSes use priority-based scheduling, which means that higher-priority tasks are executed before lower-priority tasks. This ensures that real-time tasks are executed on time, even in the presence of other non-real-time tasks.

  3. Modularity: RTOSes provide a modular approach to software development, allowing developers to break down complex applications into smaller, more manageable components. This approach makes it easier to develop and maintain software in embedded systems.

Here are some important points to consider regarding real-time operating systems (RTOS) in embedded systems:

  1. Deterministic Timing: One of the most crucial aspects of an RTOS is its ability to provide deterministic timing guarantees. It ensures that tasks and operations are executed within specific time constraints, allowing for reliable and predictable system behavior.

  2. Task Synchronization and Communication: RTOS provides mechanisms for task synchronization and communication. This allows tasks to coordinate their activities, share data, and communicate with each other in a controlled and reliable manner.

  3. Interrupt Handling: RTOS incorporates efficient interrupt handling mechanisms. It allows for the quick and precise response to external events or hardware interrupts. Interrupt service routines (ISRs) are executed in a timely manner to handle the interrupts and provide the necessary functionality.

  4. Resource Management: Efficient resource management is essential in embedded systems. RTOS includes mechanisms for managing system resources such as CPU time, memory, peripherals, and I/O devices. It ensures that resources are allocated and utilized optimally, preventing resource conflicts and maximizing system efficiency.

  5. Kernel Services: RTOS provides a set of kernel services, which are low-level functions and APIs for task management, memory management, synchronization, timers, and I/O operations. These services form the foundation for application development and enable developers to interact with the underlying system effectively.

  6. Real-Time Constraints: RTOS allows the specification and enforcement of real-time constraints. It enables developers to define deadlines, time constraints, and timing requirements for tasks and operations. The system ensures that these constraints are met, and tasks are executed within their specified time limits.

  7. System Monitoring and Diagnostics: RTOS often includes built-in monitoring and diagnostics capabilities. It allows developers to monitor the system's performance, track resource usage, detect errors or faults, and perform debugging and profiling activities. This aids in system optimization, troubleshooting, and maintenance.

  8. Scalability and Portability: RTOS should be scalable to accommodate systems of different sizes and complexities. It should be portable across various hardware platforms, allowing developers to reuse code and applications on different embedded systems.

  9. Safety and Security: In safety-critical applications, such as automotive or medical devices, RTOS may include safety features and certification standards compliance (e.g., IEC 61508, ISO 26262). It may also provide security mechanisms to protect against unauthorized access and ensure data integrity.

  10. Power Management: Embedded systems often operate on limited power sources, such as batteries. RTOS may incorporate power management techniques, including power-saving modes, dynamic frequency scaling, and intelligent resource allocation, to optimize power consumption and extend battery life.

These points highlight the key considerations and features of real-time operating systems in embedded systems. It's important to choose an RTOS that aligns with the specific requirements and constraints of the target embedded application.

  1. Safety and reliability: RTOSes provide a mechanism for isolating and protecting critical system functions from non-critical functions. This helps to ensure the safety and reliability of the system.

  2. Portability: RTOSes are designed to be highly portable, allowing the same software to be run on different hardware platforms with minimal modifications. This provides flexibility in designing embedded systems that can be used across different devices and applications.

  3. Customizability: RTOSes are highly customizable, allowing developers to tailor the system to meet the specific requirements of their application. This includes customizing the scheduling algorithm, task management, and memory allocation.

  4. Scalability: RTOSes are designed to be scalable, allowing developers to add or remove components as required without affecting the overall performance of the system. This makes it easy to expand the capabilities of an embedded system over time.

Overall, real-time operating systems provide a reliable and efficient mechanism for developing embedded systems with real-time requirements. The deterministic response time, priority-based scheduling, modularity, safety and reliability, portability, customizability, and scalability of RTOSes make them a popular choice for a wide range of applications, including automotive, industrial, medical, and telecommunications systems.



While real-time operating systems (RTOS) have many advantages in embedded systems, there are also some disadvantages to consider:


  1. Complexity: RTOSes can be complex and difficult to develop and maintain, particularly for small embedded systems. The additional overhead of the operating system can also reduce system performance.

  2. Cost: RTOSes can be expensive, particularly for commercial systems that require licensing fees. This can be a significant barrier for small developers or hobbyists.

  3. Resource requirements: RTOSes can require significant system resources, including memory and processing power. This can limit the types of embedded systems that can effectively use an RTOS.

  4. Lack of flexibility: While RTOSes are highly customizable, they may not be flexible enough to meet the specific requirements of every application. This can lead to additional development time and costs to modify the operating system or develop custom software.

  5. Real-time performance limitations: While RTOSes are designed to provide deterministic response times, there are limitations to how fast tasks can be executed and how quickly interrupts can be processed. This can impact the real-time performance of the system.

  6. Training requirements: Developing and using an RTOS often requires specialized knowledge and training. This can be a barrier for developers who are not familiar with real-time systems or who do not have access to the necessary resources.

Overall, while RTOSes are well-suited for many embedded systems, there are some drawbacks to consider. The complexity, cost, resource requirements, lack of flexibility, real-time performance limitations, and training requirements of RTOSes should be carefully evaluated before deciding to use an RTOS in an embedded system.


A real-time operating system (RTOS) is an operating system specifically designed for embedded systems that require deterministic and timely execution of tasks. Unlike general-purpose operating systems, such as Windows or Linux, RTOS focuses on providing precise timing guarantees and efficient resource management for time-critical applications.

Here are some key characteristics of a real-time operating system in the context of embedded systems:

  1. Determinism: An RTOS is designed to provide deterministic behavior, ensuring that tasks and operations are executed within specific time constraints. This deterministic behavior is essential for applications where timing is critical, such as control systems, robotics, or aerospace.

  2. Task Scheduling: RTOS employs priority-based scheduling algorithms to determine the order in which tasks should be executed. Tasks with higher priorities are scheduled to run first, ensuring that critical tasks receive sufficient processing time. Preemptive scheduling is commonly used, allowing higher priority tasks to interrupt lower priority tasks when necessary.

  3. Interrupt Handling: RTOS provides efficient mechanisms for handling interrupts. Interrupt service routines (ISRs) are used to respond to external events promptly. ISRs are typically short and prioritize execution to minimize interrupt latency.

  4. Resource Management: Embedded systems often have limited resources, such as CPU power, memory, and I/O devices. RTOS incorporates resource management techniques to allocate and control these resources efficiently. It provides mechanisms for task synchronization, inter-task communication, and resource sharing, ensuring that tasks can safely interact with shared resources without conflicts.

  5. Timers and Clocks: RTOS includes built-in timer and clock management mechanisms to handle time-critical operations accurately. It allows tasks to be triggered at precise intervals or specific points in time.

  6. Small Footprint: Embedded systems often have limited memory and processing power. RTOS is designed to have a small memory footprint and low overhead, making it suitable for resource-constrained environments.

  7. Reliability and Fault Tolerance: RTOS emphasizes robustness and reliability. It provides mechanisms for error handling, fault tolerance, and system recovery. Features like watchdog timers are commonly included to detect and recover from system failures.

Popular RTOS options for embedded systems include FreeRTOS, VxWorks, QNX, ThreadX, and uC/OS-II/uC/OS-III. These RTOS offerings provide various features, scalability options, and support for different hardware architectures.

Overall, an RTOS is a critical component of many embedded systems, enabling precise control, deterministic behavior, and efficient resource management necessary for real-time applications.