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

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

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

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

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

NuttX Realtime Programming

Embedded Systems. 6. Real-Time Operating Systems

The Real Time Thing. What the hack is real time and what to do with it. 22C3 30. December Erwin Erkinger e.at

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

Real-time Support in Operating Systems

The Real-time Specification for Java

Department of Computer Science Institute for System Architecture, Operating Systems Group REAL-TIME MICHAEL ROITZSCH OVERVIEW

REAL-TIME OPERATING SYSTEMS SHORT OVERVIEW

TDDD82 Secure Mobile Systems Lecture 6: Quality of Service

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

Real-Time Systems. Real-Time Operating Systems

Introduction to Embedded Systems

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

Efficiency and memory footprint of Xilkernel for the Microblaze soft processor

Precedence Graphs Revisited (Again)

Tasks. Task Implementation and management

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

EMBEDDED OPERATING SYSTEMS

Reference Model and Scheduling Policies for Real-Time Systems

Multiprocessor and Real-Time Scheduling. Chapter 10

Green Hills Software, Inc.

ECE519 Advanced Operating Systems

Microkernel/OS and Real-Time Scheduling

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

CS 571 Operating Systems. Midterm Review. Angelos Stavrou, George Mason University

PROCESS SCHEDULING II. CS124 Operating Systems Fall , Lecture 13

Programming Embedded Systems

Operating System Provides

6/17/2011. Real-time Operating Systems

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

Multimedia Systems 2011/2012

CEC 450 Real-Time Systems

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

RT extensions/applications of general-purpose OSs

Computer Systems Assignment 4: Scheduling and I/O

Embedded Software Programming

CPU Scheduling: Objectives

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

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

Enriching Enea OSE for Better Predictability Support

Embedded Systems: OS

Real-Time & Embedded Operating Systems

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

ZiLOG Real-Time Kernel Version 1.2.0

Titolo presentazione. Scheduling. sottotitolo A.Y Milano, XX mese 20XX ACSO Tutoring MSc Eng. Michele Zanella

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

Analyzing Real-Time Systems

REAL TIME OPERATING SYSTEM PROGRAMMING-I: VxWorks

Lesson 5: Software for embedding in System- Part 2

Model Based Development of Embedded Control Software

REAL TIME OPERATING SYSTEM PROGRAMMING-II: II: Windows CE, OSEK and Real time Linux. Lesson-13: RT Linux

CEC 450 Real-Time Systems

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

Abstract. Testing Parameters. Introduction. Hardware Platform. Native System

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

Resource Access Control (2) Real-Time and Embedded Systems (M) Lecture 14

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

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

Real-Time Component Software. slide credits: H. Kopetz, P. Puschner

Operating Systems, Fall

I/O Systems. Jo, Heeseung

I/O Systems. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

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

Systemy RT i embedded Wykład 11 Systemy RTOS

Lecture 3. Introduction to Real-Time kernels. Real-Time Systems

Real-time for Windows NT

CSI3131 Final Exam Review

Zilog Real-Time Kernel

2. Which of the following resources is not one which can result in deadlocking processes? a. a disk file b. a semaphore c. the central processor (CPU)

QUESTION BANK UNIT I

Real-Time Systems 1. Basic Concepts

Notes based on prof. Morris's lecture on scheduling (6.824, fall'02).

Predictable Interrupt Management and Scheduling in the Composite Component-based System

Virtual Machine Design

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

Overall Structure of RT Systems

Reservation-Based Scheduling for IRQ Threads

Utilizing Linux Kernel Components in K42 K42 Team modified October 2001

Concurrent activities in daily life. Real world exposed programs. Scheduling of programs. Tasks in engine system. Engine system

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

Introduction. CS3026 Operating Systems Lecture 01

Embedded Systems Dr. Santanu Chaudhury Department of Electrical Engineering Indian Institute of Technology, Delhi. Lecture 23 Embedded OS

