SlideShare a Scribd company logo
1
Real-Time
Operating Systems
Praveen Varma
www.carrertime.in
2
Contents
– Introduction
– Characteristic of RTOS
– Real-Time task scheduling
• Clock-driven
• Event-driven
– Scheduling of real-time task on a uniprocessor
• Rate Monotonic Analysis (RMA)
• Earliest Deadline First (EDF)
• Scheduling with limited priority levels
– Features of RTOS
– Commercial real-time operating systems
• RT Linux, PSOS, VRTX, WinCE
3
Real Time System
• A system is said to be Real Time if it is
required to complete it’s work & deliver it’s
services on time.
4
Types of RTS:
• Hard real-time System:
– Breaking the limit is always seen as a fundamental
failure
– Nuclear Power Plant Controller
– Flight Control System
• Soft real-time System:
– Breaking the time limit is unwanted, but is not
immediately critical
– web sites and services
– Satellite-based applications
5
• Firm Real-Time Systems
– If a deadline is missed occasionally, the system does
not fail
– The results produced by a task after the deadline are
rejected
– Video Conferencing
– Satellite Based Tracking
of enemy movement
Utility
D Time
6
Real Time OS
Hardware
Standard OS
RT Applications
RT
extension
Applications
7
Characteristic of RTOS
• Time constraints
• Correctness criterion (not only logical but also
time)
• Safety-Critically (safety + reliability)
• Task Criticality (cost of failure of task)
• Custom Hardware
• Reactive
• Stability
• Exception Handling
8
OS Real-Time Extensions
• Extension of an OS by real-time
components
• Cooperation between RT- and non-RT
parts
• Advantages: rich functionality
• Disadvantage:
– Computing and memory resources
• Example: RT-Linux, Solaris, Windows NT
9
Components of a RTOS
• Process (task) management
– Scheduler
– Synchronization mechanism
• Interprocess communication (IPC)
• Semaphores
• Memory management
• Interrupt service mechanism
• I/O management
• Hardware abstraction layer
• Development Environments
• Board Support Packages (BSP)
10
Real-Time Task Scheduling
• Scheduling of tasks is the primary means
by which the operating system meets task
deadlines.
• So, scheduling is an important problem.
• Lot of work has been done in developing
appropriate schedulers for real-time tasks
– Scheduling on uniprocessors
– Scheduling on multiprocessors and distributed
systems
11
Real Time Task Scheduling
1.Clock Driven:
- Table-driven & Cyclic
2. Event Driven:
- Simple Priority Based
- Rate Monotonic Analysis (RMA)
- Earliest Deadline First (EDF)
3. Hybrid:
- Round-robin
12
Clock-driven Scheduling
• Table-driven scheduling
• Decision regarding which job to run next is made
at specific time instants
– Timers are used to trigger the decision point
– The job-list along with information regarding
which task to be run for how long are stored in
a table
13
Clock-driven Scheduling
Task Start time Stop time
T1 100
T2 101 150
T3 151 225
T4 226 300
14
Clock-Driven Scheduling
• The scheduler develops a permanent schedule
for a period (P1,P2,...,Pn) and stores in a table.
• Round robin scheduling is an example of clock-
driven scheduling
• Clock-driven schedulers are
– Simple: used in low cost applications
– Efficient: very little runtime overhead
– Inflexible: Very difficult to accommodate dynamically
changing task set or task characteristics.
15
Priority-based Schedulers
• These are also called event-driven schedulers
– Scheduling decisions are made when certain events
occur
• Tasks becoming ready
• Tasks completing execution
• These are called preemptive schedulers
– When a higher priority task becomes ready it
preempts the executing lower priority task
• These are greedy schedulers:
– They never keep the processor idle if a task is ready.
16
Priority-based Schedulers
• Static priority schedulers:
– The task priorities once assigned by the
programmers, do not change during runtime
– RMA (Rate Monotonic Algorithm) is the optimal static
priority scheduling algorithm
• Dynamic priority
– The task priorities can change during runtime based
on the relative urgency of completion of tasks
– EDF (Earliest Deadline First) is the optimal
uniprocessor scheduling algorithm
17
Priority-based Schedulers
• First let us consider the simplest scenario:
– Uni-processor
– Independent tasks
• Tasks do not share resources
• There is no precedence ordering among the tasks
18
Priority-based Scheduling
• Independent tasks executed on a
uniprocessor
– Two algorithms pretty much summarise the
important results in this scenario
• EDF (Earliest Deadline First)
• RMA (Rate Monotonic Analysis )
19
EDF
• EDF is the optimal uniprocessor scheduling
algorithm
– If EDF cannot feasibly schedule a set of tasks, there
exists no other scheduling algorithms to do that.
• Can schedule both periodic and aperiodic tasks
• Schedulability check:
– Sum of utilization due to tasks is less than one.
20
EDF
• EDF is
– Simple
– Optimal
• But, is rarely used
– No commercially available operating system
directly supports EDF scheduling
– Let us examine the disadvantages of EDF
21
Disadvantages of EDF
• Transient overload handling
– EDF has very poor, overload handling
capability
– When a low-criticality task becomes delayed it
can make even the most critical task miss its
deadline
– In fact, it is extremely difficult to predict which
task would miss its deadline when a task
takes more time
22
Disadvantages of EDF
• Runtime efficiency
– EDF is not very efficient
– Inorder to implement EDF the tasks need to
be maintained sorted in a priority queue
based on their deadline
– The complexity of maintaining a priority queue
is (log n), where n is the number of tasks
23
Rate Monotonic Algorithm
• The priority of a task is proportional to its
rate of occurrence.
– The higher is the rate (or lower is the period)
of a task, the higher is its priority.
Rate
Priority
24
RMA
• RMA has been shown to be the optimal
uniprocessor static priority scheduling
algorithm
– If RMA cannot schedule a set of periodic
tasks, no other scheduling algorithm can.
25
Hybrid Schedulers
• Time-Sliced Round-Robin Scheduling:
- Are very commonly used in traditional OS.
- Is a preemptive scheduling method.
- Here ready tasks are held in a circular queue.
- once a task is taken from queue then it runs for a time
slice & if does not complete then it inserted back in to
the queue.
- Here all tasks are equal with identical time slice.
It can be extended by putting larger time slice to the higher
priority tasks.
26
Resource sharing
• So far, the only resource that we
considered is CPU.
• However, tasks may need to share
resources such as files, memory, data
structures.
– These are nonpreemptable resources
– Called critical sections in the operating
systems literature
27
Critical Sections
• The traditional operating system solution
to share critical sections
– Is through the use of semaphores.
• However, in real-time systems this
solution does not work well, it gives rise to:
– Priority inversion
– Unbounded priority inversion
28
Features of RTOS
• Clock and Timer Support
- most important issue
- hard real time application support timer service
with resolution of few microseconds.
• Real-Time Priority Levels
- it must support static (or real-time) priority
level.
- where traditional OS dynamically changes the
priority levels of tasks to maximize the
system throughput.
29
Features of RTOS
• Fast Task Preemption
– When a high priority task arrives, an low priority task
should preempt.
– the waiting time of the high priority task to start
execution is expressed as task preemption time.
• Predictable and Fast Interrupt Latency
- interrupt latency is the time delay between the
occurrence of an interrupt and the running of
the corresponding Interrupt Service Routing
(ISR).
- upper bound on interrupt latency must be
bounded
30
Features of RTOS
• Support for Resource sharing Among Real
Time Tasks
- the resource to be shared between the real
time task using Priority Ceiling Protocol (PCP)
• Requirements on Memory Management
- real time OS requires to provide virtual memory
support for heavy real time tasks.
- embedded real time OS usually don't support
virtual memory
31
Features of RTOS
• Support for Asynchronous I/O
- asynchronous I/O means non-blocking I/O.
- where as traditional read() or write() system
call performs synchronous I/O.
- in asynchronous I/O, system call will return
immediately once the I/O request has been
passed down to the hardware or queued in
the OS, typically before the physical I/O
operation has even begun.
32
Commercial Real-Time
Operating Systems
• Criteria for comparing RTOS:
– Scheduling policy supported
– Memory locking and other support
– Timers
– Interrupt handling
– File system support
– Device interfacing
• Embedded systems have small memories
– The operating system size is important
– Obviously, OS with large footprint cannot be used in
embedded applications
– Power saving features are desirable
33
Other RTOS issues
• Interrupt Latency should be very small
– Kernel has to respond to real time events
– Interrupts should be disabled for minimum
possible time
• For embedded applications Kernel Size
should be small
– Should fit in ROM
• Sophisticated features can be removed
– No Virtual Memory
34
Linux for Real Time
Applications
• Scheduling
– Priority Driven Approach
• Optimize average case response time
– Interactive Processes Given Highest Priority
• Aim to reduce response times of processes
– Real Time Processes
• Processes with high priority
35
RT Linux
• RT kernel intercepts and attends to all
interrupts
– If an interrupt is to cause a RT task to run, the
RT kernel preempts Linux (if Linux is running
that time) and lets the RT task run
Hard-
ware
RT Kernel
Linux
36
References:
1. Real-Time Systems Theory and Practice
Rajib Mall
2. Real-Time Systems,
Jane W.S. Liu
3. Real-Time Operating System,
Frank Kolnick
37
questions
38

