Commercial Real-time Operating Systems An Introduction. Swaminathan Sivasubramanian Dependable Computing & Networking Laboratory

Similar documents
6/17/2011. Real-time Operating Systems

EECS 571 Principles of Real-Time Embedded Systems. Lecture Note #10: More on Scheduling and Introduction of Real-Time OS

Embedded Systems. 6. Real-Time Operating Systems

Multiprocessor and Real- Time Scheduling. Chapter 10

* There are more than 100 hundred commercial RTOS with memory footprints from few hundred kilobytes to large multiprocessor systems

Real-Time Systems Hermann Härtig Real-Time Operating Systems Brief Overview

Implementing Scheduling Algorithms. Real-Time and Embedded Systems (M) Lecture 9

Real-Time Systems. Real-Time Operating Systems

Multiprocessor and Real-Time Scheduling. Chapter 10

REAL-TIME OPERATING SYSTEMS SHORT OVERVIEW

Real-time Support in Operating Systems

REAL TIME OPERATING SYSTEM PROGRAMMING-I: VxWorks

Systemy RT i embedded Wykład 11 Systemy RTOS

Real-Time & Embedded Operating Systems

A Predictable RTOS. Mantis Cheng Department of Computer Science University of Victoria

Outline. Introduction. Survey of Device Driver Management in Real-Time Operating Systems

What s An OS? Cyclic Executive. Interrupts. Advantages Simple implementation Low overhead Very predictable

6/20/2018. Lecture 2: Platforms & RTOS. Outline. Lab Setup (20 min) Labs work. Lecture: Platform + RTOS

Lesson 5: Software for embedding in System- Part 2

Handout. The ARM Instruction Set. Real Time Systems. Real Time Operating Systems. Real Time System Organization. Classification of Real Time Systems

EMBEDDED OPERATING SYSTEMS

Zilog Real-Time Kernel

CSE 237A Middleware and Operating Systems. Tajana Simunic Rosing Department of Computer Science and Engineering University of California, San Diego.

Real-Time Programming

Rab Nawaz Khan Jadoon

Embedded Systems. 5. Operating Systems. Lothar Thiele. Computer Engineering and Networks Laboratory

TDDD07 Real-time Systems Lecture 10: Wrapping up & Real-time operating systems

Reference Model and Scheduling Policies for Real-Time Systems

CSE 4/521 Introduction to Operating Systems. Lecture 29 Windows 7 (History, Design Principles, System Components, Programmer Interface) Summer 2018

SMD149 - Operating Systems

ZiLOG Real-Time Kernel Version 1.2.0

Uniprocessor Scheduling. Basic Concepts Scheduling Criteria Scheduling Algorithms. Three level scheduling

Module 8. Industrial Embedded and Communication Systems. Version 2 EE IIT, Kharagpur 1

GLOSSARY. VisualDSP++ Kernel (VDK) User s Guide B-1

Operating Systems Overview. Chapter 2

The control of I/O devices is a major concern for OS designers

EMERALDS: a small-memory real-time microkernel

Real-Time Operating Systems (Working Draft) What is an Operating System (OS)?

Chapter 4 Threads, SMP, and

ECE519 Advanced Operating Systems

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING UNIT-1

Real-Time Systems 1. Basic Concepts

Frequently Asked Questions about Real-Time


POSIX in Real-Time. By Kevin M. Obenland 03/15/2001. Daniel Correia nºmec Carlos Guisado nºmec 49099

BRDS ( , WS 2017) Ulrich Schmid

OVERVIEW. Last Week: But if frequency of high priority task increases temporarily, system may encounter overload: Today: Slide 1. Slide 3.

SIDDHARTH GROUP OF INSTITUTIONS :: PUTTUR Siddharth Nagar, Narayanavanam Road QUESTION BANK (DESCRIPTIVE) UNIT I OPERATING SYSTEMS

DSP/BIOS Kernel Scalable, Real-Time Kernel TM. for TMS320 DSPs. Product Bulletin

OPERATING SYSTEM CONCEPTS UNDERSTAND!!! IMPLEMENT!!! ANALYZE!!!

For use by students enrolled in #71251 CSE430 Fall 2012 at Arizona State University. Do not use if not enrolled.

Embedded Systems: OS. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Chapter 19: Real-Time Systems. Operating System Concepts 8 th Edition,

RT extensions/applications of general-purpose OSs

Embedded Software Programming

Chapter 13: I/O Systems

