SlideShare uma empresa Scribd logo
1 de 37
Baixar para ler offline
Real Time Operating Systems for
Networked Embedded Systems


        Subhashis Banerjee
   Indian Institute of Technology
                 Delhi
             suban@cse.iitd.ac.in

With: Soumyadeb Mitra, Nitin Rajput,
M.Balakrishnan
Fire alarm system: an example


                 Central server

                  TCP/IP over radio


                 Controllers: ARM based

                 Low bandwidth radio links

                 Sensors: microcontroller based
Fire Alarm System
  Problem
     Hundreds of sensors, each fitted with Low Range
      Wireless
        Sensor information to be logged in a server &
         appropriate action initiated
  Possible Solution
     Collaborative Action
        Routing
              Dynamic – Sensors/controllers may go down
              Auto Configurable – No/easy human intervention.
              Less Collision/Link Clogging
              Less no of intermediate nodes
                  Fast Response Time

              Secure
RTOS: Target Architectures

Processors         MIPS

Microcontrollers   ~20
ARM7                     100-133
ARM9                     180-250
Strong ARM         206
Intel Xscale             400
Mips4Kcore               400
X86
Presentation Outline
  Definitions
  Role of an OS in Real Time Systems
  Features of Real Time Operating Systems
     Scheduling
     Resource Allocation
     Interrupt Handling
     Other Issues
  Linux for Real Time Systems and RTLinux
  rtker – Our own RTOS
  Other RTOS’s
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.
  Example – Flight Control System
     All tasks in that system must execute on
      time.
  Non Example – PC system
Hard and Soft Real Time
Systems
  Hard Real Time System
     Failure to meet deadlines is fatal
     example : Flight Control System
  Soft Real Time System
     Late completion of jobs is undesirable but not
      fatal.
     System performance degrades as more & more
      jobs miss deadlines
     Online Databases
  Qualitative Definition.
Hard and Soft Real Time Systems
            (Operational Definition)

 Hard Real Time System
    Validation by provably correct procedures or
     extensive simulation that the system always meets
     the timings constraints
 Soft Real Time System
    Demonstration of jobs meeting some statistical
     constraints suffices.
 Example – Multimedia System
    25 frames per second on an average
Role of an OS in Real Time Systems

  Standalone Applications
      Often no OS involved
      Micro controller based Embedded Systems
  Some Real Time Applications are huge &
  complex
      Multiple threads
      Complicated Synchronization Requirements
      Filesystem / Network / Windowing support
      OS primitives reduce the software design time
Features of RTOS’s

  Scheduling.

  Resource Allocation.

  Interrupt Handling.

  Other issues like kernel size.
Scheduling in RTOS
  More information about the tasks are known
     No of tasks
     Resource Requirements
     Release Time
     Execution time
     Deadlines
  Being a more deterministic system better
  scheduling algorithms can be devised.
Scheduling Algorithms in RTOS

  Clock Driven Scheduling

  Weighted Round Robin Scheduling

  Priority Scheduling
  (Greedy / List / Event Driven)
Scheduling Algorithms in RTOS (contd)

  Clock Driven
      All parameters about jobs (release time/
       execution time/deadline) known in
       advance.
      Schedule can be computed offline or at
       some regular time instances.
      Minimal runtime overhead.
      Not suitable for many applications.
Scheduling Algorithms in RTOS (contd)

  Weighted Round Robin
      Jobs scheduled in FIFO manner
      Time quantum given to jobs is proportional to it’s
       weight
      Example use : High speed switching network
         QOS guarantee.
      Not suitable for precedence constrained jobs.
         Job A can run only after Job B. No point in giving time
          quantum to Job B before Job A.
Scheduling Algorithms in RTOS (contd)

  Priority Scheduling
  (Greedy/List/Event Driven)
      Processor never left idle when there are
       ready tasks
      Processor allocated to processes
       according to priorities
      Priorities
         static - at design time
         Dynamic - at runtime
Priority Scheduling

  Earliest Deadline First (EDF)
      Process with earliest deadline given highest
       priority
  Least Slack Time First (LSF)
      slack = relative deadline – execution left
  Rate Monotonic Scheduling (RMS)
      For periodic tasks
      Tasks priority inversely proportional to it’s period
