Chapter 15 – Part 1 The Internal Operating System

Slides:



Advertisements
Similar presentations
Chapter 14 The User View of Operating Systems
Advertisements

Operating Systems Review.
SUPPLEMENTARY CHAPTER 2 Instruction Addressing Modes
Operating Systems ECE344 Ding Yuan Final Review Lecture 13: Final Review.
Virtual Memory Introduction to Operating Systems: Module 9.
Chapter 10 Operating Systems.
Chapter 10 Operating Systems. 2 Chapter Goals Describe the two main responsibilities of an operating system Define memory and process management Explain.
Chapter 101 Virtual Memory Chapter 10 Sections and plus (Skip:10.3.2, 10.7, rest of 10.8)
Chapter 18 Three Operating Systems
Dr Mohamed Menacer College of Computer Science and Engineering Taibah University CS-334: Computer.
Chapter 10 Operating Systems. 2 Chapter Goals Describe the two main responsibilities of an operating system Define memory and process management Explain.
Chapter 12 Three System Examples The Architecture of Computer Hardware and Systems Software: An Information Technology Approach 3rd Edition, Irv Englander.
CHAPTER 2: Number Systems
Memory Management Chapter 5.
©Brooks/Cole, 2003 Chapter 7 Operating Systems Dr. Barnawi.
MEMORY MANAGEMENT By KUNAL KADAKIA RISHIT SHAH. Memory Memory is a large array of words or bytes, each with its own address. It is a repository of quickly.
Computer Organization and Architecture
1 Virtual Memory Management B.Ramamurthy Chapter 10.
CHAPTER 8: CPU and Memory Design, Enhancement, and Implementation
CHAPTER 9: Input / Output
Lesson 9: Creating and Configuring Virtual Networks
Chapter 4 Memory Management 4.1 Basic memory management 4.2 Swapping
CS364 CH08 Operating System Support TECH Computer Science Operating System Overview Scheduling Memory Management Pentium II and PowerPC Memory Management.
Layers and Views of a Computer System Operating System Services Program creation Program execution Access to I/O devices Controlled access to files System.
Chapter 10 Operating Systems. 2 Chapter Goals Describe the two main responsibilities of an operating system Define memory and process management Explain.
Chapter 10 Operating Systems.
Chapter 3 Memory Management: Virtual Memory
Chapter 10 Operating Systems Nell Dale • John Lewis.
Chapter 10 Operating Systems *. 2 Chapter Goals Describe the main responsibilities of an operating system Define memory and process management Explain.
CHAPTER 8: CPU and Memory Design, Enhancement, and Implementation
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-3 CPU Scheduling Department of Computer Science and Software Engineering.
CHAPTER 9: Input / Output
Chapter 5 Operating System Support. Outline Operating system - Objective and function - types of OS Scheduling - Long term scheduling - Medium term scheduling.
CGS 3763 Operating Systems Concepts Spring 2013 Dan C. Marinescu Office: HEC 304 Office hours: M-Wd 11: :30 AM.
Chapter 10 Operating Systems.
Operating Systems Process Management.
6 Memory Management and Processor Management Management of Resources Measure of Effectiveness – On most modern computers, the operating system serves.
Copyright © 2000 John Wiley & Sons, Inc. All rights reserved
OPERATING SYSTEMS - I. What is an Operating System OS is a program that manages the computer hardware It provides a basis for application programs and.
10-1 Software Categories Application software Software written to address specific needs—to solve problems in the real world Word processing programs,
Virtual Memory The memory space of a process is normally divided into blocks that are either pages or segments. Virtual memory management takes.
KT6213 Lecture 14: Operating Systems – File Management & Internal OS Computer Organization and Architecture.
CHAPTER 18: The Internal Operating System
CSE 153 Design of Operating Systems Winter 2015 Midterm Review.
CS 149: Operating Systems March 5 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak
Lecture Topics: 11/15 CPU scheduling: –Scheduling goals and algorithms.
What is an Operating System? Various systems and their pros and cons –E.g. multi-tasking vs. Batch OS definitions –Resource allocator –Control program.
Slide 6-1 Chapter 6 System Software Considerations Introduction to Information Systems Judith C. Simon.
NETW3005 Virtual Memory. Reading For this lecture, you should have read Chapter 9 (Sections 1-7). NETW3005 (Operating Systems) Lecture 08 - Virtual Memory2.
Computer Architecture Chapter (8): Operating System Support
Memory Management.
OPERATING SYSTEM CONCEPTS AND PRACTISE
TK 6123 COMPUTER ORGANISATION & ARCHITECTURE
UNIT–IV: Memory Management
Operating System (OS) QUESTIONS AND ANSWERS
William Stallings Computer Organization and Architecture
Chapter 2.2 : Process Scheduling
Main Memory Management
CHAPTER 8: CPU and Memory Design, Enhancement, and Implementation
Chapter 9: Virtual-Memory Management
Chapter 15 – Part 1 The Internal Operating System
Chapter 9: Virtual Memory
Operating Systems.
Process Scheduling Decide which process should run and for how long
Chapter 8: Memory Management strategies
Chapter 14 The User View of Operating Systems
CSE 153 Design of Operating Systems Winter 2019
CSE 542: Operating Systems
Presentation transcript:

