0% found this document useful (0 votes)
4 views54 pages

RTOS Session1

The document discusses real-time operating systems, focusing on typical applications, characteristics, and the distinction between hard and soft real-time systems. It highlights the importance of meeting timing constraints in various contexts, such as digital control, signal processing, and real-time databases. Additionally, it emphasizes the need for correctness in both functional and timing aspects of real-time systems.

Uploaded by

purushotham
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views54 pages

RTOS Session1

The document discusses real-time operating systems, focusing on typical applications, characteristics, and the distinction between hard and soft real-time systems. It highlights the importance of meeting timing constraints in various contexts, such as digital control, signal processing, and real-time databases. Additionally, it emphasizes the need for correctness in both functional and timing aspects of real-time systems.

Uploaded by

purushotham
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 54

SEWP ZG524

Real - Time Operating Systems

Typical Real – Time Applications


Hard v/s Soft Real – Time Systems

Purushotham BV
[email protected]
1
Agenda
1. Typical Real - Time Applications
1.1 Digital Control
1.2 High Level Controls
1.3 Signal Processing
1.4 Other Real – Time Applications
2. Hard v/s Soft Real – Time Systems
2.1 Jobs and Processors
2.2 Release Times, Deadlines, and Timing Constraints
2.3 Hard and Soft Timing Constraints
2.4 Hard Real – Time Systems
2.5 Soft Real – Time Systems
• Summary

2
Introduction: Real-Time System

• Real-time
– Does not denote speed/fast
– But meet the timing constraints or deadlines
• A real-time system must deliver services in a timely
manner
– Not necessarily fast, but must meet some timing deadline
• Many real-time and embedded systems exist, often
without the awareness of their users
– Washing machine, photocopier, mobile phone, car, aircraft,
industrial plant, microwave oven, toothbrush, CD player,
medical devices, etc.
3
Introduction: Real-Time System (Contd.,)

• Must be able to validate real-time systems for


correctness
– Some embedded real-time systems are safety critical – i.e. if
they do not complete on a timely basis, serious
consequences result
– Bugs in embedded real-time systems are often difficult or
expensive to fix

4
Introduction: Real-Time System (Contd.,)

• Real-time system
Respond to external events in a timely fashion and the response time is
guaranteed

5
Introduction: Real-Time System (Contd.,)

• Responding to external events includes


– Recognize when an event occurs
– Perform the required processing
– Output the result within a given time constraint

• Timing constraints include


– Finish time
– Both start time and finish time

6
Introduction: Real-Time System (Contd.,)

• The structure of a real-time system is a controlling


system and at least one controlled system

Controlling
System

input output
Controlled Controlled
System System
Controlled
System

output input
7
Real-Time Systems (Contd.,)

• The controlling system interacts with the controlled system


in various ways
– The interaction can be periodic
• The controlling system -> the controlled system
• Predictable and occurs at predefined intervals
– The interaction can be aperiodic
• The controlled system -> the controlling system
• Unpredictable from random occurrences of external events
– The communication can be a combination of both types
• The controlling system must process and respond to the
events and information generated by the controlled system in
a guaranteed time frame.
8
Real-Time Systems Examples

• Real-time weapons defense system


– Controlling system
• A command-and-decision (C&D) system
– Controlled system
• A radar system
• Weapons firing control system
– Communication between the radar system and C&D system
is aperiodic
– Communication between the C&D system and the weapon
firing control system is periodic

9
Real-Time Systems Examples (Contd.,)

• Cruise missile guidance system


– Controlling system
• Navigation system: contain digital maps covering the missile flight
path
– Controlled system
• Radar system
• Divert-and-altitude-control system
– Communication between radars and the navigation system is
aperidoic
– Communication between the navigation system and the
diver-and-altitude-control system is periodic

10
Real-Time Systems Examples (Contd.,)

• DVD player
– Controlling system
• DVD player must decode both the video and audio streams from the
disc simultaneously.

– Controlled system
• Remote control is viewed as a sensor to feed pause and language
selection events into DVD player

11
Characteristics of Real-Time Systems

• Characteristics
– Must produce correct computational results, called logical
or functional correctness
– These computations must conclude within a predefined
period, called timing correctness

• The overall correctness of a real-time system depends


on both the functional correctness and the timing
correctness