Introduction to Real-Time Operating Systems

Interrupts and Time. Real-Time Systems, Lecture 5. Martina Maggio 28 January Lund University, Department of Automatic Control

Developing Real-Time Applications

CPU Scheduling. CSE 2431: Introduction to Operating Systems Reading: Chapter 6, [OSC] (except Sections )

Schedulability with resource sharing. Priority inheritance protocol Priority ceiling protocol Stack resource policy

Computer Science Window-Constrained Process Scheduling for Linux Systems

Introduction to Real-Time Systems and Multitasking. Microcomputer Architecture and Interfacing Colorado School of Mines Professor William Hoff

EMERALDS: a small-memory real-time microkernel

Interrupts and Time. Interrupts. Content. Real-Time Systems, Lecture 5. External Communication. Interrupts. Interrupts

Process Description and Control

Main Points of the Computer Organization and System Software Module

Chapter 5 Concurrency: Mutual Exclusion and Synchronization

ARTIST-Relevant Research from Linköping

Copyright Notice. COMP9242 Advanced Operating Systems S2/2014 Week 9: Real-Time Systems. Real-Time System: Definition

Transcription:

TDDD07 Real-time Systems Lecture 10: Wrapping up & Real-time operating systems Simin Nadjm-Tehrani Real-time Systems Laboratory Department of Computer and Information Science Linköping Univerity 28 pages

Summary of the course During the course we have Studied methods for allocation of CPU as a resource Hard real-time systems: Three scheduling algorithms (Cyclic, RMS, EDF) Soft real-time systems: Data centre scheduling (adaptation wrt load and energy optimisation) 2of 28

Summary of the course We further looked at sharing multiple resources: Single CPU case: Potential for deadlocks and starvation, a prevention technique (ICP) Multiple CPUs & energy: Virtual machines As well as sharing resources in networked applications Communication bus in hard real-time systems, dedicated applications (CAN vs. TTP scheduling) Bandwidth, buffer space in IP/Multimedia networks 3of 28

Different requirement types From every deadline met to QoS expressions Who enforces predictability? RTOS in single CPU, Bus protocol in Dist. system Admission controllers, schedulers, buffer managers in soft real-time networked systems Relation between dependability and predictability Faults models Availability and some threats against it Host crashes, Software process crashes, transients Eliminating faults at design stage 4of 28

The industry perspective Arccore speaker talked about: Need for robust software Hacking a threat to robustness Faults: prevention methods, Removal methods, detection and tolerance methods Standards: AUTOSAR, ISO 26262, OSEK, MISRA, CAN, FlexRay Future: Multicore, VMs, static-> dynamic 5of 28

The industry perspective FOI speaker talked about: Critical systems are not necessarily military! Different problems in new systems (IoT) and legacy industrial control systems The conflict between availability and software updates (functionality, confidentiality, integrity) 6of 28

This lecture: Real-time OS Application modelling support Programming environment support System software support (kernels, communication protocols) Hardware support 7of 28

The role of the OS If you re serious about doing realtime why do you want an operating system? Depends on who you ask: The bare machine people The buy-kernel-and-complete people The sector-dependent OS people The language-dependent OS people The off-the-shelf OS people The reconfigurable OS people The middleware people OSEK Ada POSIXcompatible NASA uclinux FPGA 8of 28

Variations remain The 20 year perspective: https://www.embedded.com/electronicsblogs/other/4459113/2/how-embeddedsoftware-development-has-evolved-over- 20-years- Shows a clear trend from commercial OS to open source OS (see Figure 5) 9of 28

Sector interoperability Keeping competitive advantage but sharing interfaces AUTOSAR: 10 years in 2013 https://d23rjziej2pu9i.cloudfront.net/wpcontent/uploads/2014/11/28025221/10_y ears_autosar_atz_extra_en.pdf 10 of 28

