Real-Time Kernels and Operating Systems. Operating System: Software that coordinates multiple tasks in processor, including peripheral interfacing Types.

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

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.
Process management Information maintained by OS for process management  process context  process control block OS virtualization of CPU for each process.
Real-Time Kernels and Operating Systems Basic Issue - Purchase commercial “off-the- shelf” system or custom build one Basic Functions –Task scheduling.
Threads, SMP, and Microkernels Chapter 4. Process Resource ownership - process is allocated a virtual address space to hold the process image Scheduling/execution-
Chapter 4 Threads, SMP, and Microkernels Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design.
Computer Systems/Operating Systems - Class 8
Review: Chapters 1 – Chapter 1: OS is a layer between user and hardware to make life easier for user and use hardware efficiently Control program.
Chapter 4: Threads. Overview Multithreading Models Threading Issues Pthreads Windows XP Threads.
Chapter 5 Processes and Threads Copyright © 2008.
OS Fall ’ 02 Introduction Operating Systems Fall 2002.
Review: Operating System Manages all system resources ALU Memory I/O Files Objectives: Security Efficiency Convenience.
OS Spring’03 Introduction Operating Systems Spring 2003.
Ceng Operating Systems Chapter 2.1 : Processes Process concept Process scheduling Interprocess communication Deadlocks Threads.
1 Chapter 4 Threads Threads: Resource ownership and execution.
Process Concept An operating system executes a variety of programs
A. Frank - P. Weisberg Operating Systems Introduction to Tasks/Threads.
Using Two Queues. Using Multiple Queues Suspended Processes Processor is faster than I/O so all processes could be waiting for I/O Processor is faster.
Chapter 51 Threads Chapter 5. 2 Process Characteristics  Concept of Process has two facets.  A Process is: A Unit of resource ownership:  a virtual.
Chapter 3 Operating Systems Introduction to CS 1 st Semester, 2015 Sanghyun Park.
Operating System 4 THREADS, SMP AND MICROKERNELS
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3: Operating Systems Computer Science: An Overview Tenth Edition.
Chapter 4 Threads, SMP, and Microkernels Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design.
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.
Processes and Threads CS550 Operating Systems. Processes and Threads These exist only at execution time They have fast state changes -> in memory and.
Operating Systems Part III: Process Management (Process States and Transitions)
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
1 Chapter 2.1 : Processes Process concept Process concept Process scheduling Process scheduling Interprocess communication Interprocess communication Threads.
E X C E E D I N G E X P E C T A T I O N S OP SYS Linux System Administration Dr. Hoganson Kennesaw State University Operating Systems Functions of an operating.
Computers Operating System Essentials. Operating Systems PROGRAM HARDWARE OPERATING SYSTEM.
Threads G.Anuradha (Reference : William Stallings)
Chapter 2 Processes and Threads Introduction 2.2 Processes A Process is the execution of a Program More specifically… – A process is a program.
1 Threads, SMP, and Microkernels Chapter Multithreading Operating system supports multiple threads of execution within a single process MS-DOS.
Operating System Structure A key concept of operating systems is multiprogramming. –Goal of multiprogramming is to efficiently utilize all of the computing.
Silberschatz, Galvin and Gagne  Operating System Concepts Process Concept An operating system executes a variety of programs:  Batch system.
Processes CSCI 4534 Chapter 4. Introduction Early computer systems allowed one program to be executed at a time –The program had complete control of the.
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
1 VxWorks 5.4 Group A3: Wafa’ Jaffal Kathryn Bean.
Processes, Threads, and Process States. Programs and Processes  Program: an executable file (before/after compilation)  Process: an instance of a program.
Operating Systems: Internals and Design Principles
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Operating Systems Processes and Threads.
Chapter 3 Operating Systems. © 2005 Pearson Addison-Wesley. All rights reserved 3-2 Chapter 3 Operating Systems 3.1 The Evolution of Operating Systems.
Operating Systems (CS 340 D) Dr. Abeer Mahmoud Princess Nora University Faculty of Computer & Information Systems Computer science Department.
1.  System Characteristics  Features of Real-Time Systems  Implementing Real-Time Operating Systems  Real-Time CPU Scheduling  An Example: VxWorks5.x.
Unit - I Real Time Operating System. Content : Operating System Concepts Real-Time Tasks Real-Time Systems Types of Real-Time Tasks Real-Time Operating.
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.
Advanced Operating Systems CS6025 Spring 2016 Processes and Threads (Chapter 2)
Embedded Real-Time Systems
CONCEPTS OF REAL-TIME OPERATING SYSTEM. OBJECTIVE  To Understand Why we need OS?  To identify Types of OS  To Define Real - Time Systems  To Classify.
CT101: Computing Systems Introduction to Operating Systems.
Processes and Threads Chapter 3 and 4 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,
Process Management Process Concept Why only the global variables?
EEE Embedded Systems Design Process in Operating Systems 서강대학교 전자공학과
Topics Covered What is Real Time Operating System (RTOS)
OPERATING SYSTEMS CS3502 Fall 2017
Real-time Software Design
Process management Information maintained by OS for process management
Threads, SMP, and Microkernels
Introduction What is an operating system bootstrap
Process & its States Lecture 5.
PROCESS MANAGEMENT Information maintained by OS for process management
Process Description and Control
Lecture Topics: 11/1 General Operating System Concepts Processes
Process Description and Control
Lecture 4- Threads, SMP, and Microkernels
Threads and Concurrency
Threads Chapter 4.
EE 472 – Embedded Systems Dr. Shwetak Patel.
Prof. Leonardo Mostarda University of Camerino
Presentation transcript:

Real-Time Kernels and Operating Systems

Operating System: Software that coordinates multiple tasks in processor, including peripheral interfacing Types of task activities: data exchange / sharing synchronization scheduling resource sharing Real-time OS (RTOS): one or more tasks must execute within specified time constraints

fig_11_00 Example: tasks in meal preparation cannot all be completed in a strict sequence

Single process/task: required resources: Process stack Memory address space Registers (in CPU) PC I/O ports and network connections File descriptors … Process state: PC value, register contents, etc. at a given time Which must be shared with other processes? How can this sharing be managed efficiently?

fig_11_01 In embedded systems we can think of the CPU as a resource for the current task: CPU is a shared resource Multitasking: more than one task needs to execute, in a seamless manner CPU, other resources must be shared

fig_11_02 Multiple processes, typically running concurrently Q: what are some typical processes?

fig_11_03 Tasks switch from “running” to “ready/waiting” and back according to a schedule Q: what should be length of turn? Who gets priority?

Common sharing strategies: Multiprogramming: task runs until it needs to wait on an external event (e.g., I/O) Real-time: certain tasks have deadlines that must be met Time-sharing: each process gets a time slice; processes are preempted when time slice is up, must wait for next turn

fig_11_04 Task context: what is the state of task—e.g., register contents; when tasks are swapped, contexts must also be swapped and task that is not running must have its information saved Task states In simple system

Thread: smallest set of resources a task needs (PC and stack, e.g.—if not running, must have copy of register contents) Terminology: Process= “heavyweight thread” Smallest set of resources = “lightweight thread”

fig_11_05 Single-thread design: one process

fig_11_05 Multiple threads

fig_11_07 Process privilege levels affect operations it can carry out without assistance from other processes: Child process: shares code space, has own data space, data, status, stack Multiple threads: each has its own stack, status information Process: separate address space Reentrant code: child process can use same code, needs different local variables

fig_11_07 Foreground tasks: initiated by interrupt or real-time constraint—higher priority levels Background tasks—not interrupt-driven—lower priority levels—e.g. monitoring tasks, intensive processing tasks

fig_11_07 Operating system: Kernel—portion of OS providing basic functions: Scheduler: Schedule tasks for execution Dispatcher: Choose (“dispatch”) task to run Intertask and interprocess communication: Ensure tasks can communicate as needed and are synchronized as needed

fig_11_07 Necessary services to carry out these jobs: Manage processes and tasks, deal with “deadlocks” Manage memory, I/O system, file system RTOS: make sure deadlines are met; make sure behavior is DETERMINISTIC (not necessarily “fast”) Hard real-time; system delays are known or at least bounded Soft real-time: critical tasks have priority and are allowed to run to completion

fig_11_08 OS architecture: Virtual machine model: Very modular but may not match real machine

fig_11_09 OS architecture: Typical architecture

fig_11_10 TCB: task control block—required for each task or process to be executed Task states: Ready Execute dormant

fig_11_11 Code for a task control block:

fig_11_12 Example: simple system, 3 asynchronous tasks sharing a common data buffer --get data --perform computation --display data Task queue implemented as array Will run “forever” No preemption (each task runs to completion)

fig_11_13b Kernel example

fig_11_14a Same tasks—using task control blocks

fig_11_12 Some problems with this system; Can get stuck in one task Ex: user does not input data so we are stuck in the “get” task Solution: use interrupts, break task into prompt and task to get data when it is available Shared data buffer In this example, only 1 task is active at a time so there is no conflict

fig_11_15 Typical function to set address to correct interrupt:

fig_11_17a Modification to allow interrupts Part 1 of 3):

fig_11_17b Modification to allow interrupts Part 2 of 3):

fig_11_17c Modification to allow interrupts Part 3 of 3):

fig_11_18 Registers: Can organize as multiple contexts

fig_11_19 Registers: Can organize as overlapping contexts—saves overhead on variable passing

fig_11_20 Stack: typical stack frame organization

fig_11_21 Runtime stack: multiple task information must be stored