Resource Allocation in RTOS
  Resource Allocation
     The issues with scheduling applicable here.
     Resources can be allocated in
        Weighted Round Robin
        Priority Based

  Some resources are non preemptible
     Example : semaphores
  Priority Inversion if priority scheduling is used
Priority Inversion
Solutions to Priority Inversion
  Non Blocking Critical Section
      Higher priority Thread may get blocked by
       unrelated low priority thread
  Priority Ceiling
      Each resource has an assigned priority
      Priority of thread is the highest of all priorities of
       the resources it’s holding
  Priority Inheritance
      The thread holding a resource inherits the priority
       of the thread blocked on that resource
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
     No Protection
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
         No notion of deadlines
  Resource Allocation
      No support for handling priority inversion
Interrupt Handling in Linux
  Interrupts are disabled in ISR/critical
  sections of the kernel
  No worst case bound on interrupt
  latency avaliable
      eg: Disk Drivers may disable interrupt for
       few hundred milliseconds
  Not suitable for Real Time Applications
      Interrupts may be missed
Other Problems with Linux

  Processes are non preemtible in Kernel
  Mode
     System calls like fork take a lot of time
     High priority thread might wait for a low
      priority thread to complete it’s system call
  Processes are heavy weight
     Context switch takes several hundred
      microseconds
Why Linux
 Coexistence of Real Time Applications
 with non Real Time Ones
     Example http server
 Device Driver Base
 Stability
RTLinux
  Real Time Kernel at the lowest level
  Linux Kernel is a low priority thread
     Executed only when no real time tasks
  Interrupts trapped by the Real Time
  Kernel and passed onto Linux Kernel
     Software emulation to hardware interrupts
        Interrupts are queued by RTLinux
        Software emulation to disable_interrupt()
RTLinux (contd)
  Real Time Tasks
     Statically allocate memory
     No address space protection
  Non Real Time Tasks are developed in
  Linux
  Communication
     Queues
     Shared memory
RTLinux Framework
rtker – Our RTOS
  Motivation
     Our own OS
        Full grasp over source code – Easily modifiable, portable

  Features
     Modular Design
        Isolation of Architecture/CPU dependent and
         independent code – Easy to Port
     Pluggable Scheduler
     Two level Interrupt Handling
     Small footprint
     Oskit’s Device Driver Framework
Pluggable Scheduler
  Scheduler - part of the Application
  Kernel interacts with the scheduler
  through an API
  Application developer needs to
  implement the scheduler API
     Can optimize on Data Structures &
      Algorithms for implementing the scheduler
rtker – Block Diagram
Two Level Interrupt Handling
  Two level Interrupt Handling
     Top Half Interrupt Handler
        Called Immediately – Kernel never disables interrupts
        Cannot invoke thread library functions - Race Conditions
     Bottom Half Interrupt Handler
        Invoked when kernel not in Critical Section
        Can invoke thread library functions

  Very Low Response time (as compared to
  Linux)
Two Level Interrupt Handling
Rtos 2
Other Features
  Footprint
     Small footprint (~50kb)
  Oskit’s Device Driver Framework
     Allows direct porting of existing drivers
      from Linux.
     Example – Ethernet Driver of Linux
Other RTOS’s

  LynxOS
     Microkernel Architecture
        Kernel provides scheduling/interrupt handling
     Additional features through Kernel Plug Ins(KPIs)
        TCP/IP stack , Filesystem
        KPI’s are multithreaded
     Memory Protection/ Demand Paging Optional
     Development and Deployment on the same host
        OS support for compilers/debuggers
Other RTOS’s (contd)

  VxWorks
      Monolithic Architecture
      Real Time Posix compliant
      Cross development System
  pSOS
      Object Oriented OS
Peripheral devices and protocols
  • Interfacing
     Serial/parallel ports, USB, I2C, PCMCIA, IDE
  • Communication
     Serial, Ethernet, Low bandwidth radio, IrDA,
     802.11b based devices
  • User Interface
     LCD, Keyboard, Touch sensors, Sound, Digital
     pads, Webcams
  • Sensors
     A variety of sensors using fire, temperature,
     pressure, water level, seismic, sound, vision