More Related Content

What's hot

Real Time Operating Systems
Real Time Operating SystemsReal Time Operating Systems
Real Time Operating Systems
Pawandeep Kaur
 
Context switching
Context switchingContext switching
Context switching
DarakhshanNayyab
 
Real Time Operating System
Real Time Operating SystemReal Time Operating System
Real Time Operating Systemvivek223
 
RTOS Basic Concepts
RTOS Basic ConceptsRTOS Basic Concepts
RTOS Basic Concepts
Pantech ProLabs India Pvt Ltd
 
Unit 4 Real Time Operating System
Unit 4 Real Time Operating SystemUnit 4 Real Time Operating System
Unit 4 Real Time Operating System
Dr. Pankaj Zope
 
Real time operating system
Real time operating systemReal time operating system
Real time operating system
Kamran Khan
 
Os rtos.ppt
Os rtos.pptOs rtos.ppt
Os rtos.ppt
rahul km
 
Cpu scheduling in operating System.
Cpu scheduling in operating System.Cpu scheduling in operating System.
Cpu scheduling in operating System.
Ravi Kumar Patel
 
REAL TIME OPERATING SYSTEM
REAL TIME OPERATING SYSTEMREAL TIME OPERATING SYSTEM
REAL TIME OPERATING SYSTEMprakrutijsh
 
