Skip to document

Real-time operating systems

Real-time operating systems
Course

Software Engineering (CSPC 111)

140 Documents
Students shared 140 documents in this course
Academic year: 2022/2023
Uploaded by:
Anonymous Student
This document has been uploaded by a student, just like you, who decided to remain anonymous.
Don Mariano Marcos Memorial State University

Comments

Please sign in or register to post comments.

Preview text

Real-time operating systems

The execution platform for most application systems is an operating system that manages shared resources and provides features such as a file system and runtime process management. However, the extensive functionality in a conventional operating system takes up a great deal of space and slows down the operation of programs. Furthermore, the process management features in the system may not be designed to allow fine-grain control over the scheduling of processes.

For these reasons, standard operating systems, such as Linux and Windows, are not normally used as the execution platform for real-time systems. Very simple embedded systems may be implemented as “bare metal” systems. The systems provide their own execution support and so include system startup and shutdown, process and resource management, and process scheduling. More commonly, however, embedded applications are built on top of a real-time operating system (RTOS), which is an efficient operating system that offers the features needed by real-time systems. Examples of RTOS are Windows Embedded Compact, VxWorks, and RTLinux.

A real-time operating system manages processes and resource allocation for a real-time system. It starts and stops processes so that stimuli can be handled, and it allocates memory and processor resources. The components of an RTOS (Figure 21) depend on the size and complexity of the real-time system being developed.

For all except the simplest systems, they usually include:

  1. A real-time clock  which provides the information required to schedule processes periodically.

  2. If interrupts are supported  an interrupt handler, which manages aperiodic requests for service.

  3. A scheduler  which is responsible for examining the processes that can be executed and for choosing one of these processes for execution.

  4. A resource manager  which allocates appropriate memory and processor resources to processes that have been scheduled for execution.

  5. A dispatcher  which is responsible for starting the execution of processes.

Real-time operating systems for large systems, such as process control or telecommunication systems, may have additional facilities, namely, disk storage management, fault management facilities that detect and report system faults, and a configuration manager that supports the dynamic reconfiguration of real-time applications.

The starting point for timing analysis in a real-time system is the timing requirements, which should set out the deadlines for each required response in the system. Figure 21 shows possible timing requirements for the office building burglar alarm system discussed in Section 21.2. To simplify this example, let us ignore stimuli generated by system testing procedures and external signals to reset the system in the event of a false alarm. This means there are only two types of stimulus processed by the system:

during each process execution, then if there are N sensors of a particular type, you must schedule the process 4N times per second to ensure that all sensors are checked within the deadline.

  1. If you examine four sensors, say, during each process execution, then the execution time is increased to about 4 ms, but you need only run the process N times/second to meet the timing requirement.

In this case, because the system requirements define actions when two or more sensors are positive, the best strategy is to examine sensors in groups, with groups based on the physical proximity of the sensors. If an intruder has entered the building, then it will probably be adjacent sensors that are positive.

When you have completed the timing analysis, you may then annotate the process model with information about frequency of execution and their expected execution time (see Figure 21). Here, periodic processes are annotated with their frequency, processes that are started in response to a stimulus are annotated with R, and the testing process is a background process, annotated with B. This background process only runs when processor time is available. In general, it is simpler to design a system so that there are a small number of process frequencies. The execution times represent the required worst-case execution times of the processes.

The final step in the design process is to design a scheduling system that will ensure that a process will always be scheduled to meet its deadlines. You can only do this if you know the scheduling approaches that are supported by the real-time operating system (OS) used (Burns and Wellings 2009). The scheduler in the real-time OS allocates a process to a processor for a given amount of time. The time can be fixed, or it may vary depending on the priority of the process.

In allocating process priorities, you have to consider the deadlines of each process so that processes with short deadlines receive processor time to meet these deadlines. For

example, the voltage monitor process in the burglar alarm needs to be scheduled so that voltage drops can be detected and a switch made to backup power before the system fails. This should therefore have a higher priority than the processes that check sensor values, as these have fairly relaxed deadlines compared to their expected execution time.

Was this document helpful?

Real-time operating systems

Course: Software Engineering (CSPC 111)

140 Documents
Students shared 140 documents in this course
Was this document helpful?
Real-time operating systems
The execution platform for most application systems is an operating system that
manages shared resources and provides features such as a file system and runtime
process management. However, the extensive functionality in a conventional operating
system takes up a great deal of space and slows down the operation of programs.
Furthermore, the process management features in the system may not be designed to
allow fine-grain control over the scheduling of processes.
For these reasons, standard operating systems, such as Linux and Windows, are not
normally used as the execution platform for real-time systems. Very simple embedded
systems may be implemented as “bare metal” systems. The systems provide their own
execution support and so include system startup and shutdown, process and resource
management, and process scheduling. More commonly, however, embedded
applications are built on top of a real-time operating system (RTOS), which is an
efficient operating system that offers the features needed by real-time systems.
Examples of RTOS are Windows Embedded Compact, VxWorks, and RTLinux.
A real-time operating system manages processes and resource allocation for a real-time
system. It starts and stops processes so that stimuli can be handled, and it allocates
memory and processor resources. The components of an RTOS (Figure 21.18) depend
on the size and complexity of the real-time system being developed.
For all except the simplest systems, they usually include:
1. A real-time clock
which provides the information required to schedule processes
periodically.