Mais conteúdo relacionado

Mais procurados

Rtos concepts
Rtos conceptsRtos concepts
Rtos conceptsanishgoel
 
Real Time Kernels
Real Time KernelsReal Time Kernels
Real Time KernelsArnav Soni
 
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
 
Real time operating-systems
Real time operating-systemsReal time operating-systems
Real time operating-systemskasi963
 
Basic functions & types of RTOS ES
Basic functions & types of  RTOS ESBasic functions & types of  RTOS ES
Basic functions & types of RTOS ESJOLLUSUDARSHANREDDY
 
Introduction to Real-Time Operating Systems
Introduction to Real-Time Operating SystemsIntroduction to Real-Time Operating Systems
Introduction to Real-Time Operating Systemscoolmirza143
 
Real Time Operating Systems
Real Time Operating SystemsReal Time Operating Systems
Real Time Operating SystemsRohit Joshi
 
Real Time Operating Systems
Real Time Operating SystemsReal Time Operating Systems
Real Time Operating SystemsPawandeep Kaur
 
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
 
Chapter 19 - Real Time Systems
Chapter 19 - Real Time SystemsChapter 19 - Real Time Systems
Chapter 19 - Real Time SystemsWayne Jones Jnr
 
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 1Abu Bakr Ramadan
 
RTOS implementation
RTOS implementationRTOS implementation
RTOS implementationRajan Kumar
 

Mais procurados (20)

RTOS
RTOSRTOS
RTOS
 
Rtos concepts
Rtos conceptsRtos concepts
Rtos concepts
 
Real Time Kernels
Real Time KernelsReal Time Kernels
Real Time Kernels
 
Rtos
RtosRtos
Rtos
 
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
 
Real time operating-systems
Real time operating-systemsReal time operating-systems
Real time operating-systems
 
Basic functions & types of RTOS ES
Basic functions & types of  RTOS ESBasic functions & types of  RTOS ES
Basic functions & types of RTOS ES
 
RTOS
RTOSRTOS
RTOS
 
Introduction to Real-Time Operating Systems
Introduction to Real-Time Operating SystemsIntroduction to Real-Time Operating Systems
Introduction to Real-Time Operating Systems
 
Rtos 8051
Rtos 8051Rtos 8051
Rtos 8051
 
Real Time Operating Systems
Real Time Operating SystemsReal Time Operating Systems
Real Time Operating Systems
 
Real Time Operating Systems
Real Time Operating SystemsReal Time Operating Systems
Real Time Operating Systems
 
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)
 
Chapter 19 - Real Time Systems
Chapter 19 - Real Time SystemsChapter 19 - Real Time Systems
Chapter 19 - Real Time Systems
 
Real Time Operating Systems
Real Time Operating SystemsReal Time Operating Systems
Real Time Operating Systems
 
Real time system tsp
Real time system tspReal time system tsp
Real time system tsp
 
How to choose an RTOS?
How to choose an RTOS?How to choose an RTOS?
How to choose an RTOS?
 
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
 
RTOS implementation
RTOS implementationRTOS implementation
RTOS implementation
 
RT linux
RT linuxRT linux
RT linux
 

Semelhante a Rtos 2

Real Time OS For Embedded Systems
Real Time OS For Embedded SystemsReal Time OS For Embedded Systems
Real Time OS For Embedded SystemsHimanshu Ghetia
 
Four Ways to Improve Linux Performance IEEE Webinar, R2.0
Four Ways to Improve Linux Performance IEEE Webinar, R2.0Four Ways to Improve Linux Performance IEEE Webinar, R2.0
Four Ways to Improve Linux Performance IEEE Webinar, R2.0Michael Christofferson
 
Testing real-time Linux. What to test and how
Testing real-time Linux. What to test and how Testing real-time Linux. What to test and how
Testing real-time Linux. What to test and how Chirag Jog
 
Real time Operating System
Real time Operating SystemReal time Operating System
Real time Operating SystemTech_MX
 
Enea Enabling Real-Time in Linux Whitepaper
Enea Enabling Real-Time in Linux WhitepaperEnea Enabling Real-Time in Linux Whitepaper
Enea Enabling Real-Time in Linux WhitepaperEnea Software AB
 
