RTOS Real-Time Operating Systems. Chenyang Lu

Similar documents
Linux 2.4. Linux. Windows

Real-time KVM from the ground up

Deciding which process to run. (Deciding which thread to run) Deciding how long the chosen process can run

Lecture 3 Theoretical Foundations of RTOS

Hard Real-Time Linux

Enhancing the Monitoring of Real-Time Performance in Linux

Real-Time Operating Systems With Example PICOS18. What is an Operating System?

REAL TIME OPERATING SYSTEMS. Lesson-10:

What is best for embedded development? Do most embedded projects still need an RTOS?

Linux scheduler history. We will be talking about the O(1) scheduler

CPU Scheduling Outline

Performance Comparison of RTOS

POSIX. RTOSes Part I. POSIX Versions. POSIX Versions (2)

Programming real-time systems with C/C++ and POSIX

Comparison between scheduling algorithms in RTLinux and VxWorks

ChronOS Linux: A Best-Effort Real-Time Multiprocessor Linux Kernel

Overview of the Linux Scheduler Framework

Process Scheduling in Linux

RTAI. Antonio Barbalace (modified by M.Moro 2011) RTAI

Chapter 19: Real-Time Systems. Overview of Real-Time Systems. Objectives. System Characteristics. Features of Real-Time Systems

Embedded Systems. 6. Real-Time Operating Systems

W4118 Operating Systems. Instructor: Junfeng Yang

Real-time Operating Systems. VO Embedded Systems Engineering Armin Wasicek

Linux Process Scheduling Policy

Exercises : Real-time Scheduling analysis

2. is the number of processes that are completed per time unit. A) CPU utilization B) Response time C) Turnaround time D) Throughput

Linux A multi-purpose executive support for civil avionics applications?

Tasks Schedule Analysis in RTAI/Linux-GPL

CPU SCHEDULING (CONT D) NESTED SCHEDULING FUNCTIONS

Real-Time Systems Prof. Dr. Rajib Mall Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Fitting Linux Device Drivers into an Analyzable Scheduling Framework

ò Paper reading assigned for next Thursday ò Lab 2 due next Friday ò What is cooperative multitasking? ò What is preemptive multitasking?

CPU Scheduling. CPU Scheduling

Experimental Analysis of the Linux RT-patched for Data Acquisition applied to Power Sector

Linux Process Scheduling. sched.c. schedule() scheduler_tick() hooks. try_to_wake_up() ... CFS CPU 0 CPU 1 CPU 2 CPU 3

Chapter 13 Embedded Operating Systems

Linux Scheduler Analysis and Tuning for Parallel Processing on the Raspberry PI Platform. Ed Spetka Mike Kohler

Improvement of Scheduling Granularity for Deadline Scheduler

Real Time Operating Systems. Tajana Simunic Rosing Department of Computer Science and Engineering University of California, San Diego.

LynxOS RTOS (Real-Time Operating System)

Real Time Operating Systems. Tajana Simunic Rosing Department of Computer Science and Engineering University of California, San Diego.

Real- Time Scheduling

Module 6. Embedded System Software. Version 2 EE IIT, Kharagpur 1

A Predictable and IO Bandwidth Reservation Task Scheduler

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

Processor Scheduling. Queues Recall OS maintains various queues

The Design and Implementation of Real-Time Schedulers in RED-Linux

CPU Scheduling. Basic Concepts. Basic Concepts (2) Basic Concepts Scheduling Criteria Scheduling Algorithms Batch systems Interactive systems

Linux O(1) CPU Scheduler. Amit Gud amit (dot) gud (at) veritas (dot) com

White Paper. Real-time Capabilities for Linux SGI REACT Real-Time for Linux

CPU Scheduling. Core Definitions

WINDOWS CE 5.0 ON AN X86 PLATFORM

CS 377: Operating Systems. Outline. A review of what you ve learned, and how it applies to a real operating system. Lecture 25 - Linux Case Study

Chapter 5 Process Scheduling

Linux Scheduler. Linux Scheduler

Quality of Service su Linux: Passato Presente e Futuro

Real-Time Operating Systems.

Outline: Operating Systems

Notes and terms of conditions. Vendor shall note the following terms and conditions/ information before they submit their quote.

Développement d'une application en temps réel pour le contrôle d'une carte CANPCI INDEX

