Unit-3 - Advanced Operating Systems-23pcsce24-3
Unit-3 - Advanced Operating Systems-23pcsce24-3
an aircraft.
Dr. S.Sivakumar, Assistant Professor, PG Department of Computer Science, C.Mutlur, Chidambaram. 1|Page
ADVANCED OPERATING SYSTEMS
UNIT 3- REAL TIME OPERATING SYSTEM
1. Hard Real-Time Operating System
A hard real-time system has time-critical deadlines that must be met;
otherwise a catastrophic system failure can occur.
Absolutely, positively, first time every time
Requires formal verification/guarantees of being to always meet its
hard deadlines (except for fatal errors).
Examples:
o Air traffic control
o Vehicle subsystems control
o Nuclear power plant control
Functions of RTOS:
Task management
Scheduling.
Resource Allocation.
Interrupt Handling.
Characteristics of RTOS:
Reliability
Scalability
Predictability
Consistency
Performance
Dr. S.Sivakumar, Assistant Professor, PG Department of Computer Science, C.Mutlur, Chidambaram. 2|Page
ADVANCED OPERATING SYSTEMS
UNIT 3- REAL TIME OPERATING SYSTEM
Advantages:
1. Maximum consumption:
o Maximum utilization of devices and systems.
o Thus more output from all the resources.
2. Task Shifting:
o Time assigned for shifting tasks in these systems is very less.
o For example, in older systems, it takes about 10 microseconds.
Shifting one task to another and in the largest systems, it takes 3
microseconds.
3. Focus on Application:
o Focus on running applications and less importance to applications
that are in the queue.
4. Real-Time Operating System in Embedded System:
o Since the size of programs is small, RTOS can also be embedded
systems like in transport and others.
5. Error Free:
o These types of systems are error-free.
6. Memory Allocation:
o Memory allocation is best managed in these types of systems.
Disadvantages:
1. Limited Tasks:
o Very few tasks run simultaneously, and their concentration is very
less on few applications to avoid errors.
2. Use Heavy System Resources:
o Sometimes the system resources are not so good and they are
expensive as well.
3. Complex Algorithms:
o The algorithms are very complex and difficult for the designer to write
on.
4. Device Driver and Interrupt signals:
o It needs specific device drivers and interrupts signals to respond
earliest to interrupts.
5. Thread Priority:
o It is not good to set thread priority as very less prone to switching
tasks.
6. Minimum Switching:
o RTOS performs minimal task switching.
Dr. S.Sivakumar, Assistant Professor, PG Department of Computer Science, C.Mutlur, Chidambaram. 3|Page
ADVANCED OPERATING SYSTEMS
UNIT 3- REAL TIME OPERATING SYSTEM
Applications of RTOS:
1. Industrial Application:
Systems are made real time based so that maximum and accurate
output can be obtained.
In order to such things real-time systems are used in maximum
industrial organizations.
Some of the examples of industrial applications are:
o Automated Car Assembly Plant
o Chemical Plant, etc.,
4. Telecommunication Application:
Real-time systems map the world in such a way that it can be
connected within a short time.
Real-time systems have enabled the whole world to connect via a
medium across internet.
These systems make the people connect with each other in no time and
feel the real environment of togetherness.
Some examples of telecommunication applications of real-time
systems are:
o Video Conferencing,
o Cellular system, etc.,
Dr. S.Sivakumar, Assistant Professor, PG Department of Computer Science, C.Mutlur, Chidambaram. 4|Page
ADVANCED OPERATING SYSTEMS
UNIT 3- REAL TIME OPERATING SYSTEM
5. Defense Applications:
In the new era of atomic world, defense is able to produce the missiles
which have the dangerous powers and have the great destroying
ability.
All these systems are real-time system and it provides the system to
attack and also a system to defend.
Some of the applications of defense using real time systems are:
o Missile guidance system,
o Anti-missile system,
o Satellite missile system, etc.,
6.Aerospace Applications:
The most powerful use of real time system is in aerospace applications.
Basically, hard real-time systems are used in aerospace applications.
Here the delay of even some nano second is not allowed and if it
happens, system fails.
Some of the applications of real-time systems in aerospace are:
o Satellite tracking system,
o Avionics,
o Flight simulation, etc.,
Dr. S.Sivakumar, Assistant Professor, PG Department of Computer Science, C.Mutlur, Chidambaram. 5|Page
ADVANCED OPERATING SYSTEMS
UNIT 3- REAL TIME OPERATING SYSTEM
Here we will discuss a basic model of real
real-time
time system which has some
commonly used terms and hardware.
Following diagram represents a Basic Model of Real-Time
Time System:
System
Sensor:
Sensor is used for the conversion of some physical events or
characteristics into the electrical signals. There are hardware devices
that take the input from environment and gives to the system by
converting it.
For example, a thermometer takes the temperature as physical
characteristic and then converts it into electrical signals for the
system.
Actuator:
Actuator is the reverse device of sensor, where sensor converts the
physical events into electrical signals, actuator d
does
oes the reverse.
It converts the electrical signals into the physical events or
characteristics.
It takes the input from the output interface of the system.
The output from the actuator may be in any form of physical action.
Some of the commonly used ac actuators
tuators are motors and heaters.
1. Time Constraints:
Time constraints related with real-time systems simply means that
time interval allotted for the response of the ongoing program.
This deadline means that the task should be completed within this
time interval.
Real-time system is responsible for the completion of all tasks within
their time intervals.
2. Correctness:
Correctness is one of the prominent Parts of real-time systems.
Real-time systems produce correct result within the given time
interval.
If the result is not obtained within the given time interval, then also
result is not considered correct.
In real-time systems, correctness of result is to obtain correct result in
time constraint.
3. Embedded:
All the real-time systems are embedded now-a-days. Embedded system
means that combination of hardware and software designed for a
specific purpose.
Real-time systems collect the data from the environment and passes to
other components of the system for processing.
4. Safety:
Safety is necessary for any system but real-time systems provide
critical safety.
Real-time systems also can perform for a long time without failures.
It also recovers very soon when failure occurs in the system and it does
not cause any harm to the data and information.
5. Concurrency:
Real-time systems are concurrent that means it can respond to a
several different tasks going on within the system and it responds
accordingly to every task in short intervals.
This makes the real-time systems concurrent systems.
Dr. S.Sivakumar, Assistant Professor, PG Department of Computer Science, C.Mutlur, Chidambaram. 7|Page
ADVANCED OPERATING SYSTEMS
UNIT 3- REAL TIME OPERATING SYSTEM
6. Distributed:
In various real-time systems, all the components of the systems are
connected in a distributed way.
The real-time systems are connected in such a way that different
components are at different geographical locations.
Thus, all the operations of real-time systems are operated in
distributed ways.
7. Stability:
Even when the load is very heavy, real-time systems respond in the
time constraint i.e. real-time systems does not delay the result of tasks
even when there are several tasks going on a same time.
This brings the stability in real-time systems.
8. Fault tolerance:
Real-time systems must be designed to tolerate and recover from faults
or errors.
The system should be able to detect errors and recover from them
without affecting the system’s performance or output.
9. Determinism:
Real-time systems must exhibit deterministic behavior, which means
that the system’s behavior must be predictable and repeatable for a
given input.
The system must always produce the same output for a given input,
regardless of the load or other factors.
10. Real-time communication:
Real-time systems often require real-time communication between
different components or devices.
The system must ensure that communication is reliable, fast, and
secure.
11. Resource management:
Real-time systems must manage their resources efficiently, including
processing power, memory, and input/output devices.
The system must ensure that resources are used optimally to meet the
time constraints and produce correct results.
12. Heterogeneous Environment:
Real-time systems may operate in a heterogeneous environment, where
different components or devices have different characteristics or
capabilities.
The system must be designed to handle these differences and ensure
that all components work together seamlessly.
13. Scalability:
Real-time systems must be scalable, which means that system must be
able to handle varying workloads and increase or decrease its
resources as needed.
14. Security:
Real-time systems may handle sensitive data or operate in critical
environments, which make security a crucial aspect.
The system must ensure that data is protected and access is restricted
to authorized users only.
Dr. S.Sivakumar, Assistant Professor, PG Department of Computer Science, C.Mutlur, Chidambaram. 8|Page
ADVANCED OPERATING SYSTEMS
UNIT 3- REAL TIME OPERATING SYSTEM
Safety and Reliability in Real-Time Operating Systems:
1. Deterministic Behavior:
Safety-critical systems require predictable and deterministic behavior.
RTOS ensures that tasks meet their deadlines consistently, preventing
unpredictable delays that could compromise safety.
2. Fault Tolerance:
RTOS often incorporates fault tolerance mechanisms such as
redundancy, error detection, and error recovery to mitigate the impact
of failures. Redundant components and voting algorithms can be
employed to ensure that critical functions continue even in the
presence of faults.
3. Memory Protection:
Memory protection mechanisms in RTOS prevent tasks from accessing
unauthorized memory regions, reducing the risk of memory
corruption and ensuring the integrity of critical system data.
4. Safety-Critical Certification:
RTOS used in safety-critical applications often undergo rigorous
certification processes, such as DO-178C for avionics software.
These certifications ensure that the RTOS meets specific safety
standards and regulatory requirements.
5. Safety-Critical Features:
RTOS may include specialized features to support safety-critical
applications, such as partitioning, time and space partitioning, and
safety-critical communication protocols.
These features help isolate critical tasks and ensure that they operate
independently of non-critical components.
Dr. S.Sivakumar, Assistant Professor, PG Department of Computer Science, C.Mutlur, Chidambaram. 9|Page
ADVANCED OPERATING SYSTEMS
UNIT 3- REAL TIME OPERATING SYSTEM
Reliability in Real-Time Operating Systems:
2. Resource Management:
Effective resource management mechanisms in RTOS prevent
resource conflicts and ensure fair access to system resources.
Features such as priority inheritance protocols, mutexes, and
semaphores facilitate reliable resource sharing among tasks.
4. Predictable Performance:
RTOS provides predictable performance characteristics, ensuring
consistent response times and minimal variability in task execution.
Deterministic behavior enables developers to analyze and predict
system behavior accurately, enhancing overall system reliability.
Real-time task:
Real-time tasks are the tasks associated with the quantitative expression
of time.
This quantitative expression of time describes the behavior of the real-
time tasks.
Real-time tasks are scheduled to finish all the computation events
involved in it into timing constraint.
The timing constraint related to the real-time tasks is the deadline.
All the real-time tasks need to be completed before the deadline.
For example,
o Input-output interaction with devices
o Web browsing, etc.
Types of Real-Time Tasks:
1. Periodic Task
2. Dynamic Task
3. Critical Task
4. Non-Critical Task
1. Periodic Task:
In periodic tasks, jobs are released at regular intervals.
A periodic task repeats itself after a fixed time interval.
A periodic task is denoted by five tuples: Ti = < Φi, Pi, ei, Di >
o Where,
o Φi: It is the phase of the task, and phase is the release time of the
first job in the task. If the phase is not mentioned, then the release
time of the first job is assumed to be zero.
o Pi: It is the period of the task, i.e., the time interval between the
release times of two consecutive jobs.
o ei: It is the execution time of the task.
o Di: It is the relative deadline of the task.
2. Dynamic Task:
It is a sequential program that is invoked by the occurrence of an
event.
Dynamically arriving tasks can be categorized on their criticality and
knowledge about their occurrence times.
1. Aperiodic Tasks:
In this type of task, jobs are released at arbitrary time intervals.
Aperiodic tasks have soft deadlines or no deadlines.
2. Sporadic Tasks:
They are similar to aperiodic tasks, i.e., they repeat at random
instances.
The only difference is that sporadic tasks have hard deadlines.
Three tuples denote a sporadic task: Ti = (ei, gi, Di)
Task Scheduling:
Real-time task scheduling essentially refers to determining how the
various tasks are the pick for execution by the operating system.
Every operating system relies on one or more task schedulers to prepare
the schedule of execution of various tasks needed to run.
Each task scheduler is characterized by the scheduling algorithm it
employs.
A large number of algorithms for real-time scheduling tasks have so far
been developed.
2. Multicore Scheduling:
AOS supports multicore processors, requiring scalable and efficient
scheduling algorithms to exploit parallelism while meeting real-time
constraints.
Multicore scheduling strategies such as partitioned scheduling, global
scheduling, and asymmetric multiprocessing (AMP) are employed to
balance workload distribution and minimize contention.