rtosbyshibu-131026100746-phpapp01.pdf
rtosbyshibu-131026100746-phpapp01.pdfrtosbyshibu-131026100746-phpapp01.pdf
rtosbyshibu-131026100746-phpapp01.pdfreemasajin1
 
Embedded Intro India05
Embedded Intro India05Embedded Intro India05
Embedded Intro India05Rajesh Gupta
 
pptonrtosbychetan001-140213003314-phpapp02.pdf
pptonrtosbychetan001-140213003314-phpapp02.pdfpptonrtosbychetan001-140213003314-phpapp02.pdf
pptonrtosbychetan001-140213003314-phpapp02.pdfJaganBehera8
 
Real-time Programming in Java
Real-time Programming in JavaReal-time Programming in Java
Real-time Programming in JavaAleš Plšek
 
What is RTOS Step by Step Guide?
What is RTOS Step by Step Guide?What is RTOS Step by Step Guide?
What is RTOS Step by Step Guide?IntervalZero
 

Semelhante a Rtos 2 (20)

rtos.ppt
rtos.pptrtos.ppt
rtos.ppt
 
Real Time Operating System
Real Time Operating SystemReal Time Operating System
Real Time Operating System
 
UNIT V PPT.ppt
UNIT V PPT.pptUNIT V PPT.ppt
UNIT V PPT.ppt
 
Real Time OS For Embedded Systems
Real Time OS For Embedded SystemsReal Time OS For Embedded Systems
Real Time OS For Embedded Systems
 
Four Ways to Improve Linux Performance IEEE Webinar, R2.0
Four Ways to Improve Linux Performance IEEE Webinar, R2.0Four Ways to Improve Linux Performance IEEE Webinar, R2.0
Four Ways to Improve Linux Performance IEEE Webinar, R2.0
 
Testing real-time Linux. What to test and how
Testing real-time Linux. What to test and how Testing real-time Linux. What to test and how
Testing real-time Linux. What to test and how
 
Rtos Concepts
Rtos ConceptsRtos Concepts
Rtos Concepts
 
Real time Operating System
Real time Operating SystemReal time Operating System
Real time Operating System
 
Enea Enabling Real-Time in Linux Whitepaper
Enea Enabling Real-Time in Linux WhitepaperEnea Enabling Real-Time in Linux Whitepaper
Enea Enabling Real-Time in Linux Whitepaper
 
L11-RTOS.ppt
L11-RTOS.pptL11-RTOS.ppt
L11-RTOS.ppt
 
Rtos by shibu
Rtos by shibuRtos by shibu
Rtos by shibu
 
rtosbyshibu-131026100746-phpapp01.pdf
rtosbyshibu-131026100746-phpapp01.pdfrtosbyshibu-131026100746-phpapp01.pdf
rtosbyshibu-131026100746-phpapp01.pdf
 
Embedded Intro India05
Embedded Intro India05Embedded Intro India05
Embedded Intro India05
 
pptonrtosbychetan001-140213003314-phpapp02.pdf
pptonrtosbychetan001-140213003314-phpapp02.pdfpptonrtosbychetan001-140213003314-phpapp02.pdf
pptonrtosbychetan001-140213003314-phpapp02.pdf
 
Real-time Programming in Java
Real-time Programming in JavaReal-time Programming in Java
Real-time Programming in Java
 
Making Linux do Hard Real-time
Making Linux do Hard Real-timeMaking Linux do Hard Real-time
Making Linux do Hard Real-time
 
Making Linux do Hard Real-time
Making Linux do Hard Real-timeMaking Linux do Hard Real-time
Making Linux do Hard Real-time
 
Embedded os
Embedded osEmbedded os
Embedded os
 
Os Concepts
Os ConceptsOs Concepts
Os Concepts
 
What is RTOS Step by Step Guide?
What is RTOS Step by Step Guide?What is RTOS Step by Step Guide?
What is RTOS Step by Step Guide?
 