Module 12: I/O Systems

Frequently Asked Questions about Real-Time

The Real-time Specification for Java

Administrative Stuff. We are now in week 11 No class on Thursday About one month to go. Spend your time wisely Make any major decisions w/ Client

AUTOBEST: A United AUTOSAR-OS And ARINC 653 Kernel. Alexander Züpke, Marc Bommert, Daniel Lohmann

TYPES OF OPERATING SYSTEMS. Dimple Juneja

Model Based Development of Embedded Control Software

Device-Functionality Progression

Chapter 12: I/O Systems. I/O Hardware

Embedded Systems: OS

Process Scheduling Queues

ACM SOSP 99 paper by Zuberi et al.

Comparison of scheduling in RTLinux and QNX. Andreas Lindqvist, Tommy Persson,

by I.-C. Lin, Dept. CS, NCTU. Textbook: Operating System Concepts 8ed CHAPTER 13: I/O SYSTEMS

Embedded Linux Architecture

CHAPTER 3 LabVIEW REAL TIME APPLICATION DEVELOPMENT REFERENCES: [1] NI, Real Time LabVIEW. [2] R. Bishop, LabVIEW 2009.

Chapter 6: CPU Scheduling. Operating System Concepts 9 th Edition

Module 20: Multi-core Computing Multi-processor Scheduling Lecture 39: Multi-processor Scheduling. The Lecture Contains: User Control.

Threads, SMP, and Microkernels. Chapter 4

Real-Time Operating Systems Design and Implementation. LS 12, TU Dortmund

Chapter 13: I/O Systems

Chapter 13: I/O Systems. Chapter 13: I/O Systems. Objectives. I/O Hardware. A Typical PC Bus Structure. Device I/O Port Locations on PCs (partial)

Multiprocessor scheduling

3.1 Introduction. Computers perform operations concurrently

Operating Systems, Fall

Subject Name: OPERATING SYSTEMS. Subject Code: 10EC65. Prepared By: Kala H S and Remya R. Department: ECE. Date:

SE300 SWE Practices. Lecture 10 Introduction to Event- Driven Architectures. Tuesday, March 17, Sam Siewert

Chapter 13: I/O Systems

İzmir Institute of Technology Embedded Systems Lab. Real-Time Systems. Asst. Prof. Dr. Tolga Ayav Department of Computer Engineering

VALLIAMMAI ENGINEERING COLLEGE

Interconnecting Components

REAL-TIME MULTITASKING KERNEL FOR IBM-BASED MICROCOMPUTERS

Operating Systems: Internals and Design Principles. Chapter 4 Threads Seventh Edition By William Stallings

NuttX Realtime Programming

CSC Operating Systems Fall Lecture - II OS Structures. Tevfik Ko!ar. Louisiana State University. August 27 th, 2009.

Announcements. Computer System Organization. Roadmap. Major OS Components. Processes. Tevfik Ko!ar. CSC Operating Systems Fall 2009

Windows 7 Overview. Windows 7. Objectives. The History of Windows. CS140M Fall Lake 1

CPU Scheduling. Daniel Mosse. (Most slides are from Sherif Khattab and Silberschatz, Galvin and Gagne 2013)

Operating Systems Overview. Chapter 2

OS Design Approaches. Roadmap. OS Design Approaches. Tevfik Koşar. Operating System Design and Implementation

Process Characteristics

Chapter 12: I/O Systems

Chapter 13: I/O Systems

Chapter 12: I/O Systems. Operating System Concepts Essentials 8 th Edition

Transcription:

Commercial Real-time Operating Systems An Introduction Swaminathan Sivasubramanian Dependable Computing & Networking Laboratory swamis@iastate.edu

Outline Introduction RTOS Issues and functionalities LynxOS QNX/Neutrino VRTX VxWorks Spring Kernel Distributed RTOS ARTS MARS

Commercial and Research RTOS Commercial RTOSes different from traditional OS gives more predictability Used in the following areas such as: Embedded Systems or Industrial Control Systems Parallel and Distributed Systems E.g. LynxOS, VxWorks, psos, Spring,ARTS, Maruti, MARS Traditionally these systems can be classified into a Uniprocessor, Multiprocessor or Distributed Real-Time OS

RTOS Issues Real-Time POSIX API standard compliance Whether pre-emptive fixed-priority scheduling is supported Support for standard synchronization primitives Support for light weight real-time threads APIs used for task-handling Scalability Footprint of the kernel how huge is the kernel? Can the kernel be scaled down to fit in the ROM of the system?

