Real-Time Kernels and Operating Systems Basic Issue - Purchase commercial “off-the- shelf” system or custom build one Basic Functions –Task scheduling.

Slides:



Advertisements
Similar presentations
Processes and Threads Chapter 3 and 4 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,
Advertisements

Copyright © 2000, Daniel W. Lewis. All Rights Reserved. CHAPTER 8 SCHEDULING.
More on Processes Chapter 3. Process image _the physical representation of a process in the OS _an address space consisting of code, data and stack segments.
CS4315A. Berrached:CMS:UHD1 CPU Scheduling Chapter 7.
CSCI 4717/5717 Computer Architecture
Lecture Objectives: 1)Explain the limitations of flash memory. 2)Define wear leveling. 3)Define the term IO Transaction 4)Define the terms synchronous.
CENG 324 Embedded Computer Systems Lecture 3 General Concepts of RTOS (Real-Time Operating System) Asst. Prof. Tolga Ayav, Ph.D. Department of Computer.
RTOS Concepts and Defn From Pseudokernels to Operating Systems
ECE 526 – Network Processing Systems Design Software-based Protocol Processing Chapter 7: D. E. Comer.
Chapter 5 Processes and Threads Copyright © 2008.
Figure 2.8 Compiler phases Compiling. Figure 2.9 Object module Linking.
Introduction to Operating Systems – Windows process and thread management In this lecture we will cover Threads and processes in Windows Thread priority.
3.5 Interprocess Communication
OS Spring’03 Introduction Operating Systems Spring 2003.
Advanced OS Chapter 3p2 Sections 3.4 / 3.5. Interrupts These enable software to respond to signals from hardware. The set of instructions to be executed.
Real-Time Kernels and Operating Systems. Operating System: Software that coordinates multiple tasks in processor, including peripheral interfacing Types.
1 When to Switch Processes 3 triggers –System call, Interrupt and Trap System call –when a user program invokes a system call. e.g., a system call that.
© Copyright 2004 Dr. Phillip A. Laplante 1 Real-time operating systems: I  Operating systems taxonomy  Pseudo-kernels  Interrupt driven systems  Preemptive.
1 Process Description and Control Chapter 3 = Why process? = What is a process? = How to represent processes? = How to control processes?
Operating system Part three Introduction to computer, 2nd semester, 2010/2011 Mr.Nael Aburas Faculty of Information.
1Chapter 05, Fall 2008 CPU Scheduling The CPU scheduler (sometimes called the dispatcher or short-term scheduler): Selects a process from the ready queue.
Performance Evaluation of Real-Time Operating Systems
Real Time Operating System
Introduction to Embedded Systems
Real-Time Kernel (Part 1)
1 EE514 – Real-Time Computing Basic Concepts on Real-Time Systems EE514 – Real-Time Computing Basic Concepts of Real-Time Systems Department of Electrical.
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment.
Chapter 3 Process Description and Control
Recall: Three I/O Methods Synchronous: Wait for I/O operation to complete. Asynchronous: Post I/O request and switch to other work. DMA (Direct Memory.
Real-Time Systems Design1 Priority Inversion When a low-priority task blocks a higher-priority one, a priority inversion is said to occur Assume that priorities:
What Does Real-Time Mean? Main difference to other computation: time time means that correctness of system depends - not only on logical results - but.
The Functions of Operating Systems Interrupts. Learning Objectives Explain how interrupts are used to obtain processor time. Explain how processing of.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
CE Operating Systems Lecture 11 Windows – Object manager and process management.
Scheduling Example 3 (1) Assume: FIFO Job Scheduling 100 K Main Memory Processor Sharing Process Scheduling (Cont…)
Multiprogramming. Readings r Silberschatz, Galvin, Gagne, “Operating System Concepts”, 8 th edition: Chapter 3.1, 3.2.
Scheduling Lecture 6. What is Scheduling? An O/S often has many pending tasks. –Threads, async callbacks, device input. The order may matter. –Policy,
Lecture 7: Scheduling preemptive/non-preemptive scheduler CPU bursts
Processes and Process Control 1. Processes and Process Control 2. Definitions of a Process 3. Systems state vs. Process State 4. A 2 State Process Model.
Chapter 2 Processes and Threads Introduction 2.2 Processes A Process is the execution of a Program More specifically… – A process is a program.
RTX - 51 Objectives  Resources needed  Architecture  Components of RTX-51 - Task - Memory pools - Mail box - Signals.
ECGR-6185 µC/OS II Nayana Rao University of North Carolina at Charlotte.
We will focus on operating system concepts What does it do? How is it implemented? Apply to Windows, Linux, Unix, Solaris, Mac OS X. Will discuss differences.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Operating Systems 1 K. Salah Module 1.2: Fundamental Concepts Interrupts System Calls.
Processes, Threads, and Process States. Programs and Processes  Program: an executable file (before/after compilation)  Process: an instance of a program.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Chapter 2 Process Management. 2 Objectives After finish this chapter, you will understand: the concept of a process. the process life cycle. process states.
Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials – 8 th Edition Chapter 2: The Linux System Part 3.
1.  System Characteristics  Features of Real-Time Systems  Implementing Real-Time Operating Systems  Real-Time CPU Scheduling  An Example: VxWorks5.x.
Interrupts and Exception Handling. Execution We are quite aware of the Fetch, Execute process of the control unit of the CPU –Fetch and instruction as.
Chapter 3 RTOS Concepts And Definitions Department of Computer Science Hsu Hao Chen Professor Hsung-Pin Chang.
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.
An operating system for a large-scale computer that is used by many people at once is a very complex system. It contains many millions of lines of instructions.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Advanced Operating Systems CS6025 Spring 2016 Processes and Threads (Chapter 2)
 Operating system.  Functions and components of OS.  Types of OS.  Process and a program.  Real time operating system (RTOS).
Multiprogramming. Readings r Chapter 2.1 of the textbook.
Computer System Structures Interrupts
REAL-TIME OPERATING SYSTEMS
Real time systems RTS Engineering.
OPERATING SYSTEMS CS3502 Fall 2017
IS310 Hardware & Network Infrastructure Ronny L
Process management Information maintained by OS for process management
Processor Fundamentals
Chapter 2: The Linux System Part 3
CPU scheduling decisions may take place when a process:
EE 472 – Embedded Systems Dr. Shwetak Patel.
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

Real-Time Kernels and Operating Systems Basic Issue - Purchase commercial “off-the- shelf” system or custom build one Basic Functions –Task scheduling –Task dispatching –Intertask communication –For this discussion, a “task” is a unit of execution, a schedulable entity (also called “process”)

Some Terminology Kernel, executive, or nucleus - the smallest part of an operating system that provides for task scheduling, dispatching, and intertask communication New variants for the term “kernel” –Nano-kernel - provides for task dispatching –Micro-kernel - adds task scheduling –Kernel - adds intertask synchronization and communication –Executive - adds support for I/O –Operating System - adds user interface/command processor, security, and file management

Strategies Employed in the Design of Real-Time Kernels Polled-Loop Systems Phase/State-Driven Code Interrupt-Driven Systems Round Robin Systems Foreground/Background Systems Full-Featured Real-Time Operating Systems (RTOS)

Polled-Loop Systems A flag representing whether or not some event has occurred is tested repeatedly. If the event has occurred, it is processed; then polling continues. If the event has not occurred, polling continues. Basic requirement for polled-loop systems: –If the software is structured as a single, sequential loop on a single processor interfacing with a single device operating at a fixed rate, then polling is feasible so long as the cumulative execution time of the loop body is less than the time between event occurrences (or 1/Rate).

Phase/State-Driven Code Based on the “Finite-State Machine” model Some applications are conducive to the use of FSM models (compilers, network software, physical device control, etc); others are not. May be implemented using “if-then-else” structures or using “state-transition” tables.

Interrupt-Driven Systems An interrupt is a mechanism whereby one entity (usually an I/O device) is able to gain the immediate attention of another unit (usually the CPU) for the purpose of dealing with an asynchronous event. In purely interrupt-driven systems, the main program is simply a “jump to self”. Tasks are scheduled by way of either hardware dispatching or software dispatching.

Interrupt Dispatching Hardware Dispatching –Multiple interrupt signals are processed by a special interrupt controller which prioritizes interrupts and provides for “vectoring” to a specific interrupt handler for a given interrupt Software Dispatching –A single interrupt level –When any interrupt occurs, a software handler must determine which interrupt it is and then transfer control to the appropriate interrupt handler

Interrupt Handling In either case, the “context” of the interrupted program must be saved Context typically includes the program counter contents, register contents, and other pertinent data If multiple interrupts can occur, the context of the interrupt program is usually saved on a stack.

Summary Attributes of Interrupt-Driven Systems Easy to write Fast response times with hardware dispatching CPU cycles are wasted in the “jump to self” loop May be vulnerable to timing variations and hardware failures

Round-Robin Systems Several tasks are executed one after another, usually with each task being assigned a fixed “time slice”. If a task does not complete during a single time slice, it must wait until its next time slice occurs the next time around. Following each time-slice interrupt, the context of the current task must be saved, and the context of the next task must be restored.l Often used with a cyclic executive.

Foreground/Background Systems The “jump to self” loop of interrupt-driven systems is replaced by code that performs useful processing. Interrupt-driven processes comprise the “foreground”, and noninterrupt-driven processes comprise the “background”. The background process is preempted by any foreground process needing to execute.

Background Processing Background processes are non-critical. So long as the foreground processes do not saturate the system, the background process will eventually complete. The time T for a background process to complete may be very long, depending on the foreground time loading factor. Specifically, T = E / (1 - P), where E is the background process’s non-contended execution time, and P is the foreground time loading factor.

Summary Attributes of Foreground/Background Systems Good response times Best when the number of foreground processes is fixed. Otherwise, tricky. May be vulnerable to timing variations and hardware failures

Full-Featured Real-Time Operating Systems Available as commercial, off-the-shelf products –Examples: VxWorks, QNX, VRTX Rely on “task control block” model Usually provide flexible task scheduling methods and extensive API’s for resource management

Typical Task State Transitions Ready Running Blocked Dispatch Preempt Block Event

Priority Preemptive Scheduling Most common scheduling approach for real- time systems. Tasks are scheduled in order of priority. Higher-priority tasks can preempt lower- priority tasks. A task’s priority is assigned based on its importance or urgency. Task priorities may be fixed or dynamic.

Rate-Monotonic Systems Special class of fixed-rate, priority preemptive systems Task priorities are assigned such that higher execution rates correspond to higher priorities. Rate-monotonic scheduling is optimal for fixed- priority tasks. Does not take into consideration resource contention or context switch times. Vulnerable to “priority inversion”

Priority Inversion The priority assigned to a task does not reflect its criticality. Several kinds of priority inversion: –A non-critical task with a high frequency of execution is assigned a higher priority than a critical task with a low frequency of execution. Solution - exchange execution rates where possible. –A low-priority task holds a resource needed by a high- priority task. Solution - “priority inheritance” in which the low-priority task temporarily inherits the priority of the high-priority task needing the resource