12
Representative Classes of Real-Time and
Embedded System
• Digital control
– Sampled data systems
• High-level controls
– Planning and policy above low level control
• Signal processing
– Digital filtering, video compression & encryption, radar
signal processing
• Other real-time applications
– Real-time databases, multimedia applications

13
Digital Control

• Plant refers to controlled system e.g. an engine, brake.


• The state of the plant is monitored by sensors and can be
changed by actuators.
• The RTS estimates from the sensor readings the current state
and the desired state.
• This is called as control – law computation of the controller

14
Digital Control (Contd.,)

• Controlling some device (plant using an actuator,


based on sampled sensor data
– y(t) is the measured state of the plant
– r(t) is the desired state of the plant
– Calculate control output u(t) as a function of y(t) and r(t), or
e(t) = r(t) - y(t).

15
Digital Control Applications

• Many real-time systems are embedded in sensors and actuators and


function as digital controllers.
• The state of the controlled system is monitored by sensors and can
be changed by actuators.
• The real-time computing system estimates from the sensor readings
the current state of the system and computes a control output based
on the difference between the current state and the desired state.
• The computed output controls the actuators which bring the system
closer to the desired state.

16
Sampled Data Systems

• Before digital computers were widely used,


analogue controllers were used to control systems.
• A common approach to designing a digital
controller is to start with a suitable analogue
controller.
• The analogue version is transformed into a digital
(discrete time, discrete state) version.
• The resultant controller is a sampled data system.

17
Inside a Sampled Data System
• Periodically the analogue sensors are sampled (read)
and the readings digitized.
• Each period the control-law computations are carried
out on the digitized readings.
• The computed digital results are then converted back
to an analogue form needed for the actuators.
• This sequence of operations is repeated periodically.

18
Computing the Control Law for a
Sampled Data System

• Many control systems require knowledge of not just the


current sensor readings, but also some past history.
• For instance it may be necessary to know not only the
position of some part of the controlled system, but also its
velocity and perhaps its acceleration.
• Often the control laws may take the form of differential
equations. It may be necessary to have derivatives or
integrals of measured readings.

19
Effect of Sampling Period

• Positions are represented


by 0 & 1
• Time origin is r(t)
• Output u(t) of the analog
controller is given by
dashed lines
• Observed position y(t) is
function of time
• Fig a – analog
• Fig b & c – digital
20
Jitter

• In some cases the response time of the computation can


vary from period to period.
• In some systems it is necessary to keep this variation
small so that digital control outputs are available at
instants more regularly spaced in time.
• In such cases we may impose a timing jitter requirement
on the control-law computation.
• The variation in response time (jitter) does not exceed
some threshold.

21
More Complex Control-law
Computations
• The simplicity of our digital controller depends on three
assumptions:
1. Sensors give accurate estimates of the state-variable values
being monitored and controlled. This is not always true given
noise or other factors.
2. Sensor data give the state of the system. In general sensors
monitor some observable attributes and the values of state
variables have to be computed from the measured values.
3. All parameters representing the dynamics of the system are
known.

22
A More Complex Digital Controller

• set timer to interrupt periodically with period T;


• At each clock interrupt do

• The last 2 steps in the loop increase processing time.

23
A More Complex Digital Controller (Contd.,)

• Deadbeat Control
• A discrete time control scheme that has no continuous
time equivalence is called deadbeat control.

• Kalman Filter
• Used to improve the accuracy of measurements and to
estimate model parameters in the presence of noise and
uncertainity.
24
High-Level Controls

• Controllers in complex systems are typically organized


hierarchically.
• One or more digital controllers at the lowest level
directly control the physical system.
• Each output of a higher-level controller is an input of
one or more lower-level controllers.
• Usually one or more of the higher-level controllers
interfaces with the operator.

25
Examples of Control Hierarchy

• A patient care system in a hospital.


– Low-level controllers handling blood pressure, respiration, glucose, etc.
– High-level controller, e.g. an expert system which interacts with the
doctor to choose desired values for the low-level controllers to maintain.
• The hierarchy of flight control, avionics and air-traffic control
systems.
– The air-traffic control system is at the highest level.
– The flight management system chooses the flight paths etc. and sets
parameters for the lower level controllers.
– The flight controller at the lowest level handles cruise speed, turn radius,
ascend/descend rates etc.

26
Examples of Control Hierarchy (Contd.,)

• A more complex example of


hierarchy of control is Air Traffic
Control (ATC)

27
Guidance and Control
• Digital controller deals with some dynamic behavior of the physical
plant
• A second level perform typically guidance and path planning functions
• It tries to find one of the most desirable trajectories among all the
trajectories that meet the constraints of the system.
• The trajectory is most desirable because it optimizes cost functions as
the algorithm used for finding the solution generates optimized results.
• Guidance and control should take care of the complexity and timing
requirements to solve non linear systems.
• Higher level control systems leads to many additional complicated
control algorithms.

28
Real – Time Command and Control

• The controller at the


highest level of control
hierarchy is a command
and control system
• ATC – monitors the
aircraft coverage area,
the environment,
generates and presents
the information needed
by the operators at ATC
29
Signal Processing

• Most signal processing applications are real-time


requiring response times from less than a millisecond up
to seconds. e.g. digital filtering, video and audio
compression/decompression, and radar signal processing.
• Typically a real-time signal processing application
computes in one sampling period, one or more outputs,
each being a weighted sum of n inputs. The weights may
even vary over time.
• Each O/P x(k) is weighted sum of n I/P y(i)

30
Signal Processing Bandwidth Demands

• The processing time demand of an application depends


on the sampling period and how many outputs are
required to be produced per sampling period.
• For digital filtering the sampling rate can be tens of
kHz and the calculation may involve tens or hundreds
of terms, hence tens of millions of multiplications and
additions may be required per second.

31
More Complex Signal Processing

• While digital filtering is often a linear computation


depending on the number of terms in the expression,
other signal processing applications are even more
computationally intensive.
• For instance real-time video compression may have
complexity of order n2, and may require hundreds of
millions of multiplications per second.
• Signal processing is usually part of a larger system.
e.g. a passive radar signal processing system.

32
Radar Signal Processing

• Fig shows the passive radar signal processing and


tracking system.

33
Radar Signal Processing (Contd.,)
• The system comprises an I/O subsystem that samples and
digitizes the echo signal from the radar and places the sampled
values in shared memory.
• An array of digital signal processors process these values.
• The data produced are analysed by one or more data processors
which not only interface to the display system but also feed
back commands to control the radar and select parameters for
the signal processors to be used for the next sampling period.
• Tracking, Gating, Data Association are the stages in Radar
Signal Processing

34
Other Real-Time Applications: Databases
• Stock exchange price
database systems
• Air traffic control databases
• What makes it real-time?
– The data is ‘perishable’
– The data values are updated
periodically
– After a while the data has
reduced value
– There needs to be temporal
consistency as well as normal
data consistency

35
Real-Time Databases: Absolute
Temporal Consistency
• Real-time data has parameters such as age and temporal
dispersion.
• The age of an object measures how up-to-date the
information is?
• The age of an object whose value is computed from other
objects is equal to that of the oldest of those objects.
• A set of data objects is said to be absolutely temporally
consistent if the maximum age in the set is no greater
than a certain threshold.

36
Real-Time Database: Relative Temporal
Consistency
• A set of data objects is said to be relatively temporally
consistent if the maximum difference in the ages is
less than the relative consistency threshold used by the
application.
• For some applications the absolute age is less
important than the differences in ages.

37
Real-time Databases: Consistency
Models
• Concurrency control mechanisms such as 2-phase locking
have been used to ensure serializability of read and update
transactions and maintain data integrity of non-real-time
databases.
• These mechanisms can make it more difficult for updates to
be completed in time.
• Late updates may cause data to become temporally
inconsistent.
• Weaker consistency models are sometimes used to ensure the
timeliness of updates and reads.

38
Real-time Databases: Consistency Models
(Contd.,)
• For instance we may require updates to be serializable
but allow read-only transactions not to be serializable.
• Usually the more relaxed the serialization requirement,
the more flexibility the system has in interleaving the
read and write operations from different transactions,
and the easier it is to schedule transactions so that they
complete in time.

39
Real-time Databases: Consistency
Models (Contd.,)
• Kuo and Mok proposed that ‘similarity’ may be a
suitable correctness criterion in some real-time
situations.
• Two views of a transaction are ‘similar’ if every
read operation gets similar values of every data
objects read by the transaction, where ‘similar’
means that the data values are within an
acceptable threshold from the point of view of
every transaction that may read the object.

40
Other Real-Time Applications:
Multimedia Applications
• One of the most
frequently encountered
real-time application
• Multimedia may process,
store, transmit and
display any number of
video streams, audio
streams, images, graphics
and text

41
Other Real-Time Applications:
Multimedia Applications (Contd.,)
• MPEG Compression / decompression
• Video compression standard MPEG make use of three
techniques:
– Motion compensation for reducing temporal redundancy
– Discrete cosine transform for reducing spatial redundancy
– Entropy encoding for reducing the no. of bits required to
encode all the information

42
Summary of Real-Time Applications

• Purely cyclic: Every task executes periodically. Even I/O operations


are polled. Demands on resources do not vary significantly from
period to period. Most digital controllers are of this type.
• Mostly cyclic: Most tasks execute periodically. The system can also
respond to some external events asynchronously.
• Asynchronous and somewhat predictable: In applications such as
multimedia communication, radar signal processing, tracking, most
tasks are not periodic. Duration between executions of a task may
vary considerably or the resource requirements may vary. Variations
have bounded ranges or known statistics.
• Asynchronous and unpredictable.

43
Hard v/s Soft Real – Time Systems
Jobs and Processors

• For describing and characterizing different types of real-


time systems and methods for scheduling and resource
management we need job and task.
• Job versus Task
• Job: unit of work that is scheduled and executed by the
system
– Computation of control law is a job
– Computation of a FFT (Fast Fourier Transform)
– Transmission of a data packet
• Task: a set of related jobs which jointly provide some
system function
45
Type of Tasks
• A Periodic task is executed repeatedly at regular time
intervals, and each invocation is called a job or instance.
– Often time-driven
• A Aperiodic task is executed to response to external events,
and to respond, it executes aperiodic jobs whose release time
are not know a priori
– Often event-driven
– Off-line guarantee of aperiodic tasks must make proper assumptions
on the environments; that is, by assuming a maximum arrival rate for
each event (i.e., minimum interarrival time)
• Aperiodic tasks characterized by a minimum interarrival time are called
sporadic tasks

46
Release Times, Deadlines and Timing
Constraints
• Release time of a job
– the instant of time at which the job becomes available for
execution
– Job can be scheduled and executed at any time at or after its
release whenever its data and control dependency conditions
are met
– Jobs have no release time if all the jobs are released when
the system begins execution
• Response time
– The length of time from the release time of the job to the
instant when it completes
47
Release Times, Deadlines and Timing
Constraints (Contd.,)
• Relative deadline
– The maximum allowable response time of a job
• Deadline or Absolute Deadline
– The instant of time by which its execution is required to be completed
– Equal to the release time plus the relative deadline
– A job has no deadline if its deadline is at infinity
• Timing Constraints
– A constraints imposed on the timing behavior of a job
– Specified in terms of release time or deadline
– Periodic Tasks: Time-driven recurring at regular intervals.
– Aperiodic: event-driven.

48
Hard Real-Time System
• Degree of tolerance of missed deadline
– Extremely small or zero
• Usefulness of computed results after missed deadlines
– Likely useless
• Severity of the penalty incurred for failing to meet deadlines
– catastrophe
• Failure to meet constraint is a fatal fault. Validation system
always meets timing constraints.
– Deterministic constraints
– Probabilistic constraints
– Constraints in terms of some usefulness function.

49
Hard Real-Time System (Contd.,)

• Examples: (many embedded systems are hard)


– Nuclear reactors
– Flight controller
– Weapon defense system
– Missile guidance system

50
Soft Real-Time System

• Degree of tolerance of missed deadline


– Non-zero
• Usefulness of computed results after missed deadlines
– Have a rate of depreciation
• Severity of the penalty incurred for failing to meet
deadlines
– Non-catastrophic
• Late completion of jobs is undesirable but not fatal.
Validation - Demonstration of jobs meeting some
statistical constraints suffices
51
Soft Real-Time System (Contd.,)

• A miss of timing constraints is undesirable. However,


a few misses do no serious harm
– The timing requirements are often specified in probability
terms
– The time constraints are guaranteed on a statistical basis
• Examples:
– Multimedia Streaming (25 frames per second on an average)
– Electronic games
– Quality-of-Service (QoS) guarantees
– Online databases
52
Comparison

Value
Deadline

Soft RTS
Hard RTS

Time

53
Summary of Hard v/s Soft Real-time
Systems
• Jobs and Processors
• Release Times
• Deadlines
• Timing Constraints
• Hard real-time systems
• Soft real-time systems

54

You might also like