QNX V6.5 ON ARM. 1: Dedicated Systems Experts, 2: VUB-Brussels, 3: RMA-Brussels

Scheduling 0 : Levels. High level scheduling: Medium level scheduling: Low level scheduling

System Software and TinyAUTOSAR

SYSTEM ecos Embedded Configurable Operating System

KVM in Embedded Requirements, Experiences, Open Challenges

W4118 Operating Systems. Instructor: Junfeng Yang

Objectives. Chapter 5: Process Scheduling. Chapter 5: Process Scheduling. 5.1 Basic Concepts. To introduce CPU scheduling

Operating Systems Concepts: Chapter 7: Scheduling Strategies

CS414 SP 2007 Assignment 1

Objectives. Chapter 5: CPU Scheduling. CPU Scheduler. Non-preemptive and preemptive. Dispatcher. Alternating Sequence of CPU And I/O Bursts

EECS 750: Advanced Operating Systems. 01/28 /2015 Heechul Yun

CGL Architecture Specification

Operating Systems. Lecture 03. February 11, 2013

Embedded & Real-time Operating Systems

OPERATING SYSTEMS SCHEDULING

Page 1 of 5. IS 335: Information Technology in Business Lecture Outline Operating Systems

An Implementation Of Multiprocessor Linux

Completely Fair Scheduler and its tuning 1

Asymmetric Scheduling and Load Balancing for Real-Time on Linux SMP

Achieving Nanosecond Latency Between Applications with IPC Shared Memory Messaging

Multiprocessor Scheduling and Scheduling in Linux Kernel 2.6

A Survey of Embedded Operating System

Cloud Operating Systems for Servers

CPU Scheduling. CSC 256/456 - Operating Systems Fall TA: Mohammad Hedayati

Design and Implementation of a POSIX Compliant Sporadic Server for the Linux Kernel

A Survey of Fitting Device-Driver Implementations into Real-Time Theoretical Schedulability Analysis

Virtualization for Hard Real-Time Applications Partition where you can Virtualize where you have to

Validating Java for Safety-Critical Applications

RTOS Debugger for ecos

Advanced topics: reentrant function

Realtime Linux Kernel Features

ò Scheduling overview, key trade-offs, etc. ò O(1) scheduler older Linux scheduler ò Today: Completely Fair Scheduler (CFS) new hotness

Thomas Fahrig Senior Developer Hypervisor Team. Hypervisor Architecture Terminology Goals Basics Details

Design and Implementation of the Heterogeneous Multikernel Operating System

OS OBJECTIVE QUESTIONS

Operating System: Scheduling

PikeOS: Multi-Core RTOS for IMA. Dr. Sergey Tverdyshev SYSGO AG , Moscow

Readings for this topic: Silberschatz/Galvin/Gagne Chapter 5

Process Scheduling CS 241. February 24, Copyright University of Illinois CS 241 Staff


Transcription:

RTOS Real-Time Operating Systems Chenyang Lu

OS Support for Real-Time Ø Real-Time OS Ø Real-time extensions to general-purpose OS Chenyang Lu 19

RTOS: Features for Efficiency Ø Small Ø Minimal set of functionality Ø Fast context switch Ø Fast and time bounded response to interrupts Ø Fixed or variable partitions of memory q May not support paging or virtual memory q May support locking code and data in memory Ø Sequential file that can accumulate data at fast rate q May be memory-based Chenyang Lu 20

Code Size Name Code Size Target CPU posek 2K Microcontrollers psosystem PII->ARM Thumb VxWorks 286K Pentium -> Strong ARM QNX Nutrino >100K Pentium II -> NEC QNX RealTime 100K Pentium II -> SH4 OS-9 Pentium -> SH4 Chorus OS 10K Pentium -> Strong ARM ARIEL 19K SH2, ARM Thumb Creem 560 bytes ATMEL 8051 Chenyang Lu 21

RTOS: Features for Real-Time Ø Preemptive priority scheduling q At least 32 priority levels, commonly 128-256 priority levels q Priority inheritance/ceiling protocol Ø System calls q Bounded execution times q Short non-preemptable code Ø High-resolution system clock q Resolution down to nanoseconds q But it takes about a microsecond to process a timer interrupt Chenyang Lu 22

