Lecture11 - Real Time Opearting System
Lecture11 - Real Time Opearting System
Lecture11 - Real Time Opearting System
• It is any information processing system which has to respond to externally generated input stimuli
within a finite and specified period
• Soft real-time — systems where deadlines are important but which will still function correctly if
deadlines are occasionally missed. E.g. Data acquisition system.
–Its still required to meet the deadlines but it is not fatal if those deadlines are occasionally
missed by a short time.
Multi-tasking What is a task?
MULTI-TASKING: Is when tasks work together in an organized way to solve a complex problem
An OPERATING SYSTEM: Is the piece of software that provides the required coordination during
multitasking.
REAL-TIME OPERATING SYSTEM (RTOS): Is an operating system where the control must
ensure that a task execution satisfies a specific time constraint.
A look at processes & programs
EMBEDDED PROGRAM is a collection of firmware modules and is normally static (not running)
Task states change depending on how active they are as shown in state diagram
SCHEDULE: specifies when, under what conditions, and for how long each task uses the resources
SCHEDULING STRATEGY: is the criteria used to decide which task runs next.
• RTOS Applications:
–scientific experiments
–control systems,
–applications were missed deadlines cannot be tolerated
Real-time Kernel
• Real Time Kernel: this is the smallest portion of the Real Time Operating System that performs
the scheduling, dispatching, communication/ and syncronization of tasks.
Preemptive and Non-Preemptive and Early Deadline first
Priority based Scheduling
In preemptive priority based scheduling, any high priority process entering the
‘Ready’ queue is immediately scheduled for execution
Non-preemptive scheduling any high priority process entering the ‘Ready’ queue
is scheduled only after the currently executing process completes its execution or
only when it voluntarily releases the CPU
Earliest deadline first selects a task according to its deadline such that a task
with earliest deadline has higher priority than others. A task which has a higher
priority due to earliest deadline at one instant it may have low priority at next
instant due to early deadline of another task. EDF typically executes in preemptive
mode i.e. currently executing task is preempted whenever another task with
earliest deadline becomes active.
Preemptive and Non-Preemptive and Early Deadline first
Priority based Scheduling
Arrival time (AT) is the time when a process enters into the ready state and is ready for its
execution.
Burst time (BT) is the total time taken by the process for its execution on the CPU.
Exit (Completion) time (CT) is the time when a process completes its execution and exit from the system.
Response time (RT) is the time spent when the process is in the ready state and gets the CPU for the first
Response time = Time at which the process gets the CPU for the first time - Arrival time
time
Waiting time (WT) Waiting time is the total time spent by the process in the ready state waiting for CPU.
Waiting time = Turnaround time - Burst time
Turnaround time (TAT) is the total amount of time spent by the process from coming in the ready state for the
first time to its completion.
Turnaround time = Burst time + Waiting time or Turnaround time = Exit time - Arrival time
Throughput is a way to find the efficiency of a CPU. It can be defined as the number of processes executed
by the CPU in a given amount of time.
Preemptive - Priority based Scheduling
Example
https://www.youtube.com/watch?v=hDn4hM148V8
Non-Preemptive - Priority based Scheduling
Example
https://www.youtube.com/watch?v=i4PQucowf1c