Embedded & Real-time Operating Systems

Slides:



Advertisements
Ähnliche Präsentationen
Cadastre for the 21st Century – The German Way
Advertisements

Service Oriented Architectures for Remote Instrumentation
PSI and Competition The General Framework
Finding the Pattern You Need: The Design Pattern Intent Ontology
E-Solutions mySchoeller.com for Felix Schoeller Imaging
Service Discovery in Home Environments
DNS-Resolver-Mechanismus
P. Marwedel Informatik 12, U. Dortmund
Finite state machines & message passing: SDL
Managing the Transition from School-to-Work Empirical Findings from a Mentoring Programme in Germany Prof. i.V. Dr. Martin Lang.
R. Zankl – Ch. Oelschlegel – M. Schüler – M. Karg – H. Obermayer R. Gottanka – F. Rösch – P. Keidler – A. Spangler th Expert Meeting Business.
Multi electron atoms Atoms with Z>1 contain >1 electron. This changes the atomic structure considerably because in addition to the electron-nucleus interaction,
fakultät für informatik informatik 12 technische universität dortmund Test Peter Marwedel TU Dortmund Informatik 12 Germany 2009/01/17 Graphics: © Alexandra.
Fakultät für informatik informatik 12 technische universität dortmund Optimizations Peter Marwedel TU Dortmund Informatik 12 Germany 2009/01/17 Graphics:
fakultät für informatik informatik 12 technische universität dortmund Optimizations Peter Marwedel TU Dortmund Informatik 12 Germany 2009/01/10 Graphics:
Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Platforms Peter Marwedel TU Dortmund, Informatik 12 Germany.
Fakultät für informatik informatik 12 technische universität dortmund Optimizations Peter Marwedel TU Dortmund Informatik 12 Germany 2010/01/13 Graphics:
Fakultät für informatik informatik 12 technische universität dortmund Universität Dortmund Middleware Peter Marwedel TU Dortmund, Informatik 12 Germany.
Fakultät für informatik informatik 12 technische universität dortmund Specifications Peter Marwedel TU Dortmund, Informatik 12 Graphics: © Alexandra Nolte,
Peter Marwedel TU Dortmund, Informatik 12
Fakultät für informatik informatik 12 technische universität dortmund Hardware/Software Partitioning Peter Marwedel Informatik 12 TU Dortmund Germany Chapter.
Fakult ä t f ü r informatik informatik 12 technische universit ä t dortmund Data flow models Peter Marwedel TU Dortmund, Informatik 12 Graphics: © Alexandra.
Hier wird Wissen Wirklichkeit Computer Architecture – Part 10 – page 1 of 31 – Prof. Dr. Uwe Brinkschulte, Prof. Dr. Klaus Waldschmidt Part 10 Thread and.
Lancing: What is the future? Lutz Heinemann Profil Institute for Clinical Research, San Diego, US Profil Institut für Stoffwechselforschung, Neuss Science.
Three minutes presentation I ArbeitsschritteW Seminar I-Prax: Inhaltserschließung visueller Medien, Spree WS 2010/2011 Giving directions.
Thomas Herrmann Software - Ergonomie bei interaktiven Medien Step 6: Ein/ Ausgabe Instrumente (Device-based controls) Trackball. Joystick.
Munz – IT/TG - Lörrach. Goals of this intensive lecture To learn: To learn: –What does it means programming in Java ? –What is JAVA good/bad for ? –Which.
CCNA Exploration Network Fundamentals
INSTITUT FÜR DATENTECHNIK UND KOMMUNIKATIONS- NETZE 1 Steffen Stein, TU Braunschweig, 2009 A Timing-Aware Update Mechanism for Networked Real-Time Systems.
Adjektive Endungen von Frau Templeton.
Laurie Clarcq The purpose of language, used in communication, is to create a picture in the mind and/or the heart of another.
Die Zeit (TIME) Germans are on military time which is 1-24
Institut AIFB, Universität Karlsruhe (TH) Forschungsuniversität gegründet 1825 Towards Automatic Composition of Processes based on Semantic.
Lehrstuhl Technische Informatik - Computer Engineering Brandenburgische Technische Universität Cottbus 1 Hierarchical Test Technology for Systems on a.
Sanjay Patil Standards Architect – SAP AG April 2008
| DC-IAP/SVC3 | © Bosch Rexroth Pneumatics GmbH This document, as well as the data, specifications and other information set forth in.
A good view into the future Presented by Walter Henke BRIT/SLL Schweinfurt, 14. November 2006.
BAS5SE | Fachhochschule Hagenberg | Daniel Khan | S SPR5 MVC Plugin Development SPR6P.
Department of Computer Science Homepage HTML Preprocessor Perl Database Revision Control System © 1998, Leonhard Jaschke, Institut für Wissenschaftliches.
INTAKT- Interkulturelle Berufsfelderkundungen als ausbildungsbezogene Lerneinheiten in berufsqualifizierenden Auslandspraktika DE/10/LLP-LdV/TOI/
Institut für Umweltphysik/Fernerkundung Physik/Elektrotechnik Fachbereich 1 K. Bramstedt, L. Amekudzi, J. Meyer IFE/IUP Tangent heights in occultation.
Einführung Bild und Erkenntnis Einige Probleme Fazit Eberhard Karls Universität Tübingen Philosophische Fakultät Institut für Medienwissenschaft Epistemic.
Berner Fachhochschule Hochschule für Agrar-, Forst- und Lebensmittelwissenschaften HAFL Recent activities on ammonia emissions: Emission inventory Rindvieh.
Ein Projekt des Technischen Jugendfreizeit- und Bildungsvereins (tjfbv) e.V. kommunizieren.de Blended Learning for people with disabilities.
External Labels – The rules For all external labels the following rules apply (external labels are all labels which are not inside of a shape) - all labels.
ESSnet Workshop Conclusions.
By: Jade Bowerman. German numbers are quite a bit like our own. You start with one through ten and then you add 20, 30, 40 or 50 to them. For time you.
3rd Review, Vienna, 16th of April 1999 SIT-MOON ESPRIT Project Nr Siemens AG Österreich Robotiker Technische Universität Wien Politecnico di Milano.
Adjectiv Endungen Lite: Adjective following articles and pre-ceeding nouns. Colors and Clothes.
Berner Fachhochschule Hochschule für Agrar-, Forst- und Lebensmittelwissenschaften HAFL 95% der Ammoniakemissionen aus der Landwirtschaft Rindvieh Pflanzenbau.
Sentence Structure Subject and verb are always together. Subject and verb are always together. Subject and verb must agree Subject and verb must agree.
KIT – die Kooperation von Forschungszentrum Karlsruhe GmbH und Universität Karlsruhe (TH) Vorlesung Knowledge Discovery - Institut AIFB Tempus fugit Towards.
German Word Order explained!
Present Tense Most regular verbs follow this pattern:
Lehrstuhl für Steuerrecht und Öffentliches Recht Prof. Dr. Roland Ismer MSc Econ. (LSE)/Prof. Dr. Klaus Meßerschmidt Grundlagen Staats- und Verwaltungsrecht.
1 Intern | ST-IN/PRM-EU | | © Robert Bosch GmbH Alle Rechte vorbehalten, auch bzgl. jeder Verfügung, Verwertung, Reproduktion, Bearbeitung,
Fakultät für informatik informatik 12 technische universität dortmund Standard Optimization Techniques 2010/12/20 Peter Marwedel TU Dortmund, Informatik.
1 Stevens Direct Scaling Methods and the Uniqueness Problem: Empirical Evaluation of an Axiom fundamental to Interval Scale Level.
THE PERFECT TENSE IN GERMAN
Technische Universität München Spatial aspects of the formation of GMO-free or GMO clubs Maarten J. Punt Technische Universität München.
Adjective Endings Nominative & Accusative Cases describing auf deutsch The information contained in this document may not be duplicated or distributed.
Selectivity in the German Mobility Panel Tobias Kuhnimhof Institute for Transport Studies, University of Karlsruhe Paris, May 20th, 2005.
How to use and facilitate an OptionFinder Audience Response System.
Technische Universität München 1 CADUI' June FUNDP Namur G B I The FUSE-System: an Integrated User Interface Design Environment Frank Lonczewski.
TUM in CrossGrid Role and Contribution Fakultät für Informatik der Technischen Universität München Informatik X: Rechnertechnik und Rechnerorganisation.
Institut für Nachrichtentechnik U. Reimers Technische Universität Braunschweig The MultiMedia Home Platform (MHP): Hype or Reality ?
Your next assignment is not a test but rather an essay. In order to help you write this essay, we are going to discuss the parts of an essay in German.
Inter-Cultural Teaching and Learning ICTaL Technische Universität Berlin Zentraleinrichtung Kooperation Wissenschaftliche und interne Weiterbildung Introductory.
© Handwerkskammer für München und Oberbayern, Max-Joseph-Straße 4, München Dietmar Schneider Foreign Trade Department of the Chamber of Trade and.
Fakultät für informatik informatik 12 technische universität dortmund Universität Dortmund Embedded & Real- time Operating Systems Peter Marwedel TU Dortmund,
 Präsentation transkript:

Embedded & Real-time Operating Systems Peter Marwedel TU Dortmund, Informatik 12 Germany Graphics: © Alexandra Nolte, Gesine Marwedel, 2003 2010年 11 月 24 日 These slides use Microsoft clip arts. Microsoft copyright restrictions apply.

Structure of this course 2: Specification Design repository Design 3: ES-hardware 8: Test Application Knowledge 6: Application mapping 5: Evaluation & validation (energy, cost, performance, …) 7: Optimization 4: system software (RTOS, middleware, …) Numbers denote sequence of chapters

Reuse of standard software components Knowledge from previous designs to be made available in the form of intellectual property (IP, for SW & HW). Operating systems Middleware ….

Embedded operating systems - Characteristics: Configurability - Configurability No single OS will fit all needs, no overhead for unused functions tolerated  configurability needed. Simplest form: remove unused functions (by linker ?). Conditional compilation (using #if and #ifdef commands). Dynamic data might be replaced by static data. Advanced compile-time evaluation useful. Object-orientation could lead to a derivation subclasses.

Example: Configuration of VxWorks http://www.windriver.com/products/development_tools/ide/tornado2/tornado_2_ds.pdf © Windriver

Verification of derived OS? Verification a potential problem of systems with a large number of derived OSs: Each derived OS must be tested thoroughly; Potential problem for eCos (open source RTOS from Red Hat), including 100 to 200 configuration points [Takada, 01].

Embedded operating systems - Disc and network handled by tasks - Effectively no device that needs to be supported by all variants of the OS, except maybe the system timer. Many ES without disc, a keyboard, a screen or a mouse. Disc & network handled by tasks instead of integrated drivers. Discs & networks can be handled by tasks. Embedded OS Standard OS kernel

Example: WindRiver Platform Industrial Automation

Embedded operating systems - Protection is optional- Protection mechanisms not always necessary: ES typically designed for a single purpose, untested programs rarely loaded, SW considered reliable. Privileged I/O instructions not necessary and tasks can do their own I/O. Example: Let switch be the address of some switch Simply use load register,switch instead of OS call. However, protection mechanisms may be needed for safety and security reasons.

Embedded operating systems - Interrupts not restricted to OS - Interrupts can be employed by any process For standard OS: serious source of unreliability. Since embedded programs can be considered to be tested, since protection is not necessary and since efficient control over a variety of devices is required, it is possible to let interrupts directly start or stop tasks (by storing the task’s start address in the interrupt table). More efficient than going through OS services. Reduced composability: if a task is connected to an interrupt, it may be difficult to add another task which also needs to be started by an event.

Embedded operating systems - Real-time capability- Many embedded systems are real-time (RT) systems and, hence, the OS used in these systems must be real-time operating systems (RTOSs).

Real-time operating systems - Definition and requirement 1: predictability - Def.: (A) real-time operating system is an operating system that supports the construction of real-time systems. The following are the three key requirements The timing behavior of the OS must be predictable.  services of the OS: Upper bound on the execution time! RTOSs must be timing-predictable: short times during which interrupts are disabled, (for hard disks:) contiguous files to avoid unpredictable head movements. [Takada, 2001]

Real-time operating systems Requirement 2: Managing timing OS should manage the timing and scheduling OS possibly has to be aware of task deadlines; (unless scheduling is done off-line). Frequently, the OS should provide precise time services with high resolution. [Takada, 2001]

Time services Time plays a central role in “real-time” systems. Actual time is described by real numbers. Two discrete standards are used in real-time equipment: International atomic time TAI (french: temps atomic internationale) Free of any artificial artifacts. Universal Time Coordinated (UTC) UTC is defined by astronomical standards UTC and TAI identical on Jan. 1st, 1958. 30 seconds had to be added since then. Not without problems: New Year may start twice per night.

Internal synchronization Synchronization with one master clock Typically used in startup-phases Distributed synchronization: Collect information from neighbors Compute correction value Set correction value. Precision of step 1 depends on how information is collected: Application level: ~500 µs to 5 ms Operation system kernel: 10 µs to 100 µs Communication hardware: < 10 µs

Byzantine Error Erroneous local clocks can have an impact on the computed local time. Advanced algorithms are fault-tolerant with respect to Byzantine errors. Excluding k erroneous clocks is possible with 3k+1 clocks (largest and smallest values will be excluded. Many publications in this area. k=1 t

External synchronization External synchronization guarantees consistency with actual physical time. Trend is to use GPS for ext. synchronization GPS offers TAI and UTC time information. Resolution is about 100 ns. GPS mouse © Dell

Problems with external synchronization Problematic from the perspective of fault tolerance: Erroneous values are copied to all stations. Consequence: Accepting only small changes to local time. Many time formats too restricted; e.g.: NTP protocol includes only years up to 2036 For time services and global synchronization of clocks synchronization see Kopetz, 1997.

Real-time operating systems Requirement 3: Speed The OS must be fast Practically important. [Takada, 2001]

RTOS-Kernels Distinction between real-time kernels and modified kernels of standard OSes. Distinction between general RTOSs and RTOSs for specific domains, standard APIs (e.g. POSIX RT-Extension of Unix, ITRON, OSEK) or proprietary APIs.

Functionality of RTOS-Kernels Includes processor management, memory management, and timer management; task management (resume, wait etc), inter-task communication and synchronization. resource management

Classes of RTOSes according to R. Gupta: 1. Fast proprietary kernels For complex systems, these kernels are inadequate, because they are designed to be fast, rather than to be predictable in every respect [R. Gupta, UCI/UCSD] Examples include QNX, PDOS, VCOS, VTRX32, VxWORKS.

Classes of RTOSs according to R. Gupta: 2. RT extensions to std. OSs Attempt to exploit comfortable main stream OS. RT-kernel running all RT-tasks. Standard-OS executed as one task. + Crash of standard-OS does not affect RT-tasks; - RT-tasks cannot use Standard-OS services; less comfortable than expected

Example: RT-Linux RT-tasks cannot use standard OS calls. Commercially available from fsmlabs (www.fsmlabs.com) Init Bash Mozilla Linux-Kernel scheduler RT-Task RT-Task driver interrupts RT-Linux RT-Scheduler interrupts I/O interrupts Hardware

Example: Posix 1.b RT-extensions to Linux Standard scheduler can be replaced by POSIX scheduler implementing priorities for RT tasks RT-Task RT-Task Init Bash Mozilla Special RT-calls and standard OS calls available. Easy programming, no guarantee for meeting deadline Linux-Kernel POSIX 1.b scheduler driver I/O, interrupts Hardware

Evaluation (Gupta) According to Gupta, trying to use a version of a standard OS: not the correct approach because too many basic and inappropriate underlying assumptions still exist such as optimizing for the average case (rather than the worst case), ... ignoring most if not all semantic information, and independent CPU scheduling and resource allocation. Dependences between tasks not frequent for most applications of std. OSs & therefore frequently ignored. Situation different for ES since dependences between tasks are quite common.

Classes of RTOSs (R. Gupta): 3. Research trying to avoid limitations Research systems trying to avoid limitations. Include MARS, Spring, MARUTI, Arts, Hartos, DARK, and Melody Research issues [Takada, 2001]: low overhead memory protection, temporal protection of computing resources RTOSes for on-chip multiprocessors support for continuous media quality of service (QoS) control.

Virtual machines Emulate several processors on a single real processor Running As Single process (Java virtual machine) On bare hardware Allows several operating systems to be executed on top Very good shielding between applications Temporal behavior

Resource Access Protocols Peter Marwedel Informatik 12 TU Dortmund Germany Graphics: © Alexandra Nolte, Gesine Marwedel, 2003

Resource access protocols Critical sections: sections of code at which exclusive access to some resource must be guaranteed. Can be guaranteed with semaphores S or “mutexes”. P(S) checks semaphore to see if resource is available and if yes, sets S to “used“. Uninterruptible operations! If no, calling task has to wait. V(S): sets S to “unused“ and starts sleeping task (if any). Task 1 Task 2 Mutually exclusive access to resource guarded by S P(S) P(S) V(S) V(S)

Blocking due to mutual exclusion Priority T1 assumed to be > than priority of T2. If T2 requests exclusive access first (at t0), T1 has to wait until T2 releases the resource (time t3), thus inverting the priority: In this example: blocking is bounded by length of critical section of T2.

Blocking with >2 tasks can exceed the length of any critical section Priority of T1 > priority of T2 > priority of T3. T2 preempts T3: T2 can prevent T3 from releasing the resource. Priority inversion!

The MARS Pathfinder problem (1) “But a few days into the mission, not long after Pathfinder started gathering meteorological data, the spacecraft began experiencing total system resets, each resulting in losses of data. The press reported these failures in terms such as "software glitches" and "the computer was trying to do too many things at once".” … http://research.microsoft.com/~mbj/Mars_Pathfinder/Mars_Pathfinder.html

The MARS Pathfinder problem (2) “VxWorks provides preemptive priority scheduling of threads. Tasks on the Pathfinder spacecraft were executed as threads with priorities that were assigned in the usual manner reflecting the relative urgency of these tasks.” “Pathfinder contained an "information bus", which you can think of as a shared memory area used for passing information between different components of the spacecraft.” A bus management task ran frequently with high priority to move certain kinds of data in and out of the information bus. Access to the bus was synchronized with mutual exclusion locks (mutexes).” http://research.microsoft.com/~mbj/Mars_Pathfinder/Mars_Pathfinder.html

The MARS Pathfinder problem (3) The meteorological data gathering task ran as an infrequent, low priority thread, … When publishing its data, it would acquire a mutex, do writes to the bus, and release the mutex. .. The spacecraft also contained a communications task that ran with medium priority.”  High priority: retrieval of data from shared memory Medium priority: communications task Low priority: thread collecting meteorological data http://research.microsoft.com/~mbj/Mars_Pathfinder/Mars_Pathfinder.html

The MARS Pathfinder problem (4) “Most of the time this combination worked fine. However, very infrequently it was possible for an interrupt to occur that caused the (medium priority) communications task to be scheduled during the short interval while the (high priority) information bus thread was blocked waiting for the (low priority) meteorological data thread. In this case, the long-running communications task, having higher priority than the meteorological task, would prevent it from running, consequently preventing the blocked information bus task from running. After some time had passed, a watchdog timer would go off, notice that the data bus task had not been executed for some time, conclude that something had gone drastically wrong, and initiate a total system reset. This scenario is a classic case of priority inversion.” http://research.microsoft.com/~mbj/Mars_Pathfinder/Mars_Pathfinder.html

Coping with priority inversion: the priority inheritance protocol Tasks are scheduled according to their active priorities. Tasks with the same priorities are scheduled FCFS. If task T1 executes P(S) & exclusive access granted to T3: T1 will become blocked. If priority(T3) < priority(T1): T3 inherits the priority of T1.  T3 resumes. Rule: tasks inherit the highest priority of tasks blocked by it. When T3 executes V(S), its priority is decreased to the highest priority of the tasks blocked by it. If no other task blocked by T3: priority(T3):= original value. Highest priority task so far blocked on S is resumed. Transitive: if T3 blocks T2 and T2 blocks T1, then T3 inherits the priority of T1.

T3 inherits the priority of T1 and T3 resumes. Example How would priority inheritance affect our example with 3 tasks? T3 inherits the priority of T1 and T3 resumes. leviRTS animation

Nested critical sections

Transitiveness of priority inheritance [P/V added@unido]

Priority inversion on Mars Priority inheritance also solved the Mars Pathfinder problem: the VxWorks operating system used in the pathfinder implements a flag for the calls to mutex primitives. This flag allows priority inheritance to be set to “on”. When the software was shipped, it was set to “off”. The problem on Mars was corrected by using the debugging facilities of VxWorks to change the flag to “on”, while the Pathfinder was already on the Mars [Jones, 1997].

Remarks on priority inheritance protocol Possible large number of tasks with high priority. Possible deadlocks. Ongoing debate about problems with the protocol: Victor Yodaiken: Against Priority Inheritance, Sept. 2004, http://www.fsmlabs.com/resources/white_papers/priority-inheritance/ Finds application in ADA: During rendez-vous, task priority is set to the maximum. Protocol for fixed set of tasks: priority ceiling protocol.

Summary General requirements for embedded operating systems Configurability I/O Interrupts General properties of real-time operating systems Predictability Time services Synchronization Classes of RTOSs, Device driver embedding Priority inversion The problem Priority inheritance