RTOS Issues (contd..) Modularity How does the functionalities like I/O, file system, networking services behave? Can they be added at run-time or can they be changed at run-time? Can a new service be added at run-time? Type of RTOS kernel Monolithic kernel less run-time overhead but not extensible Microkernel high run-time overhead but highly extensible

RTOS Issues (contd..) Speed and Efficiency Run-time overhead most of the modern RTOSes are microkernels, but unlike traditional RTOSes they ve less overhead Run-time overhead is decreased by reducing the unnecessary context switch Important timings such as context switch time, interrupt latency, semaphore latency must be minimum System Calls Non preemptable portions of kernel functions necessary for mutual exclusion are highly optimized and made short and deterministic

RTOS Issues (contd..) Interrupt Handling Non preemptable portions of the interrupt handler routines are kept small and deterministic Interrupt handlers are scheduled and executed at appropriate priority Scheduling Type of scheduling supported RMS or EDF Number of priority levels supported 32 to be RT-POSIX compliant; many offer between 128-256 Type of scheduling for equal priority threads FIFO or Round-Robin Can thread priorities be changed at run-time?

RTOS Issues (contd..) Priority Inversion Control Does it support Priority Inheritance or Ceiling protocols for scheduling? Memory Management Can provide virtual-to-physical address mapping Traditionally does not do paging Networking Type of networking supported deterministic network stack or not

Lynx OS Microkernel design Means the kernel footprint is small Only 28 kilobytes in size The small kernel provides essential services in scheduling, interrupt dispatching and synchronization The other services are provided by kernel lightweight service modules, called Kernel Plug-Ins (KPIs) New KPIs can be added to the microkernel and can be configured to support I/O, file systems, TCP/IP, streams and sockets Can function as a multipurpose UNIX OS

Lynx OS (contd..) Here KPIs are multi-threaded, which means each KPI can create as many thread as it want There is no context switch when sending a message to a KPI For example, when a RFS (Request for Service) message is sent to a File System KPI, this does not request a context switch Hence run-time overhead is minimum Further, inter KPI communication incurs minimal overhead with it consuming only very few instructions Lynx OS is a self hosted system wherein development can be done in the same sytem

Lynx OS (contd..) In such a system, there is a need for protecting the OS from such huge memory consuming applications (compilers, debuggers) LynxOS offers memory protection through hardware MMUs Applications make I/O requests to I/O system through system calls Kernel directs I/O request to the device driver Each device driver has an interrupt handler and kernel thread

Lynx OS (contd..) The interrupt handler carries the first step of interrupt handling If it does not complete the processing, it sets an asynchronous trap to the kernel Later, when kernel can respond to the software interrupt, it schedules an instance of the kernel thread to complete the interrupt processing

QNX/ Neutrino SMP RTOS requires high end, networked SMP machines with GBs of physical memory Microkernel design kernel provides essential threads and real-time services Other services are considered as resource managers and can be added or removed at run-time The footprint of microkernel is 12kb.

QNX/ Neutrino (contd..) QNX is a message passing operating system Messages are basic means of interprocess communication among all threads Follows a message based priority tracking feature Messages are delivered at the priority order and the service provider executes at the priority of the highest priority clients waiting for service So, if the highest priority task wants to do read some data from file, the file system resource manager will execute at this task s priority

QNX/ Neutrino (contd..) When a service provider thread wants to provide service, then it creates a channel (for exchanging messages) with its service identifier for identification To get a service from a provider, the client thread attaches it to the provider s channel Within the client, this connection is directly mapped to the file descriptor (so RFS can be sent directly to the file descriptor) QNX messages are blocking unlike POSIX message standards

VRTX VRTX has two multitasking kernels VRTXsa designed for performance Provides priority inheritance, POSIX compliant libraries Supports multiprocessing System calls fully preemptable and deterministic VRTXmc designed for low power consumption Used for cellular phones and hand-held devices Rather than providing optional components provides hooks for extensibility application can add its own system calls

VxWorks Monolithic Kernel Leads to an improved performance with less run-time overhead However the scalability is poor I.e. the footprint of the kernel is affected a little. Provides interfaces specified by RT-POSIX standards in addition to its own APIs Though not a multiprocessor OS, provides sharedmemory objects: shared binary and counting semaphores It has the standard MMU as a modern OS Provides basic virtual-to-physical memory mapping Allows to add new mappings and make portions of memory non cacheable