Chapter 15 – Part 1 The Internal Operating System The Architecture of Computer Hardware and Systems Software: An Information Technology Approach 3rd Edition, Irv Englander John Wiley and Sons 2003 Wilson Wong, Bentley College Linda Senne, Bentley College

OS Internals – Part I Process Scheduling CPU Scheduling Memory Management Virtual Storage Chapter 15 The Internal Operating System – Part 1

Target Model Chapter 15 The Internal Operating System – Part 1

Loading and Executing a Program Network Services File management Device management / Resource allocation Memory management / Scheduling Monitor Translates logical file requests IOCS (I/O control system) Load programs into MM Allocates execution time Provides overall system control Chapter 15 The Internal Operating System – Part 1

Multi-Tasking System The OS must allocate resources (CPU, memory, I/O) to multiple processes Different scheduling routines are used for different objectives Chapter 15 The Internal Operating System – Part 1

Processes Process: basic unit of work in the OS A program together with all the resources that are associated with it as it is executed Program: a file or listing Process: a program being executed Independent vs. cooperating processes PID (process ID): a unique identifier for each process Process creation: user vs. system Forking, spawning, cloning a new process Parent and child processes Chapter 15 The Internal Operating System – Part 1

Process Control Block A block of data for each process in the system Contains all relevant information about the process Typical process control block on the right  Chapter 15 The Internal Operating System – Part 1

Two Processes Sharing a Single Program Chapter 15 The Internal Operating System – Part 1

Process States Three primary process operating states Ready state Running state Blocked state Dispatching - Move from ready state to running state Wake-up - Move from blocked state to ready state Time-out - Move from running state to ready state Process completion killed, terminated, destroyed Additional states – suspend, swap Resumption – Move from suspended state to ready state Chapter 15 The Internal Operating System – Part 1

Process State Diagram Chapter 15 The Internal Operating System – Part 1

Threads ‘Miniprocess’ that can be run independent of other parts of the process Event-driven programs No control blocks Shares resources allocated to its parent process including primary storage, files and I/O devices Advantage of process/thread families over multiple independent processes: Reduced OS overhead for resource allocation and process management Substantially less information than a normal PCB Chapter 15 The Internal Operating System – Part 1

CPU Scheduling Chapter 15 The Internal Operating System – Part 1

Dispatching Objectives Maximize throughput Minimize turnaround time Maximize CPU utilization Maximize resource allocation Promote graceful degradation Provide minimal and consistent response time Prevent starvation Chapter 15 The Internal Operating System – Part 1

Nonpreemptive Dispatching First in, first out (FIFO) Unfair to short processes and I/O based processes Shortest Job First (SJF) Longer jobs can be starved Priority Scheduling Dispatcher selects among jobs with the same priorities Chapter 15 The Internal Operating System – Part 1