Main functions of an OS Task management From Nanokernels to Kernels Inter-task communication and synchronisation Timer services Interrupt services Memory management (DMA) Device I/O management 11 of 28

Task management May be: Time-driven At each tick of a clock the kernel checks if some tasks need to be queued, a task should start to run, or a task should stop running Event-driven When an I/O operation is completed, or a task signals completion, the kernel checks... 12 of 28

Task attributes On creation of threads RT kernels allow specification of attributes such as Start time Deadline Priority... Used for releasing, aborting, and scheduling 13 of 28

Event-based task switching Upon arrival of an event: Determine if the current running task should continue (based on scheduling policy) If not, determine the next task to be run Save the environment of the preempted task Prepare the selected task to be run... in deterministic time! 14 of 28

Basic operations Search, insert and delete tasks in ready queue Restore the state of the highest priority task Recall our assumption of zero overhead! 15 of 28

Main functions of an OS Task management Inter-task communication and synchronisation Timer services Interrupt services Memory management (DMA) Device I/O management 16 of 28

Task communication Shared memory and semaphores Priority inversion Deadlocks Message passing Can above problems still arise? Deterministic time: Locking and unlocking latency Message passing delays Can be made size-independent! Yes! QNX Nuetrino uses inheritence to avoid it! 17 of 28

Main functions of an OS Task management Inter-task communication and synchronisation Timer services Interrupt services Memory management (DMA) Device I/O management 18 of 28

Timer services Even event-driven OS need time services to construct timers and detect overruns OS may allow defining one or more high resolution clocks with get_value, set_value, get_resolution operations Application modelling support Programming environment support System software support (kernels, communication protocols) Hardware support Timers can be defined to signal an event after a particular period Real-time POSIX allows queued signals according to priority 19 of 28

Interrupt services When an interrupt event is generated: State of the current running task is saved Interrupt handler Interrupt Service Routine (ISR) - is executed Next task to be run (application task or the scheduler) is invoked 20 of 28

Deterministic interrupts RTOS vendor has to provide data on the timing determinism for the given steps Interrupt service routines (ISR) have to be short But also predictable! If several interrupts are to be serviced the relative (fixed) priority determines the order 21 of 28

Main functions of an OS Task management Inter-task communication and synchronisation Timer services Interrupt services Memory management (DMA) Device I/O management 22 of 28

Memory allocation Different views: Real-time programmer should have absolute control over resources used by the program Dynamic memory allocation (malloc, free) not supported by RTOS Dynamic memory allocation takes nondeterministic time due to fragmentation and should be replaced by other mechanisms Pools instead of heap Control over garbage collection (GC) is an ingredient in real-time Java 23 of 28

Can GC be deferred? Swedish company Cinnober specialises Java programs to reduce nondeterministic access time when performing stock market transactions Uses replicated servers In most cases garbage collection will not take place in both servers at the same time. Computer Sweden 5 Dec 2013 https://www.idg.se/2.2683/1.536623/svenskar-bakom-java-genombrott 24 of 28

File system Traditional file systems not suitable for real-time OS! Those that support filing services also provide a mechanism for efficient locking of task data into main memory storage Avoiding unpredictable memory swaps! 25 of 28

Device controllers Initialise device interrupt information and disable/enable a device interrupt Upon generation of a hardware interrupt identify which device is involved Managing interrupt-driven I/O can be difficult unless the number of generated interrupts can be bounded 26 of 28

Other constraints So far we only looked at timing constraints A general requirement for RTOS is low overhead, also from a memory footprint point of view Smallest embedded systems profile of POSIX.13, PSE51 can be written in thousands of lines of code Compare to Windows XP: ~30GB! Linux first release 10000loc, 2012:15m! 27 of 28

Revisiting Toyota case Did you look at the Oklahoma court ruling from 2013? www.edn.com/design/automotive/442342 8/Toyota-s-killer-firmware--Baddesign-and-its-consequences 28 of 28