Admission control
Admission controlAdmission control
Admission control
Vishal Waghmare
 
Real time operating systems (rtos) concepts 9
Real time operating systems (rtos) concepts 9Real time operating systems (rtos) concepts 9
Real time operating systems (rtos) concepts 9
Abu Bakr Ramadan
 
Scheduling algorithms
Scheduling algorithmsScheduling algorithms
Scheduling algorithms
Chankey Pathak
 
Real time operating systems (rtos) concepts 1
Real time operating systems (rtos) concepts 1Real time operating systems (rtos) concepts 1
Real time operating systems (rtos) concepts 1
Abu Bakr Ramadan
 
Real Time Operating System Concepts
Real Time Operating System ConceptsReal Time Operating System Concepts
Real Time Operating System Concepts
Sanjiv Malik
 
Real time Scheduling in Operating System for Msc CS
Real time Scheduling in Operating System for Msc CSReal time Scheduling in Operating System for Msc CS
Real time Scheduling in Operating System for Msc CS
Thanveen
 
How to Measure RTOS Performance
How to Measure RTOS Performance How to Measure RTOS Performance
How to Measure RTOS Performance
mentoresd
 
Real Time Operating System
Real Time Operating SystemReal Time Operating System
Real Time Operating System
Himanshu Choudhary
 
UNIT-I-RTOS and Concepts
UNIT-I-RTOS and ConceptsUNIT-I-RTOS and Concepts
UNIT-I-RTOS and Concepts
Dr.YNM
 
Rtos
RtosRtos
Rtos Concepts
Rtos ConceptsRtos Concepts
Rtos Concepts
Sundaresan Sundar
 

What's hot (20)

Real Time Operating Systems
Real Time Operating SystemsReal Time Operating Systems
Real Time Operating Systems
 
Context switching
Context switchingContext switching
Context switching
 
