SlideShare a Scribd company logo
1 of 38
Download to read offline
REAL TIME OPERATING
SYSTEM
Sudheesh S Madhav
What is Real Time ?
• “ Real time in operating systems:
The ability of the operating system to provide a
required level of service in a bounded response
time.”
WHAT IS RTOS.
• It responds to inputs immediately(Real-Time).
• Here the task is completed within a specified time delay.
• In real life situations like controlling traffic signal or a
nuclear reactor or an aircraft.
• The operating system has to respond quickly.
• Necessary signaling between interrupt routines and task
code is handled by RTOS.
• RTOS can suspend one task code subroutine in the middle
of its processing in order to run another.
What a RTOS is
• Real time computing is equivalent to fast computing.
• Real time systems operate in a static environment
• Real time programming involves assembly coding, priority
interrupt programming, writing device drivers.
SELECTING AN ARCHITECTURE
• Select the simplest architecture that will meet
your response requirements.
• If response requirements not possible, RTOS
can be used.
INTRODUCTION TO RTOS
– A more complex software architecture is needed to handle
multiple tasks, coordination, communication, and interrupt
handling – an RTOS architecture
– Distinction:
• RTOS – OS and embedded software are integrated, ES
starts and activates the OS – both run in the same
address space
• RTOS includes only service routines needed by the ES
application
• Desirable RTOS properties: use less memory,
application programming interface, debugging tools,
support for variety of microprocessors, already-
debugged network drivers
CHARACTERISTICS OF RTOS.
Reliability
Predictability
Performance
Scalability
Consistency
FUNCTIONS OF RTOS
• Task management
• Scheduling
• Resource Allocation
• Interrupt Handling
Task management
• In Real Time Applications the Process is called as Task
which takes execution time and occupies memory.
• Task management is the process of managing tasks
through its life cycle.
TASK STATES
TASK AND TASK STATES
• A task – a simple subroutine
• ES application makes calls to the RTOS functions to start
tasks, passing to the OS, start address, stack pointers, etc. of
the tasks
• Task States:
– Running (Executing task)
– Ready (possibly: waiting, dormant, delayed)
– Blocked (possibly: suspended, pended)
Task States
Suspended
Pended Ready Delayed
Run
Task/Process States
• Each task/Process can belong to one and only one
state
• The Scheduler only operates on the processes in the
Ready state
• There is a single process in the Run/current state at
any time.
• Transitions to and from the Ready queue are affected
as a part of the execution of the RTOS
resource/object services or as a result of timing
events
Typical Task Operations
• creating and deleting tasks,
• controlling task scheduling, and
• obtaining task information.
SCHEDULER
– Scheduler – keeps track of the state of each task and
decides which one task should go to running state.
– schedules/shuffles tasks between Running and Ready
states
– Blocking is self-blocking by tasks, and moved to Running
state via other tasks‟ interrupt signaling (when block-factor
is removed/satisfied)
– When a task is unblocked with a higher priority over the
„running‟ task, the scheduler „switches‟ context
immediately (for all pre-emptive RTOSs)
EXAMPLE PROGRAM
Preemptive and Non preemptive
RTOS
Preemptive RTOS
Stops low priority task as soon as high
priority task unblocked
Non preemptive RTOS
Takes microprocessor away from the
lower priority task when that task blocks
Tasks and Data
– Each tasks has its won context - not shared, private
registers, stack, etc.
– In addition, several tasks share common data (via
global data declaration; use of „extern‟ in one task to
point to another task that declares the shared data
– Shared data caused the „shared-data problem‟
without solutions discussed in Chp4 or use of
„Reentrancy‟ characterization of functions
Semaphores and Shared Data
• A new tool for atomicity
– Semaphore – a variable/lock/flag used to control access to
shared resource (to avoid shared-data problems in RTOS)
– Protection at the start is via primitive function, called take,
indexed by the semaphore
– Protection at the end is via a primitive function, called
release, also indexed similarly
– Simple semaphores – Binary semaphores are often
adequate for shared data problems in RTOS
RTOS Semaphores & Initializing Semaphores
– Using binary semaphores to solve the „tank monitoring‟
problem
– The nuclear reactor system: The issue of initializing the
semaphore variable in a dedicated task (not in a
„competing‟ task) before initializing the OS – timing of
tasks and priority overrides, which can undermine the
effect of the semaphores
– Solution: Call OSSemInit() before OSInit()
Semaphores and Shared Data
– Reentrancy, Semaphores, Multiple Semaphores, Device
Signaling
– Each shared data (resource/device) requires a separate
semaphore for individual protection, allowing multiple tasks
and data/resources/devices to be shared exclusively, while
allowing efficient implementation and response time
– example of a printer device signaled by a report-buffering
task, via semaphore signaling, on each print of lines
constituting the formatted and buffered report
The initial values of semaphores – when not set properly
or at the wrong place
• The „symmetry‟ of takes and releases – must match or
correspond – each „take‟ must have a corresponding
„release‟ somewhere in the ES application
• „Taking‟ the wrong semaphore unintentionally (issue
with multiple semaphores)
• Holding a semaphore for too long can cause „waiting‟
tasks‟ deadline to be missed
• Priorities could be „inverted‟ and usually solved by
„priority inheritance/promotion
Semaphores and Shared Data
– Variants:
• Binary semaphores – single resource, one-at-a time,
alternating in use (also for resources)
• Counting semaphores – multiple instances of resources,
increase/decrease of integer semaphore variable
• Mutex – protects data shared while dealing with priority
inversion problem
– Summary – Protecting shared data in RTOS
• Disabling/Enabling interrupts (for task code and interrupt
routines), faster
• Taking/Releasing semaphores (can‟t use them in interrupt
routines), slower, affecting response times of those tasks that
need the semaphore
• Disabling task switches (no effect on interrupt routines),
holds all other tasks‟ response
Rtos ss

More Related Content

What's hot

Unit 4 Real Time Operating System
Unit 4 Real Time Operating SystemUnit 4 Real Time Operating System
Unit 4 Real Time Operating SystemDr. Pankaj Zope
 
ARM Exception and interrupts
ARM Exception and interrupts ARM Exception and interrupts
ARM Exception and interrupts NishmaNJ
 
REAL TIME OPERATING SYSTEM
REAL TIME OPERATING SYSTEMREAL TIME OPERATING SYSTEM
REAL TIME OPERATING SYSTEMprakrutijsh
 
Arm Processor Based Speed Control Of BLDC Motor
Arm Processor Based Speed Control Of BLDC MotorArm Processor Based Speed Control Of BLDC Motor
Arm Processor Based Speed Control Of BLDC MotorUday Wankar
 
Communication Interface of The Embedded Systems
Communication Interface of The Embedded Systems Communication Interface of The Embedded Systems
Communication Interface of The Embedded Systems VijayKumar5738
 
BUilt-In-Self-Test for VLSI Design
BUilt-In-Self-Test for VLSI DesignBUilt-In-Self-Test for VLSI Design
BUilt-In-Self-Test for VLSI DesignUsha Mehta
 
Real time operating system
Real time operating systemReal time operating system
Real time operating systemKamran Khan
 
Design of embedded systems
Design of embedded systemsDesign of embedded systems
Design of embedded systemsPradeep Kumar TS
 
Real Time Operating system (RTOS) - Embedded systems
Real Time Operating system (RTOS) - Embedded systemsReal Time Operating system (RTOS) - Embedded systems
Real Time Operating system (RTOS) - Embedded systemsHariharan Ganesan
 
Classification of routing protocols
Classification of routing protocolsClassification of routing protocols
Classification of routing protocolsMenaga Selvaraj
 
Task communication
Task communicationTask communication
Task communication1jayanti
 
Sensor node hardware and network architecture
Sensor node hardware and network architectureSensor node hardware and network architecture
Sensor node hardware and network architectureVidhi603146
 
RTOS- Real Time Operating Systems
RTOS- Real Time Operating Systems RTOS- Real Time Operating Systems
RTOS- Real Time Operating Systems Bayar shahab
 
8051 Microcontroller I/O ports
8051 Microcontroller I/O ports8051 Microcontroller I/O ports
8051 Microcontroller I/O portsanishgoel
 

What's hot (20)

Unit 4 Real Time Operating System
Unit 4 Real Time Operating SystemUnit 4 Real Time Operating System
Unit 4 Real Time Operating System
 
ARM Architecture
ARM ArchitectureARM Architecture
ARM Architecture
 
ARM Exception and interrupts
ARM Exception and interrupts ARM Exception and interrupts
ARM Exception and interrupts
 
Vxworks
VxworksVxworks
Vxworks
 
RTOS Basic Concepts
RTOS Basic ConceptsRTOS Basic Concepts
RTOS Basic Concepts
 
REAL TIME OPERATING SYSTEM
REAL TIME OPERATING SYSTEMREAL TIME OPERATING SYSTEM
REAL TIME OPERATING SYSTEM
 
RTOS - Real Time Operating Systems
RTOS - Real Time Operating SystemsRTOS - Real Time Operating Systems
RTOS - Real Time Operating Systems
 
Arm Processor Based Speed Control Of BLDC Motor
Arm Processor Based Speed Control Of BLDC MotorArm Processor Based Speed Control Of BLDC Motor
Arm Processor Based Speed Control Of BLDC Motor
 
Communication Interface of The Embedded Systems
Communication Interface of The Embedded Systems Communication Interface of The Embedded Systems
Communication Interface of The Embedded Systems
 
Rtos by shibu
Rtos by shibuRtos by shibu
Rtos by shibu
 
BUilt-In-Self-Test for VLSI Design
BUilt-In-Self-Test for VLSI DesignBUilt-In-Self-Test for VLSI Design
BUilt-In-Self-Test for VLSI Design
 
Real time operating system
Real time operating systemReal time operating system
Real time operating system
 
Vx works RTOS
Vx works RTOSVx works RTOS
Vx works RTOS
 
Design of embedded systems
Design of embedded systemsDesign of embedded systems
Design of embedded systems
 
Real Time Operating system (RTOS) - Embedded systems
Real Time Operating system (RTOS) - Embedded systemsReal Time Operating system (RTOS) - Embedded systems
Real Time Operating system (RTOS) - Embedded systems
 
Classification of routing protocols
Classification of routing protocolsClassification of routing protocols
Classification of routing protocols
 
Task communication
Task communicationTask communication
Task communication
 
Sensor node hardware and network architecture
Sensor node hardware and network architectureSensor node hardware and network architecture
Sensor node hardware and network architecture
 
RTOS- Real Time Operating Systems
RTOS- Real Time Operating Systems RTOS- Real Time Operating Systems
RTOS- Real Time Operating Systems
 
8051 Microcontroller I/O ports
8051 Microcontroller I/O ports8051 Microcontroller I/O ports
8051 Microcontroller I/O ports
 

Similar to Rtos ss

FreeRTOS basics (Real time Operating System)
FreeRTOS basics (Real time Operating System)FreeRTOS basics (Real time Operating System)
FreeRTOS basics (Real time Operating System)Naren Chandra
 
Real Time Operating Systems
Real Time Operating SystemsReal Time Operating Systems
Real Time Operating SystemsPawandeep Kaur
 
Real time system basic concept
Real time system basic conceptReal time system basic concept
Real time system basic conceptMOUMITA GHOSH
 
MODULE IV embedded (1).pptx
MODULE IV embedded (1).pptxMODULE IV embedded (1).pptx
MODULE IV embedded (1).pptxSajinvs4
 
seminarembedded-150504150805-conversion-gate02.pdf
seminarembedded-150504150805-conversion-gate02.pdfseminarembedded-150504150805-conversion-gate02.pdf
seminarembedded-150504150805-conversion-gate02.pdfkarunyamittapally
 
pptonrtosbychetan001-140213003314-phpapp02.pdf
pptonrtosbychetan001-140213003314-phpapp02.pdfpptonrtosbychetan001-140213003314-phpapp02.pdf
pptonrtosbychetan001-140213003314-phpapp02.pdfJaganBehera8
 
presentation on real time operating system(RTOS's)
presentation on real time operating system(RTOS's)presentation on real time operating system(RTOS's)
presentation on real time operating system(RTOS's)chetan mudenoor
 
Intro Basic of OS .ppt
Intro Basic of OS .pptIntro Basic of OS .ppt
Intro Basic of OS .pptVarsha506533
 
Real time operating system
Real time operating systemReal time operating system
Real time operating systemKhuram Shahzad
 
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 .pptlematadese670
 
Types of operating system.................
Types of operating system.................Types of operating system.................
Types of operating system.................harendersin82880
 

Similar to Rtos ss (20)

Rtos Concepts
Rtos ConceptsRtos Concepts
Rtos Concepts
 
FreeRTOS basics (Real time Operating System)
FreeRTOS basics (Real time Operating System)FreeRTOS basics (Real time Operating System)
FreeRTOS basics (Real time Operating System)
 
Real Time Operating Systems
Real Time Operating SystemsReal Time Operating Systems
Real Time Operating Systems
 
Real time system basic concept
Real time system basic conceptReal time system basic concept
Real time system basic concept
 
MODULE IV embedded (1).pptx
MODULE IV embedded (1).pptxMODULE IV embedded (1).pptx
MODULE IV embedded (1).pptx
 
Real Time Operating Systems
Real Time Operating SystemsReal Time Operating Systems
Real Time Operating Systems
 
seminarembedded-150504150805-conversion-gate02.pdf
seminarembedded-150504150805-conversion-gate02.pdfseminarembedded-150504150805-conversion-gate02.pdf
seminarembedded-150504150805-conversion-gate02.pdf
 
Unit v
Unit vUnit v
Unit v
 
Embedded os
Embedded osEmbedded os
Embedded os
 
pptonrtosbychetan001-140213003314-phpapp02.pdf
pptonrtosbychetan001-140213003314-phpapp02.pdfpptonrtosbychetan001-140213003314-phpapp02.pdf
pptonrtosbychetan001-140213003314-phpapp02.pdf
 
presentation on real time operating system(RTOS's)
presentation on real time operating system(RTOS's)presentation on real time operating system(RTOS's)
presentation on real time operating system(RTOS's)
 
Real Time Operating System
Real Time Operating SystemReal Time Operating System
Real Time Operating System
 
Os
OsOs
Os
 
Os Concepts
Os ConceptsOs Concepts
Os Concepts
 
Intro Basic of OS .ppt
Intro Basic of OS .pptIntro Basic of OS .ppt
Intro Basic of OS .ppt
 
Real time operating system
Real time operating systemReal time operating system
Real time operating system
 
Lab3F22.pdf
Lab3F22.pdfLab3F22.pdf
Lab3F22.pdf
 
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
 
Types of operating system.................
Types of operating system.................Types of operating system.................
Types of operating system.................
 
Mastering Real-time Linux
Mastering Real-time LinuxMastering Real-time Linux
Mastering Real-time Linux
 

Recently uploaded

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 

Rtos ss

  • 2. What is Real Time ? • “ Real time in operating systems: The ability of the operating system to provide a required level of service in a bounded response time.”
  • 3. WHAT IS RTOS. • It responds to inputs immediately(Real-Time). • Here the task is completed within a specified time delay. • In real life situations like controlling traffic signal or a nuclear reactor or an aircraft. • The operating system has to respond quickly. • Necessary signaling between interrupt routines and task code is handled by RTOS. • RTOS can suspend one task code subroutine in the middle of its processing in order to run another.
  • 4. What a RTOS is • Real time computing is equivalent to fast computing. • Real time systems operate in a static environment • Real time programming involves assembly coding, priority interrupt programming, writing device drivers.
  • 5. SELECTING AN ARCHITECTURE • Select the simplest architecture that will meet your response requirements. • If response requirements not possible, RTOS can be used.
  • 6. INTRODUCTION TO RTOS – A more complex software architecture is needed to handle multiple tasks, coordination, communication, and interrupt handling – an RTOS architecture – Distinction: • RTOS – OS and embedded software are integrated, ES starts and activates the OS – both run in the same address space • RTOS includes only service routines needed by the ES application • Desirable RTOS properties: use less memory, application programming interface, debugging tools, support for variety of microprocessors, already- debugged network drivers
  • 8. FUNCTIONS OF RTOS • Task management • Scheduling • Resource Allocation • Interrupt Handling
  • 9. Task management • In Real Time Applications the Process is called as Task which takes execution time and occupies memory. • Task management is the process of managing tasks through its life cycle.
  • 11. TASK AND TASK STATES • A task – a simple subroutine • ES application makes calls to the RTOS functions to start tasks, passing to the OS, start address, stack pointers, etc. of the tasks • Task States: – Running (Executing task) – Ready (possibly: waiting, dormant, delayed) – Blocked (possibly: suspended, pended)
  • 13. Task/Process States • Each task/Process can belong to one and only one state • The Scheduler only operates on the processes in the Ready state • There is a single process in the Run/current state at any time. • Transitions to and from the Ready queue are affected as a part of the execution of the RTOS resource/object services or as a result of timing events
  • 14. Typical Task Operations • creating and deleting tasks, • controlling task scheduling, and • obtaining task information.
  • 15. SCHEDULER – Scheduler – keeps track of the state of each task and decides which one task should go to running state. – schedules/shuffles tasks between Running and Ready states – Blocking is self-blocking by tasks, and moved to Running state via other tasks‟ interrupt signaling (when block-factor is removed/satisfied) – When a task is unblocked with a higher priority over the „running‟ task, the scheduler „switches‟ context immediately (for all pre-emptive RTOSs)
  • 17.
  • 18. Preemptive and Non preemptive RTOS Preemptive RTOS Stops low priority task as soon as high priority task unblocked Non preemptive RTOS Takes microprocessor away from the lower priority task when that task blocks
  • 19.
  • 20. Tasks and Data – Each tasks has its won context - not shared, private registers, stack, etc. – In addition, several tasks share common data (via global data declaration; use of „extern‟ in one task to point to another task that declares the shared data – Shared data caused the „shared-data problem‟ without solutions discussed in Chp4 or use of „Reentrancy‟ characterization of functions
  • 21.
  • 22.
  • 23.
  • 24.
  • 25. Semaphores and Shared Data • A new tool for atomicity – Semaphore – a variable/lock/flag used to control access to shared resource (to avoid shared-data problems in RTOS) – Protection at the start is via primitive function, called take, indexed by the semaphore – Protection at the end is via a primitive function, called release, also indexed similarly – Simple semaphores – Binary semaphores are often adequate for shared data problems in RTOS
  • 26.
  • 27.
  • 28.
  • 29. RTOS Semaphores & Initializing Semaphores – Using binary semaphores to solve the „tank monitoring‟ problem – The nuclear reactor system: The issue of initializing the semaphore variable in a dedicated task (not in a „competing‟ task) before initializing the OS – timing of tasks and priority overrides, which can undermine the effect of the semaphores – Solution: Call OSSemInit() before OSInit()
  • 30.
  • 31.
  • 32.
  • 33. Semaphores and Shared Data – Reentrancy, Semaphores, Multiple Semaphores, Device Signaling – Each shared data (resource/device) requires a separate semaphore for individual protection, allowing multiple tasks and data/resources/devices to be shared exclusively, while allowing efficient implementation and response time – example of a printer device signaled by a report-buffering task, via semaphore signaling, on each print of lines constituting the formatted and buffered report
  • 34.
  • 35. The initial values of semaphores – when not set properly or at the wrong place • The „symmetry‟ of takes and releases – must match or correspond – each „take‟ must have a corresponding „release‟ somewhere in the ES application • „Taking‟ the wrong semaphore unintentionally (issue with multiple semaphores) • Holding a semaphore for too long can cause „waiting‟ tasks‟ deadline to be missed • Priorities could be „inverted‟ and usually solved by „priority inheritance/promotion
  • 36.
  • 37. Semaphores and Shared Data – Variants: • Binary semaphores – single resource, one-at-a time, alternating in use (also for resources) • Counting semaphores – multiple instances of resources, increase/decrease of integer semaphore variable • Mutex – protects data shared while dealing with priority inversion problem – Summary – Protecting shared data in RTOS • Disabling/Enabling interrupts (for task code and interrupt routines), faster • Taking/Releasing semaphores (can‟t use them in interrupt routines), slower, affecting response times of those tasks that need the semaphore • Disabling task switches (no effect on interrupt routines), holds all other tasks‟ response