Último

Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Will Schroeder
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDELiveplex
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024D Cloud Solutions
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Commit University
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostMatt Ray
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXTarek Kalaji
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsSafe Software
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxGDSC PJATK
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding TeamAdam Moalla
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfinfogdgmi
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintMahmoud Rabie
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxMatsuo Lab
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URLRuncy Oommen
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemAsko Soukka
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Adtran
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaborationbruanjhuli
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdfPedro Manuel
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024SkyPlanner
 

Último (20)

Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
 
20230104 - machine vision
20230104 - machine vision20230104 - machine vision
20230104 - machine vision
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024
 
20150722 - AGV
20150722 - AGV20150722 - AGV
20150722 - AGV
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBX
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptx
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdf
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership Blueprint
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptx
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URL
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystem
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdf
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024
 

Rtos 2

  • 1. Real Time Operating Systems for Networked Embedded Systems Subhashis Banerjee Indian Institute of Technology Delhi suban@cse.iitd.ac.in With: Soumyadeb Mitra, Nitin Rajput, M.Balakrishnan
  • 2. Fire alarm system: an example Central server TCP/IP over radio Controllers: ARM based Low bandwidth radio links Sensors: microcontroller based
  • 3. Fire Alarm System Problem  Hundreds of sensors, each fitted with Low Range Wireless  Sensor information to be logged in a server & appropriate action initiated Possible Solution  Collaborative Action  Routing  Dynamic – Sensors/controllers may go down  Auto Configurable – No/easy human intervention.  Less Collision/Link Clogging  Less no of intermediate nodes  Fast Response Time  Secure
  • 4. RTOS: Target Architectures Processors MIPS Microcontrollers ~20 ARM7 100-133 ARM9 180-250 Strong ARM 206 Intel Xscale 400 Mips4Kcore 400 X86
  • 5. Presentation Outline Definitions Role of an OS in Real Time Systems Features of Real Time Operating Systems  Scheduling  Resource Allocation  Interrupt Handling  Other Issues Linux for Real Time Systems and RTLinux rtker – Our own RTOS Other RTOS’s
  • 6. 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. Example – Flight Control System  All tasks in that system must execute on time. Non Example – PC system
  • 7. Hard and Soft Real Time Systems Hard Real Time System  Failure to meet deadlines is fatal  example : Flight Control System Soft Real Time System  Late completion of jobs is undesirable but not fatal.  System performance degrades as more & more jobs miss deadlines  Online Databases Qualitative Definition.
  • 8. Hard and Soft Real Time Systems (Operational Definition) Hard Real Time System  Validation by provably correct procedures or extensive simulation that the system always meets the timings constraints Soft Real Time System  Demonstration of jobs meeting some statistical constraints suffices. Example – Multimedia System  25 frames per second on an average
  • 9. Role of an OS in Real Time Systems Standalone Applications  Often no OS involved  Micro controller based Embedded Systems Some Real Time Applications are huge & complex  Multiple threads  Complicated Synchronization Requirements  Filesystem / Network / Windowing support  OS primitives reduce the software design time
  • 10. Features of RTOS’s Scheduling. Resource Allocation. Interrupt Handling. Other issues like kernel size.
  • 11. Scheduling in RTOS More information about the tasks are known  No of tasks  Resource Requirements  Release Time  Execution time  Deadlines Being a more deterministic system better scheduling algorithms can be devised.
  • 12. Scheduling Algorithms in RTOS Clock Driven Scheduling Weighted Round Robin Scheduling Priority Scheduling (Greedy / List / Event Driven)
  • 13. Scheduling Algorithms in RTOS (contd) Clock Driven  All parameters about jobs (release time/ execution time/deadline) known in advance.  Schedule can be computed offline or at some regular time instances.  Minimal runtime overhead.  Not suitable for many applications.
  • 14. Scheduling Algorithms in RTOS (contd) Weighted Round Robin  Jobs scheduled in FIFO manner  Time quantum given to jobs is proportional to it’s weight  Example use : High speed switching network  QOS guarantee.  Not suitable for precedence constrained jobs.  Job A can run only after Job B. No point in giving time quantum to Job B before Job A.
  • 15. Scheduling Algorithms in RTOS (contd) Priority Scheduling (Greedy/List/Event Driven)  Processor never left idle when there are ready tasks  Processor allocated to processes according to priorities  Priorities  static - at design time  Dynamic - at runtime
  • 16. Priority Scheduling Earliest Deadline First (EDF)  Process with earliest deadline given highest priority Least Slack Time First (LSF)  slack = relative deadline – execution left Rate Monotonic Scheduling (RMS)  For periodic tasks  Tasks priority inversely proportional to it’s period
  • 17. Resource Allocation in RTOS Resource Allocation  The issues with scheduling applicable here.  Resources can be allocated in  Weighted Round Robin  Priority Based Some resources are non preemptible  Example : semaphores Priority Inversion if priority scheduling is used
  • 19. Solutions to Priority Inversion Non Blocking Critical Section  Higher priority Thread may get blocked by unrelated low priority thread Priority Ceiling  Each resource has an assigned priority  Priority of thread is the highest of all priorities of the resources it’s holding Priority Inheritance  The thread holding a resource inherits the priority of the thread blocked on that resource
  • 20. 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  No Protection
  • 21. 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  No notion of deadlines Resource Allocation  No support for handling priority inversion
  • 22. Interrupt Handling in Linux Interrupts are disabled in ISR/critical sections of the kernel No worst case bound on interrupt latency avaliable  eg: Disk Drivers may disable interrupt for few hundred milliseconds Not suitable for Real Time Applications  Interrupts may be missed
  • 23. Other Problems with Linux Processes are non preemtible in Kernel Mode  System calls like fork take a lot of time  High priority thread might wait for a low priority thread to complete it’s system call Processes are heavy weight  Context switch takes several hundred microseconds
  • 24. Why Linux Coexistence of Real Time Applications with non Real Time Ones  Example http server Device Driver Base Stability
  • 25. RTLinux Real Time Kernel at the lowest level Linux Kernel is a low priority thread  Executed only when no real time tasks Interrupts trapped by the Real Time Kernel and passed onto Linux Kernel  Software emulation to hardware interrupts  Interrupts are queued by RTLinux  Software emulation to disable_interrupt()
  • 26. RTLinux (contd) Real Time Tasks  Statically allocate memory  No address space protection Non Real Time Tasks are developed in Linux Communication  Queues  Shared memory
  • 28. rtker – Our RTOS Motivation  Our own OS  Full grasp over source code – Easily modifiable, portable Features  Modular Design  Isolation of Architecture/CPU dependent and independent code – Easy to Port  Pluggable Scheduler  Two level Interrupt Handling  Small footprint  Oskit’s Device Driver Framework
  • 29. Pluggable Scheduler Scheduler - part of the Application Kernel interacts with the scheduler through an API Application developer needs to implement the scheduler API  Can optimize on Data Structures & Algorithms for implementing the scheduler
  • 30. rtker – Block Diagram
  • 31. Two Level Interrupt Handling Two level Interrupt Handling  Top Half Interrupt Handler  Called Immediately – Kernel never disables interrupts  Cannot invoke thread library functions - Race Conditions  Bottom Half Interrupt Handler  Invoked when kernel not in Critical Section  Can invoke thread library functions Very Low Response time (as compared to Linux)
  • 34. Other Features Footprint  Small footprint (~50kb) Oskit’s Device Driver Framework  Allows direct porting of existing drivers from Linux.  Example – Ethernet Driver of Linux
  • 35. Other RTOS’s LynxOS  Microkernel Architecture  Kernel provides scheduling/interrupt handling  Additional features through Kernel Plug Ins(KPIs)  TCP/IP stack , Filesystem  KPI’s are multithreaded  Memory Protection/ Demand Paging Optional  Development and Deployment on the same host  OS support for compilers/debuggers
  • 36. Other RTOS’s (contd) VxWorks  Monolithic Architecture  Real Time Posix compliant  Cross development System pSOS  Object Oriented OS
  • 37. Peripheral devices and protocols • Interfacing Serial/parallel ports, USB, I2C, PCMCIA, IDE • Communication Serial, Ethernet, Low bandwidth radio, IrDA, 802.11b based devices • User Interface LCD, Keyboard, Touch sensors, Sound, Digital pads, Webcams • Sensors A variety of sensors using fire, temperature, pressure, water level, seismic, sound, vision