Real Time Operating System
Real Time Operating SystemReal Time Operating System
Real Time Operating System
 
RTOS Basic Concepts
RTOS Basic ConceptsRTOS Basic Concepts
RTOS Basic Concepts
 
Unit 4 Real Time Operating System
Unit 4 Real Time Operating SystemUnit 4 Real Time Operating System
Unit 4 Real Time Operating System
 
Real time operating system
Real time operating systemReal time operating system
Real time operating system
 
Os rtos.ppt
Os rtos.pptOs rtos.ppt
Os rtos.ppt
 
Cpu scheduling in operating System.
Cpu scheduling in operating System.Cpu scheduling in operating System.
Cpu scheduling in operating System.
 
REAL TIME OPERATING SYSTEM
REAL TIME OPERATING SYSTEMREAL TIME OPERATING SYSTEM
REAL TIME OPERATING SYSTEM
 
Admission control
Admission controlAdmission control
Admission control
 
Real time operating systems (rtos) concepts 9
Real time operating systems (rtos) concepts 9Real time operating systems (rtos) concepts 9
Real time operating systems (rtos) concepts 9
 
Scheduling algorithms
Scheduling algorithmsScheduling algorithms
Scheduling algorithms
 
Real time operating systems (rtos) concepts 1
Real time operating systems (rtos) concepts 1Real time operating systems (rtos) concepts 1
Real time operating systems (rtos) concepts 1
 
Real Time Operating System Concepts
Real Time Operating System ConceptsReal Time Operating System Concepts
Real Time Operating System Concepts
 
Real time Scheduling in Operating System for Msc CS
Real time Scheduling in Operating System for Msc CSReal time Scheduling in Operating System for Msc CS
Real time Scheduling in Operating System for Msc CS
 
How to Measure RTOS Performance
How to Measure RTOS Performance How to Measure RTOS Performance
How to Measure RTOS Performance
 
Real Time Operating System
Real Time Operating SystemReal Time Operating System
Real Time Operating System
 
UNIT-I-RTOS and Concepts
UNIT-I-RTOS and ConceptsUNIT-I-RTOS and Concepts
UNIT-I-RTOS and Concepts
 
Rtos
RtosRtos
Rtos
 
Rtos Concepts
Rtos ConceptsRtos Concepts
Rtos Concepts
 

Similar to Real-Time Operating Systems

Real-Time Operating Systems Real-Time Operating Systems RTOS .ppt
Real-Time Operating Systems Real-Time Operating Systems RTOS .pptReal-Time Operating Systems Real-Time Operating Systems RTOS .ppt
Real-Time Operating Systems Real-Time Operating Systems RTOS .ppt
lematadese670
 
Operating Systems 1 (10/12) - Scheduling
Operating Systems 1 (10/12) - SchedulingOperating Systems 1 (10/12) - Scheduling
Operating Systems 1 (10/12) - Scheduling
Peter Tröger
 
Operating system 10 real time operating system
Operating system 10 real time operating systemOperating system 10 real time operating system
Operating system 10 real time operating system
Vaibhav Khanna
 
ESC UNIT 3.ppt
ESC UNIT 3.pptESC UNIT 3.ppt
ESC UNIT 3.ppt
Sarvesh Warjurkar
 
Real time operating system
Real time operating systemReal time operating system
Real time operating system
Khuram Shahzad
 
Real Time Operating Systems, Dynamic Precision: Exploring the Realm of Real-...
Real Time Operating Systems,  Dynamic Precision: Exploring the Realm of Real-...Real Time Operating Systems,  Dynamic Precision: Exploring the Realm of Real-...
Real Time Operating Systems, Dynamic Precision: Exploring the Realm of Real-...
Adobe2801
 
Fdp embedded systems
Fdp embedded systemsFdp embedded systems
Fdp embedded systems
Kavya G
 
Real Time Systems
Real Time SystemsReal Time Systems
Real Time Systems
leo3004
 
Real Time System
Real Time SystemReal Time System
Real Time System
AKANSH SINGHAL
 
Types of operating system.................
Types of operating system.................Types of operating system.................
Types of operating system.................
harendersin82880
 