Other Important Features Ø Conformance to standards q Real-Time POSIX API q TCP/IP Ø Modularity and configurability q Small kernel q Pluggable modules Chenyang Lu 23

Example: VRTX Ø VRTXsa q RT-POSIX compliant q Full real-time support Ø VRTXmc q Optimized for power and footprint Ø First RTOS certified by FAA q 100% code coverage in testing Ø Runs the Hubble Space Telescope Chenyang Lu 24

Real-Time Extensions to General OS Ø Generally slower and less predictable than RTOS Ø More functionality and development support Ø Standard interfaces Ø Suitable for soft real-time applications Chenyang Lu 25

How Real-Time Is Linux? Ø I believe that Linux is ready to handle applications requiring submillisecond process-scheduling and interrupt latencies with 99.99+ percent probabilities of success. No, that does not cover every imaginable real-time application, but it does cover a very large and important subset. Ø The Linux 2.6 kernel, if configured carefully and run on fast hardware, can provide sub-millisecond interrupt and process scheduling latencies with extremely high probabilities of success. There are patches out there that are expected to provide latencies in the tens of microseconds. These patches need some work, but are maturing quickly. Paul McKenney, IBM Linux Technology Center Shrinking slices: Looking at real time for Linux, PowerPC, and Cell Chenyang Lu 26

Why isn t Linux real-kme? Ø The Linux kernel only allows a process to preempt another under certain circumstances: q when the CPU is running user-mode code; q when kernel code returns from a system call or an interrupt to user space; q when kernel code blocks on a mutex, or explicitly yields control to another process. Ø If kernel code is executing, a high priority thread cannot preempt the kernel until the kernel code explicitly yields control. Ø In the worst case, the latency could potentially be hundreds milliseconds or more. Source: h*ps://rt.wiki.kernel.org/ Chenyang Lu 27

Linux Scheduling Ø Real-time scheduling class q Fixed priority q SCHED_FIFO: First-In-First-Out q SCHED_RR: Round-Robin Ø Non-real-time scheduling class (SCHED_NORMAL) Ø Default q Real-time: 0 99 q Non-real-time: 100 139 Chenyang Lu 28

Real-Kme Linux Ø Core kernel modifications: patches q Require modifications to Linux kernel q Example: CONFIG_PREEMPT_RT patch Ø Compliant kernels: modified native RTOS q Linux binaries can run without modifications q Example: LynxOS Ø Dual kernels: real-time kernel sits below Linux q Real-time kernel traps all interrupts and schedules all processes q Linux runs as a low-priority process q Example: RT-Linux (FSLabs) Chenyang Lu 29

CONFIG_PREEMPT_RT Patch Ø Convert Linux into a fully preemptible kernel. Ø Locks q Making in-kernel locking-primitives preemptible through reimplementation with rtmutexes. q Critical sections protected by spinlock_t and rwlock_t are preemptible. q Priority inheritance for in-kernel spinlocks and semaphores. Ø Convert interrupt handlers into preemptible kernel threads. Ø Convert timer API into separate infrastructures for high resolution kernel timers plus one for timeouts, leading to user space POSIX timers with high resolution. Source: h*ps://rt.wiki.kernel.org/ Chenyang Lu 30

MulK-core Real-Time Scheduler Ø Push-pull scheduler schedules tasks across CPUs. Ø Every CPU has a runqueue. Ø Push: considers all the runqueues within its root domain to find the one of a lower priority than the task being pushed. q Push a task when it wakes up on a runqueue running a task of higher priority q Push a task when a higher-priority task on the same runqueue wakes up and preempts it Ø Pull: whenever a runqueue is about to schedule a task that is lower in priority than the previous one, it checks whether it can pull tasks of a higher priority from other runqueues. Chenyang Lu 31

RT-Linux Real-time kernel traps all interrupts and schedules all processes Linux runs as a low-priority process Real-time applications cannot take advantage of Linux calls Linux Process Linux Process Linux Kernel Software Interrupts RT Process Scheduling Real-Time Kernel Hardware Interrupts Chenyang Lu 32

More InformaKon Ø Real-Time Linux Wiki: https://rt.wiki.kernel.org/index.php/frequently_asked_questions Ø Real-Time Linux Kernel Scheduler: http://www.linuxjournal.com/magazine/real-time-linux-kernel-scheduler Chenyang Lu 33