VxWorks (contd..) When memory boards are added dynamically, to increase the address space for interprocess communication The data is made non cacheable, to ensure cache consistency Reduced Context Switch time Saves only those register windows that are actually in use (on a Sparc) When a task s context is restored, only the relevant register window is restored To increase response time, it saves the register windows in a register cache useful for recurring tasks

Spring Kernel Goal development of dynamic, distributed real-time system System is a network of multiprocessors, each multiprocessor containing one or more processors, I/O subsystems I/O subsystem is a separate entity from Spring kernel, handling non-critical I/O, slow I/O devices and fast sensors Design Principle Segmentation & Reflection

Spring Kernel (contd..) Segmentation dividing resources of the systems into units Size of unit depends on application requirements Helps in determining the resource constraints of online scheduling algorithms Reflection Concept of reasoning its own state and its environments Required for handling situations in highly dynamic environments (where handcrafting is infeasible)

Spring Kernel (contd..) Scheduling consists of 4 modules Process-resident dispatcher simply removes the task from Global System Task Table (GSTT) Local Scheduler (per processor) responsible for locally guaranteeing that a new task can make its deadline and for ordering processor specific tasks in STT Global Scheduler finds a site for execution for any task that cannot be locally guaranteed Meta Level Controller can adapt various parameters by noticing significant changes

Spring Kernel (contd..) Memory Management OS is core-resident No dynamic memory allocation to eliminate large and unpredictable delays (due to page faults and page replacements) Kernel pre-allocates a fixed number of instances of the some of kernel data structures Tasks are accepted dynamically if the necessary data structures are available Inter-Process Communication Mailboxes and communication primitives are used for communication No need for semaphores since mutual exclusion is taken care in scheduling

ARTS - Distributed OS Distributed real-time OS provides a predictable distributed real-time computing environment Distributed computing environment Heterogeneous computing environment Need for global view of the system and resources No over-utilization and under-utilization of a particular system in a distributed system Guaranteeing predictability in such a system is difficult than in multiprocessor system case

ARTS (Contd..) How to synchronize the clocks in a distributed system? Scheduling Integrated time-driven scheduler ITDS scheduler provides an interface between the scheduling policies and the rest of the operating system Allows different scheduling policies to exist (though only one can be used at a time) Communication scheduling Extended RMS for communication scheduling integrating message and processor scheduling

MARS Distributed RTOS Maintainable Real-Time System (MARS) focuses on fault tolerance in distributed RTOS Objective To provide guaranteed timely response under peak load conditions To support real-time testability by breaking up the system into subsystem Time Driven System system initiates activities at pre-determined times Better performance than event driven systems Control signals are based on the physical time, hence in presence of a global physical time no need for control signals across subsystem interfaces

MARS (Contd..) System Architecture MARS application consists of a set of clusters (autonomous subsystems), several components of a cluster connected by a real-time bus Each component runs an identical copy of the operating system Different clusters are connected through an inter-cluster interface, forming a network Cluster consists of Fault-Tolerant Units (FTUs) consisting of replicated components providing redundancy Shadow components update their own internal state and monitor the operation of active components Shadow becomes active, when active fails Each message is also sent twice on real-time bus

MARS (Contd..) Fault Tolerance Addresses both transient and permanent faults Messages have checksums and h/w comp. are self-checking Uses robust storage structures Application software detects errors by executing each task twice (catching transient faults) MARS is fail silent component is turned on detecting first error to avoid fault propagation Upon detection shadow component takes over the final one

MARS (Contd..) Tasks and messages Tasks (periodic and aperiodic) are scheduled by static scheduling schemes Hard real-time tasks are run at specific intervals that are known during system initialization Soft real-time tasks are run at intervals not used by hard real-time tasks Communication through message passing also uses state messages (produced periodically at predetermined times), conveying state of the system To avoid unpredictable delays in CSMA/CD protocols, MARS uses a TDMA protocol to provide collision-free access to Ethernet (atmost one hard RT message for each slot remaining for soft RT messages)

MARS (Contd..) MARS uses only one kind of interrupts periodic clock interrupt. Interaction with peripherals is through polling Scheduling Scheduling done offline Assumes that the running task will yield the CPU at the end of its quantum Task switching is done by major handler every 8 milliseconds Change can be triggered by invoking a system call or receiving an appropriate message.