Real Time Operating Systems for Networked Embedded Systems Subhashis Banerjee Indian Institute of Technology Delhi With: Soumyadeb.

Slides:



Advertisements
Similar presentations
Introduction to Embedded Systems Resource Management - III Lecture 19.
Advertisements

Threads, SMP, and Microkernels
Tasks Periodic The period is the amount of time between each iteration of a regularly repeated task Time driven The task is automatically activated by.
Chapter 13 Embedded Systems
Contiki A Lightweight and Flexible Operating System for Tiny Networked Sensors Presented by: Jeremy Schiff.
CS 3013 & CS 502 Summer 2006 Scheduling1 The art and science of allocating the CPU and other resources to processes.
Introduction to Operating Systems – Windows process and thread management In this lecture we will cover Threads and processes in Windows Thread priority.
CSE Fall Introduction - 1 What is an Embedded Systems  Its not a desktop system  Fixed or semi-fixed functionality (not user programmable)
Chapter 13 Embedded Systems
Figure 1.1 Interaction between applications and the operating system.
Courseware Basics of Real-Time Scheduling Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard Petersens Plads, Building.
Real-Time Kernels and Operating Systems. Operating System: Software that coordinates multiple tasks in processor, including peripheral interfacing Types.
Wk 2 – Scheduling 1 CS502 Spring 2006 Scheduling The art and science of allocating the CPU and other resources to processes.
By Group: Ghassan Abdo Rayyashi Anas to’meh Supervised by Dr. Lo’ai Tawalbeh.
Comparative Operating Systems Fall 2001 An Examination of Embedded Linux as a Real Time Operating System Mark Mahoney.
1 Chapter 13 Embedded Systems Embedded Systems Characteristics of Embedded Operating Systems.
The Design of Robust and Efficient Microkernel ManRiX, The Design of Robust and Efficient Microkernel Presented by: Manish Regmi
Chapter 19: Real-Time Systems Silberschatz, Galvin and Gagne ©2005 AE4B33OSS Chapter 19: Real-Time Systems System Characteristics Features of Real-Time.
Real-Time Operating Systems Suzanne Rivoire November 20, 2002
Performance Evaluation of Real-Time Operating Systems
RTOS Design & Implementation Swetanka Kumar Mishra & Kirti Chawla.
An Introduction and Practical approach to RTOS concepts.
Chapter 8 Windows Outline Programming Windows 2000 System structure Processes and threads in Windows 2000 Memory management The Windows 2000 file.
1 Lecture 4: Threads Operating System Fall Contents Overview: Processes & Threads Benefits of Threads Thread State and Operations User Thread.
Operating Systems Real-Time Operating Systems
Chapter 4 Threads, SMP, and Microkernels Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design.
Scheduling policies for real- time embedded systems.
Real-Time Operating Systems for Embedded Computing 李姿宜 R ,06,10.
Multiprocessor and Real-Time Scheduling Chapter 10.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 7 OS System Structure.
Real Time Operating Systems Michael Thomas Date: Rev. 1.00Date.
Multithreaded Programing. Outline Overview of threads Threads Multithreaded Models  Many-to-One  One-to-One  Many-to-Many Thread Libraries  Pthread.
1 VxWorks 5.4 Group A3: Wafa’ Jaffal Kathryn Bean.
The Mach System Silberschatz et al Presented By Anjana Venkat.
CSCI1600: Embedded and Real Time Software Lecture 24: Real Time Scheduling II Steven Reiss, Fall 2015.
19.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Chapter 19: Real-Time Systems.
Chapter 19: Real-Time Systems Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 19: Real-Time Systems System Characteristics.
For a good summary, visit:
1.  System Characteristics  Features of Real-Time Systems  Implementing Real-Time Operating Systems  Real-Time CPU Scheduling  An Example: VxWorks5.x.
Unit - I Real Time Operating System. Content : Operating System Concepts Real-Time Tasks Real-Time Systems Types of Real-Time Tasks Real-Time Operating.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
Threads, SMP, and Microkernels Chapter 4. Processes and Threads Operating systems use processes for two purposes - Resource allocation and resource ownership.
Outlines  Introduction  Kernel Structure  Porting.
Real-Time Operating Systems RTOS For Embedded systems.
Introduction to Operating Systems Concepts
Computer System Structures
Embedded System Scheduling
Introduction to Real-Time Operating Systems
REAL-TIME OPERATING SYSTEMS
Chapter 6: CPU Scheduling (Cont’d)
Chapter 19: Real-Time Systems
Lecture 12: Real-Time Scheduling
EEE Embedded Systems Design Process in Operating Systems 서강대학교 전자공학과
CS 6560: Operating Systems Design
Topics Covered What is Real Time Operating System (RTOS)
Unit OS9: Real-Time and Embedded Systems
EEE 6494 Embedded Systems Design
Real Time Operating Systems for Networked Embedded Systems
Chapter 2 Scheduling.
Real Time Operating System
Real-time Software Design
Real-Time Operating Systems
Chapter 2: The Linux System Part 3
CSCI1600: Embedded and Real Time Software
Lecture Topics: 11/1 General Operating System Concepts Processes
CPU scheduling decisions may take place when a process:
Multiprocessor and Real-Time Scheduling
Chapter 19: Real-Time Systems
CSCI1600: Embedded and Real Time Software
Operating Systems Real-Time Operating Systems
Presentation transcript:

Real Time Operating Systems for Networked Embedded Systems Subhashis Banerjee Indian Institute of Technology Delhi With: Soumyadeb Mitra, Nitin Rajput, M.Balakrishnan

Fire alarm system: an example Sensors: microcontroller based Controllers: ARM based Central server Low bandwidth radio links TCP/IP over radio

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 ProcessorsMIPS Microcontrollers ~20 ARM ARM Strong ARM206 Intel Xscale400 Mips4Kcore400 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 RTOSs

Real Time System A system is said to be Real Time if it is required to complete its work & deliver its 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 RTOSs 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 its 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 its 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 its 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 its 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 Oskits 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

Other Features Footprint Small footprint (~50kb) Oskits Device Driver Framework Allows direct porting of existing drivers from Linux. Example – Ethernet Driver of Linux

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

Other RTOSs (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, b 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