OS.pptx
OS.pptxOS.pptx
Rtos 8051
Rtos 8051Rtos 8051
Embedded_ PPT_4-5 unit_Dr Monika-edited.pptx
Embedded_ PPT_4-5 unit_Dr Monika-edited.pptxEmbedded_ PPT_4-5 unit_Dr Monika-edited.pptx
Embedded_ PPT_4-5 unit_Dr Monika-edited.pptx
ProfMonikaJain
 
collab2011-tuning-ebusiness-421966.pdf
collab2011-tuning-ebusiness-421966.pdfcollab2011-tuning-ebusiness-421966.pdf
collab2011-tuning-ebusiness-421966.pdf
ElboulmaniMohamed
 
EMBEDDED OS
EMBEDDED OSEMBEDDED OS
EMBEDDED OS
AJAL A J
 
13009690.ppt
13009690.ppt13009690.ppt
13009690.ppt
ssuser4ca1eb
 
Resource Management in (Embedded) Real-Time Systems
Resource Management in (Embedded) Real-Time SystemsResource Management in (Embedded) Real-Time Systems
Resource Management in (Embedded) Real-Time Systems
jeronimored
 

Similar to Real-Time Operating Systems (20)

Real-Time Operating Systems Real-Time Operating Systems RTOS .ppt
Real-Time Operating Systems Real-Time Operating Systems RTOS .pptReal-Time Operating Systems Real-Time Operating Systems RTOS .ppt
Real-Time Operating Systems Real-Time Operating Systems RTOS .ppt
 
Operating Systems 1 (10/12) - Scheduling
Operating Systems 1 (10/12) - SchedulingOperating Systems 1 (10/12) - Scheduling
Operating Systems 1 (10/12) - Scheduling
 
Operating system 10 real time operating system
Operating system 10 real time operating systemOperating system 10 real time operating system
Operating system 10 real time operating system
 
ESC UNIT 3.ppt
ESC UNIT 3.pptESC UNIT 3.ppt
ESC UNIT 3.ppt
 
Real time operating system
Real time operating systemReal time operating system
Real time operating system
 
Real Time Operating Systems, Dynamic Precision: Exploring the Realm of Real-...
Real Time Operating Systems,  Dynamic Precision: Exploring the Realm of Real-...Real Time Operating Systems,  Dynamic Precision: Exploring the Realm of Real-...
Real Time Operating Systems, Dynamic Precision: Exploring the Realm of Real-...
 
Fdp embedded systems
Fdp embedded systemsFdp embedded systems
Fdp embedded systems
 
Real Time Systems
Real Time SystemsReal Time Systems
Real Time Systems
 
Real Time System
Real Time SystemReal Time System
Real Time System
 
Types of operating system.................
Types of operating system.................Types of operating system.................
Types of operating system.................
 
Lect07
Lect07Lect07
Lect07
 
OS.pptx
OS.pptxOS.pptx
OS.pptx
 
Rtos 8051
Rtos 8051Rtos 8051
Rtos 8051
 
Embedded_ PPT_4-5 unit_Dr Monika-edited.pptx
Embedded_ PPT_4-5 unit_Dr Monika-edited.pptxEmbedded_ PPT_4-5 unit_Dr Monika-edited.pptx
Embedded_ PPT_4-5 unit_Dr Monika-edited.pptx
 
collab2011-tuning-ebusiness-421966.pdf
collab2011-tuning-ebusiness-421966.pdfcollab2011-tuning-ebusiness-421966.pdf
collab2011-tuning-ebusiness-421966.pdf
 
Section05 scheduling
Section05 schedulingSection05 scheduling
Section05 scheduling
 
EMBEDDED OS
EMBEDDED OSEMBEDDED OS
EMBEDDED OS
 
13009690.ppt
13009690.ppt13009690.ppt
13009690.ppt
 
Os1
Os1Os1
Os1
 
Resource Management in (Embedded) Real-Time Systems
Resource Management in (Embedded) Real-Time SystemsResource Management in (Embedded) Real-Time Systems
Resource Management in (Embedded) Real-Time Systems
 

More from Praveen Penumathsa

DYNAMIC SLICING OF ASPECT-ORIENTED PROGRAMS
DYNAMIC SLICING OF ASPECT-ORIENTED PROGRAMSDYNAMIC SLICING OF ASPECT-ORIENTED PROGRAMS
DYNAMIC SLICING OF ASPECT-ORIENTED PROGRAMS
Praveen Penumathsa
 
