SlideShare une entreprise Scribd logo
1  sur  38
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

Real time Operating System
Real time Operating SystemReal time Operating System
Real time Operating System
Tech_MX
 
Embedded system notes
Embedded system notesEmbedded system notes
Embedded system notes
TARUN KUMAR
 

Tendances (20)

Real time Operating System
Real time Operating SystemReal time Operating System
Real time Operating System
 
Real Time Systems
Real Time SystemsReal Time Systems
Real Time Systems
 
RT linux
RT linuxRT linux
RT linux
 
Introduction to Embedded Architecture
Introduction to Embedded Architecture Introduction to Embedded Architecture
Introduction to Embedded Architecture
 
8086 memory segmentation
8086 memory segmentation8086 memory segmentation
8086 memory segmentation
 
Rtos Concepts
Rtos ConceptsRtos Concepts
Rtos Concepts
 
UNIT-I-RTOS and Concepts
UNIT-I-RTOS and ConceptsUNIT-I-RTOS and Concepts
UNIT-I-RTOS and Concepts
 
Introduction to msp430
Introduction to msp430Introduction to msp430
Introduction to msp430
 
Real time operating system
Real time operating systemReal time operating system
Real time operating system
 
8051 interrupts
8051 interrupts8051 interrupts
8051 interrupts
 
REAL TIME OPERATING SYSTEM PART 1
REAL TIME OPERATING SYSTEM PART 1REAL TIME OPERATING SYSTEM PART 1
REAL TIME OPERATING SYSTEM PART 1
 
ARM Architecture Subroutine and Flags
ARM Architecture Subroutine and FlagsARM Architecture Subroutine and Flags
ARM Architecture Subroutine and Flags
 
MicroC/OS-II
MicroC/OS-IIMicroC/OS-II
MicroC/OS-II
 
Introduction to Embedded System I: Chapter 2 (5th portion)
Introduction to Embedded System I: Chapter 2 (5th portion)Introduction to Embedded System I: Chapter 2 (5th portion)
Introduction to Embedded System I: Chapter 2 (5th portion)
 
Real Time Operating System
Real Time Operating SystemReal Time Operating System
Real Time Operating System
 
Vxworks
VxworksVxworks
Vxworks
 
Embedded system notes
Embedded system notesEmbedded system notes
Embedded system notes
 
RTOS Basic Concepts
RTOS Basic ConceptsRTOS Basic Concepts
RTOS Basic Concepts
 
Design challenges in embedded systems
Design challenges in embedded systemsDesign challenges in embedded systems
Design challenges in embedded systems
 
RTOS - Real Time Operating Systems
RTOS - Real Time Operating SystemsRTOS - Real Time Operating Systems
RTOS - Real Time Operating Systems
 

Similaire à Rtos ss

Real Time OS For Embedded Systems
Real Time OS For Embedded SystemsReal Time OS For Embedded Systems
Real Time OS For Embedded Systems
Himanshu Ghetia
 
seminarembedded-150504150805-conversion-gate02.pdf
seminarembedded-150504150805-conversion-gate02.pdfseminarembedded-150504150805-conversion-gate02.pdf
seminarembedded-150504150805-conversion-gate02.pdf
karunyamittapally
 
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
 
REAL TIME OPERATING SYSTEM
REAL TIME OPERATING SYSTEMREAL TIME OPERATING SYSTEM
REAL TIME OPERATING SYSTEM
prakrutijsh
 

Similaire à Rtos ss (20)

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 OS For Embedded Systems
Real Time OS For Embedded SystemsReal Time OS For Embedded Systems
Real Time OS For Embedded Systems
 
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)
 
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
 
REAL TIME OPERATING SYSTEM
REAL TIME OPERATING SYSTEMREAL TIME OPERATING SYSTEM
REAL TIME OPERATING SYSTEM
 

Dernier

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Dernier (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

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