Preemptive Dispatching Round robin Inherently fair and maximizes throughput Dynamic Priority Based on ratio of CPU time to total time process has been in the system Smallest ratio has highest priority Linux, Windows 2000 each process gets the same amount of time, simple and inherently fair, good on maximizing throughput, jobs penalized for IO, UNIX variation - calculates a dynamic priority based on the ratio of CPU time to total time, if no jobs have IO this reduces to RR Multi-level feedback - hybrid algorithm, favors short jobs, favors IO bound jobs, processes enter at the first queue, and are given almost immediate CPU access, if they don’t finish the first time through they are assigned to the second level queue, Chapter 15 The Internal Operating System – Part 1

Preemptive Dispatching Multilevel feedback queues Favors short jobs, I/O bound jobs Each level assigns more CPU time Chapter 15 The Internal Operating System – Part 1

Memory Management Memory Partitioning Overlays Memory Relocation Fixed Variable Best fit, first-fit, largest-fit algorithms Memory fragmentation Overlays Programs are divided into small logical pieces for execution Pieces are loaded into memory as needed Memory Relocation Addresses have to be adjusted unless relative addressing is used Chapter 15 The Internal Operating System – Part 1

Memory Overlays Chapter 15 The Internal Operating System – Part 1

Virtual Memory Virtual memory increases the apparent amount of memory by using far less expensive hard disk space Provides for process separation Demand paging Pages brought into memory as needed Page table Keeps track of what is in memory and what is still out on hard disk Chapter 15 The Internal Operating System – Part 1

Frames and Pages Program Memory Unit Page Frame Address Logical Physical Size 2 to 4KB Amount # of bits in instruction word Installed memory Chapter 15 The Internal Operating System – Part 1

Frames and Pages Binary Paging Chapter 15 The Internal Operating System – Part 1

Dynamic Address Translation Chapter 15 The Internal Operating System – Part 1

Page Table Page Frame Pages not in main memory: page fault when accessed 1 2 3 4 5 6 7 8 9 10 11 Disk 1 2 3 4 5 6 7 8 9 10 11 Swap space Virtual Memory Pages Chapter 15 The Internal Operating System – Part 1

Steps in Handling a Page Fault Chapter 15 The Internal Operating System – Part 1

Locality of Reference Most memory references confined to small region Well-written program in small loop, procedure or function Data likely in array and variables stored together Working set Number of pages sufficient to run program normally, i.e., satisfy locality of a particular program Chapter 15 The Internal Operating System – Part 1

Page Replacement Algorithms Page fault - page is not in memory and must be loaded from disk Algorithms to manage swapping First-In, First-Out FIFO – Belady’s Anomaly Least Recently Used LRU Least Frequently Used LFU Not Used Recently NUR Referenced bit, Modified (dirty) bit Second Chance Replacement algorithms Thrashing too many page faults affect system performance Chapter 15 The Internal Operating System – Part 1

Virtual Memory Tradeoffs Disadvantages SWAP file takes up space on disk Paging takes up resources of the CPU Advantages Programs share memory space More programs run at the same time Programs run even if they cannot fit into memory all at once Process separation Chapter 15 The Internal Operating System – Part 1

Virtual Memory vs. Caching Cache speeds up memory access Virtual memory increases amount of perceived storage Independence from the configuration and capacity of the memory system Low cost per bit compared to main memory Chapter 15 The Internal Operating System – Part 1

Secondary Storage Scheduling First-Come, First-Served Shortest Distance First Indefinite postponement problem Scan Middle of disk gets serviced twice N-Step C-Scan Disk seek in only one direction Return after last request in queue served Two queues Queue of requests being processed Queue of new requests Chapter 15 The Internal Operating System – Part 1

Other OS Issues Deadlock Process Synchronization Two processes have one another’s resources that the other needs in order to proceed Prevention Avoidance Detection and recovery Process Synchronization Chapter 15 The Internal Operating System – Part 1

Java Virtual Machine Chapter 15 The Internal Operating System – Part 1

Copyright 2003 John Wiley & Sons All rights reserved. Reproduction or translation of this work beyond that permitted in Section 117 of the 1976 United States Copyright Act without express permission of the copyright owner is unlawful. Request for further information should be addressed to the permissions Department, John Wiley & Songs, Inc. The purchaser may make back-up copies for his/her own use only and not for distribution or resale. The Publisher assumes no responsibility for errors, omissions, or damages caused by the use of these programs or from the use of the information contained herein.” Chapter 15 The Internal Operating System – Part 1