DYNAMIC SLICING OF ASPECT-ORIENTED PROGRAMS
DYNAMIC SLICING OF ASPECT-ORIENTED PROGRAMSDYNAMIC SLICING OF ASPECT-ORIENTED PROGRAMS
DYNAMIC SLICING OF ASPECT-ORIENTED PROGRAMS
Praveen Penumathsa
 
Generating test cases using UML Communication Diagram
Generating test cases using UML Communication Diagram Generating test cases using UML Communication Diagram
Generating test cases using UML Communication Diagram
Praveen Penumathsa
 
Testing of Object-Oriented Software
Testing of Object-Oriented SoftwareTesting of Object-Oriented Software
Testing of Object-Oriented Software
Praveen Penumathsa
 
Distributed System
Distributed SystemDistributed System
Distributed System
Praveen Penumathsa
 
Slicing of Object-Oriented Programs
Slicing of Object-Oriented ProgramsSlicing of Object-Oriented Programs
Slicing of Object-Oriented Programs
Praveen Penumathsa
 
Rseminarp
RseminarpRseminarp
Slicing of Object-Oriented Programs
Slicing of Object-Oriented ProgramsSlicing of Object-Oriented Programs
Slicing of Object-Oriented Programs
Praveen Penumathsa
 

More from Praveen Penumathsa (10)

DYNAMIC SLICING OF ASPECT-ORIENTED PROGRAMS
DYNAMIC SLICING OF ASPECT-ORIENTED PROGRAMSDYNAMIC SLICING OF ASPECT-ORIENTED PROGRAMS
DYNAMIC SLICING OF ASPECT-ORIENTED PROGRAMS
 
DYNAMIC SLICING OF ASPECT-ORIENTED PROGRAMS
DYNAMIC SLICING OF ASPECT-ORIENTED PROGRAMSDYNAMIC SLICING OF ASPECT-ORIENTED PROGRAMS
DYNAMIC SLICING OF ASPECT-ORIENTED PROGRAMS
 
Generating test cases using UML Communication Diagram
Generating test cases using UML Communication Diagram Generating test cases using UML Communication Diagram
Generating test cases using UML Communication Diagram
 
Testing of Object-Oriented Software
Testing of Object-Oriented SoftwareTesting of Object-Oriented Software
Testing of Object-Oriented Software
 
Distributed System
Distributed SystemDistributed System
Distributed System
 
Slicing of Object-Oriented Programs
Slicing of Object-Oriented ProgramsSlicing of Object-Oriented Programs
Slicing of Object-Oriented Programs
 
Rseminarp
RseminarpRseminarp
Rseminarp
 
Slicing of Object-Oriented Programs
Slicing of Object-Oriented ProgramsSlicing of Object-Oriented Programs
Slicing of Object-Oriented Programs
 
Praveen varma fresher_resume
Praveen varma fresher_resumePraveen varma fresher_resume
Praveen varma fresher_resume
 
Untitled Presentation
Untitled PresentationUntitled Presentation
Untitled Presentation
 

Recently uploaded

Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
AzmatAli747758
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
Vivekanand Anglo Vedic Academy
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
Celine George
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
Excellence Foundation for South Sudan
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
GeoBlogs
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
Fundacja Rozwoju Społeczeństwa Przedsiębiorczego
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 

Recently uploaded (20)

Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 

Real-Time Operating Systems

  • 2. 2 Contents – Introduction – Characteristic of RTOS – Real-Time task scheduling • Clock-driven • Event-driven – Scheduling of real-time task on a uniprocessor • Rate Monotonic Analysis (RMA) • Earliest Deadline First (EDF) • Scheduling with limited priority levels – Features of RTOS – Commercial real-time operating systems • RT Linux, PSOS, VRTX, WinCE
  • 3. 3 Real Time System • A system is said to be Real Time if it is required to complete it’s work & deliver it’s services on time.
  • 4. 4 Types of RTS: • Hard real-time System: – Breaking the limit is always seen as a fundamental failure – Nuclear Power Plant Controller – Flight Control System • Soft real-time System: – Breaking the time limit is unwanted, but is not immediately critical – web sites and services – Satellite-based applications
  • 5. 5 • Firm Real-Time Systems – If a deadline is missed occasionally, the system does not fail – The results produced by a task after the deadline are rejected – Video Conferencing – Satellite Based Tracking of enemy movement Utility D Time
  • 6. 6 Real Time OS Hardware Standard OS RT Applications RT extension Applications
  • 7. 7 Characteristic of RTOS • Time constraints • Correctness criterion (not only logical but also time) • Safety-Critically (safety + reliability) • Task Criticality (cost of failure of task) • Custom Hardware • Reactive • Stability • Exception Handling
  • 8. 8 OS Real-Time Extensions • Extension of an OS by real-time components • Cooperation between RT- and non-RT parts • Advantages: rich functionality • Disadvantage: – Computing and memory resources • Example: RT-Linux, Solaris, Windows NT
  • 9. 9 Components of a RTOS • Process (task) management – Scheduler – Synchronization mechanism • Interprocess communication (IPC) • Semaphores • Memory management • Interrupt service mechanism • I/O management • Hardware abstraction layer • Development Environments • Board Support Packages (BSP)
  • 10. 10 Real-Time Task Scheduling • Scheduling of tasks is the primary means by which the operating system meets task deadlines. • So, scheduling is an important problem. • Lot of work has been done in developing appropriate schedulers for real-time tasks – Scheduling on uniprocessors – Scheduling on multiprocessors and distributed systems
  • 11. 11 Real Time Task Scheduling 1.Clock Driven: - Table-driven & Cyclic 2. Event Driven: - Simple Priority Based - Rate Monotonic Analysis (RMA) - Earliest Deadline First (EDF) 3. Hybrid: - Round-robin
  • 12. 12 Clock-driven Scheduling • Table-driven scheduling • Decision regarding which job to run next is made at specific time instants – Timers are used to trigger the decision point – The job-list along with information regarding which task to be run for how long are stored in a table
  • 13. 13 Clock-driven Scheduling Task Start time Stop time T1 100 T2 101 150 T3 151 225 T4 226 300
  • 14. 14 Clock-Driven Scheduling • The scheduler develops a permanent schedule for a period (P1,P2,...,Pn) and stores in a table. • Round robin scheduling is an example of clock- driven scheduling • Clock-driven schedulers are – Simple: used in low cost applications – Efficient: very little runtime overhead – Inflexible: Very difficult to accommodate dynamically changing task set or task characteristics.
  • 15. 15 Priority-based Schedulers • These are also called event-driven schedulers – Scheduling decisions are made when certain events occur • Tasks becoming ready • Tasks completing execution • These are called preemptive schedulers – When a higher priority task becomes ready it preempts the executing lower priority task • These are greedy schedulers: – They never keep the processor idle if a task is ready.
  • 16. 16 Priority-based Schedulers • Static priority schedulers: – The task priorities once assigned by the programmers, do not change during runtime – RMA (Rate Monotonic Algorithm) is the optimal static priority scheduling algorithm • Dynamic priority – The task priorities can change during runtime based on the relative urgency of completion of tasks – EDF (Earliest Deadline First) is the optimal uniprocessor scheduling algorithm
  • 17. 17 Priority-based Schedulers • First let us consider the simplest scenario: – Uni-processor – Independent tasks • Tasks do not share resources • There is no precedence ordering among the tasks
  • 18. 18 Priority-based Scheduling • Independent tasks executed on a uniprocessor – Two algorithms pretty much summarise the important results in this scenario • EDF (Earliest Deadline First) • RMA (Rate Monotonic Analysis )
  • 19. 19 EDF • EDF is the optimal uniprocessor scheduling algorithm – If EDF cannot feasibly schedule a set of tasks, there exists no other scheduling algorithms to do that. • Can schedule both periodic and aperiodic tasks • Schedulability check: – Sum of utilization due to tasks is less than one.
  • 20. 20 EDF • EDF is – Simple – Optimal • But, is rarely used – No commercially available operating system directly supports EDF scheduling – Let us examine the disadvantages of EDF
  • 21. 21 Disadvantages of EDF • Transient overload handling – EDF has very poor, overload handling capability – When a low-criticality task becomes delayed it can make even the most critical task miss its deadline – In fact, it is extremely difficult to predict which task would miss its deadline when a task takes more time
  • 22. 22 Disadvantages of EDF • Runtime efficiency – EDF is not very efficient – Inorder to implement EDF the tasks need to be maintained sorted in a priority queue based on their deadline – The complexity of maintaining a priority queue is (log n), where n is the number of tasks
  • 23. 23 Rate Monotonic Algorithm • The priority of a task is proportional to its rate of occurrence. – The higher is the rate (or lower is the period) of a task, the higher is its priority. Rate Priority
  • 24. 24 RMA • RMA has been shown to be the optimal uniprocessor static priority scheduling algorithm – If RMA cannot schedule a set of periodic tasks, no other scheduling algorithm can.
  • 25. 25 Hybrid Schedulers • Time-Sliced Round-Robin Scheduling: - Are very commonly used in traditional OS. - Is a preemptive scheduling method. - Here ready tasks are held in a circular queue. - once a task is taken from queue then it runs for a time slice & if does not complete then it inserted back in to the queue. - Here all tasks are equal with identical time slice. It can be extended by putting larger time slice to the higher priority tasks.
  • 26. 26 Resource sharing • So far, the only resource that we considered is CPU. • However, tasks may need to share resources such as files, memory, data structures. – These are nonpreemptable resources – Called critical sections in the operating systems literature
  • 27. 27 Critical Sections • The traditional operating system solution to share critical sections – Is through the use of semaphores. • However, in real-time systems this solution does not work well, it gives rise to: – Priority inversion – Unbounded priority inversion
  • 28. 28 Features of RTOS • Clock and Timer Support - most important issue - hard real time application support timer service with resolution of few microseconds. • Real-Time Priority Levels - it must support static (or real-time) priority level. - where traditional OS dynamically changes the priority levels of tasks to maximize the system throughput.
  • 29. 29 Features of RTOS • Fast Task Preemption – When a high priority task arrives, an low priority task should preempt. – the waiting time of the high priority task to start execution is expressed as task preemption time. • Predictable and Fast Interrupt Latency - interrupt latency is the time delay between the occurrence of an interrupt and the running of the corresponding Interrupt Service Routing (ISR). - upper bound on interrupt latency must be bounded
  • 30. 30 Features of RTOS • Support for Resource sharing Among Real Time Tasks - the resource to be shared between the real time task using Priority Ceiling Protocol (PCP) • Requirements on Memory Management - real time OS requires to provide virtual memory support for heavy real time tasks. - embedded real time OS usually don't support virtual memory
  • 31. 31 Features of RTOS • Support for Asynchronous I/O - asynchronous I/O means non-blocking I/O. - where as traditional read() or write() system call performs synchronous I/O. - in asynchronous I/O, system call will return immediately once the I/O request has been passed down to the hardware or queued in the OS, typically before the physical I/O operation has even begun.
  • 32. 32 Commercial Real-Time Operating Systems • Criteria for comparing RTOS: – Scheduling policy supported – Memory locking and other support – Timers – Interrupt handling – File system support – Device interfacing • Embedded systems have small memories – The operating system size is important – Obviously, OS with large footprint cannot be used in embedded applications – Power saving features are desirable
  • 33. 33 Other RTOS issues • Interrupt Latency should be very small – Kernel has to respond to real time events – Interrupts should be disabled for minimum possible time • For embedded applications Kernel Size should be small – Should fit in ROM • Sophisticated features can be removed – No Virtual Memory
  • 34. 34 Linux for Real Time Applications • Scheduling – Priority Driven Approach • Optimize average case response time – Interactive Processes Given Highest Priority • Aim to reduce response times of processes – Real Time Processes • Processes with high priority
  • 35. 35 RT Linux • RT kernel intercepts and attends to all interrupts – If an interrupt is to cause a RT task to run, the RT kernel preempts Linux (if Linux is running that time) and lets the RT task run Hard- ware RT Kernel Linux
  • 36. 36 References: 1. Real-Time Systems Theory and Practice Rajib Mall 2. Real-Time Systems, Jane W.S. Liu 3. Real-Time Operating System, Frank Kolnick
  • 38. 38