Chapter 3 Memory Management

Similar documents
Virtual vs Physical Addresses

Memory Management Outline. Background Swapping Contiguous Memory Allocation Paging Segmentation Segmented Paging

OPERATING SYSTEM - VIRTUAL MEMORY

Memory management basics (1) Requirements (1) Objectives. Operating Systems Part of E1.9 - Principles of Computers and Software Engineering

Computer-System Architecture

Lecture 17: Virtual Memory II. Goals of virtual memory

Operating Systems, 6 th ed. Test Bank Chapter 7

& Data Processing 2. Exercise 3: Memory Management. Dipl.-Ing. Bogdan Marin. Universität Duisburg-Essen

Virtual Memory. How is it possible for each process to have contiguous addresses and so many of them? A System Using Virtual Addressing

Board Notes on Virtual Memory

OPERATING SYSTEM - MEMORY MANAGEMENT

Operating Systems. Virtual Memory

Virtual Memory. Virtual Memory. Paging. CSE 380 Computer Operating Systems. Paging (1)

Memory Management 1. Memory Management. Multitasking without memory management is like having a party in a closet.

Virtual Memory Paging

Operating Systems. Design and Implementation. Andrew S. Tanenbaum Melanie Rieback Arno Bakker. Vrije Universiteit Amsterdam

Outline. Operating Systems Design and Implementation. Chap 1 - Overview. What is an OS? 28/10/2014. Introduction

Operating Systems. Lecture 03. February 11, 2013

Memory unit sees only the addresses, and not how they are generated (instruction counter, indexing, direct)

Chapter 7 Memory Management

The Deadlock Problem. Deadlocks. Deadlocks. Bridge Crossing Example

Hypervisor: Requirement Document (Version 3)

CS 61C: Great Ideas in Computer Architecture Virtual Memory Cont.

Virtual Machines. COMP 3361: Operating Systems I Winter

Technical Properties. Mobile Operating Systems. Overview Concepts of Mobile. Functions Processes. Lecture 11. Memory Management.

Chapter 6, The Operating System Machine Level

Data Storage - I: Memory Hierarchies & Disks

OPERATING SYSTEMS MEMORY MANAGEMENT

COS 318: Operating Systems. Virtual Memory and Address Translation

How To Write A Page Table

ASSEMBLY PROGRAMMING ON A VIRTUAL COMPUTER

HY345 Operating Systems

Chapter 11 I/O Management and Disk Scheduling

A3 Computer Architecture

Presentation of Diagnosing performance overheads in the Xen virtual machine environment

CS 377: Operating Systems. Outline. A review of what you ve learned, and how it applies to a real operating system. Lecture 25 - Linux Case Study

Introduction to RISC Processor. ni logic Pvt. Ltd., Pune

Computer Architecture

I/O Management. General Computer Architecture. Goals for I/O. Levels of I/O. Naming. I/O Management. COMP755 Advanced Operating Systems 1

Perfmon Collection Setup Instructions for Windows Server 2008+

OSes. Arvind Seshadri Mark Luk Ning Qu Adrian Perrig SOSP2007. CyLab of CMU. SecVisor: A Tiny Hypervisor to Provide

POSIX. RTOSes Part I. POSIX Versions. POSIX Versions (2)

The basic CAP CPU consists of a microprogramming control unit, 4K 16-bit words of micro-control storage, and an 79

W4118: segmentation and paging. Instructor: Junfeng Yang

Operating System Tutorial

Chapter 3: Operating-System Structures. System Components Operating System Services System Calls System Programs System Structure Virtual Machines

Operating Systems 4 th Class

Operating System Structures

Virtual Machines. Virtualization

Understanding Virtual Memory In Red Hat Enterprise Linux 3

Process Description and Control william stallings, maurizio pizzonia - sistemi operativi

SYSTEM ecos Embedded Configurable Operating System

Computers. Hardware. The Central Processing Unit (CPU) CMPT 125: Lecture 1: Understanding the Computer

CSC 2405: Computer Systems II

Operating System Overview. Otto J. Anshus

ELEC 377. Operating Systems. Week 1 Class 3

Lesson Objectives. To provide a grand tour of the major operating systems components To provide coverage of basic computer system organization

This tutorial will take you through step by step approach while learning Operating System concepts.

Timing of a Disk I/O Transfer

Chapter 7 Memory Management

Introduction. What is an Operating System?

Linux Process Scheduling Policy

Lecture 25 Symbian OS

Full and Para Virtualization

CS5460: Operating Systems

Monitoring PostgreSQL database with Verax NMS

CS 695 Topics in Virtualization and Cloud Computing. More Introduction + Processor Virtualization

Red Hat Linux Internals

Chapter 11 I/O Management and Disk Scheduling

find model parameters, to validate models, and to develop inputs for models. c 1994 Raj Jain 7.1

Chapter 5 Cloud Resource Virtualization

a storage location directly on the CPU, used for temporary storage of small amounts of data during processing.

Memory Management CS 217. Two programs can t control all of memory simultaneously

AN4664 Application note

1. Computer System Structure and Components

An Implementation Of Multiprocessor Linux

A Comparative Study of CPU Scheduling Algorithms

OPERATING SYSTEM SERVICES

Chapter 2 Basic Structure of Computers. Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan

Chapter 1 Computer System Overview

Computer Organization and Architecture. Characteristics of Memory Systems. Chapter 4 Cache Memory. Location CPU Registers and control unit memory

Memory Management under Linux: Issues in Linux VM development

Hardware and Software Requirements

EE361: Digital Computer Organization Course Syllabus

Secondary Storage. Any modern computer system will incorporate (at least) two levels of storage: magnetic disk/optical devices/tape systems

Memory management. Chapter 4: Memory Management. Memory hierarchy. In an ideal world. Basic memory management. Fixed partitions: multiple programs

COS 318: Operating Systems

Chapter 2 Logic Gates and Introduction to Computer Architecture

Midterm Exam #2 Solutions November 10, 1999 CS162 Operating Systems

Central Processing Unit Simulation Version v2.5 (July 2005) Charles André University Nice-Sophia Antipolis

Chapter 3 Operating-System Structures

ADVANCED PROCESSOR ARCHITECTURES AND MEMORY ORGANISATION Lesson-12: ARM

Pentium vs. Power PC Computer Architecture and PCI Bus Interface

Exceptions in MIPS. know the exception mechanism in MIPS be able to write a simple exception handler for a MIPS machine

ARM Cortex-R Architecture

RTOS Debugger for ecos

Far-western University Central Office, Mahendranagar Operating System

CHAPTER 4 MARIE: An Introduction to a Simple Computer

Binary search tree with SIMD bandwidth optimization using SSE

The Classical Architecture. Storage 1 / 36

Transcription:

MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 3 Memory Management

No Memory Abstraction Figure 3-1. Three simple ways of organizing memory with an operating system and one user process.

Multiple Programs Without Memory Abstraction Figure 3-2. Illustration of the relocation problem.

Base and Limit Registers Figure 3-3. Base and limit registers can be used to give each process a separate address space.

Swapping (1) Figure 3-4. Memory allocation changes as processes come into memory and leave it. The shaded regions are unused memory.

Swapping (2) Figure 3-5. (a) Allocating space for growing data segment. (b) Allocating space for growing stack, growing data segment.

Virtual Memory Paging (1) Figure 3-8. The position and function of the MMU shown as being a part of the CPU chip (it commonly is nowadays). Logically it could be a separate chip, was in years gone by.

Paging (2) Figure 3-9. Relation between virtual addresses and physical memory addresses given by page table.

Paging (3) Figure 3-10. The internal operation of the MMU with 16 4-KB pages.

Structure of Page Table Entry Figure 3-11. A typical page table entry.

Speeding Up Paging Paging implementation issues: The mapping from virtual address to physical address must be fast. If the virtual address space is large, the page table will be large.

Translation Lookaside Buffers Figure 3-12. A TLB to speed up paging.

Multilevel Page Tables Figure 3-13. (a) A 32-bit address with two page table fields. (b) Two-level page tables.

Page Replacement Algorithms Optimal page replacement algorithm Not recently used page replacement First-In, First-Out page replacement Second chance page replacement Clock page replacement Least recently used page replacement Working set page replacement WSClock page replacement

The Clock Page Replacement Algorithm Figure 3-16. The clock page replacement algorithm.

Working Set Page Replacement (1) Figure 3-19. The working set is the set of pages used by the k most recent memory references. The function w(k, t) is the size of the working set at time t.

Summary of Page Replacement Algorithms Figure 3-22. Page replacement algorithms discussed in the text.

Separate Instruction and Data Spaces Figure 3-25. (a) One address space. (b) Separate I and D spaces.

Shared Pages Figure 3-26. Two processes sharing the same program sharing its page table.

Shared Libraries Figure 3-27. A shared library being used by two processes.

Page Fault Handling (1) The hardware traps to the kernel, saving the program counter on the stack. An assembly code routine is started to save the general registers and other volatile information. The operating system discovers that a page fault has occurred, and tries to discover which virtual page is needed. Once the virtual address that caused the fault is known, the system checks to see if this address is valid and the protection consistent with the access

Page Fault Handling (2) If the page frame selected is dirty, the page is scheduled for transfer to the disk, and a context switch takes place. When page frame is clean, operating system looks up the disk address where the needed page is, schedules a disk operation to bring it in. When disk interrupt indicates page has arrived, page tables updated to reflect position, frame marked as being in normal state.

Page Fault Handling (3) Faulting instruction backed up to state it had when it began and program counter reset to point to that instruction. Faulting process scheduled, operating system returns to the (assembly language) routine that called it. This routine reloads registers and other state information and returns to user space to continue execution, as if no fault had occurred.

Segmentation (1) A compiler has many tables that are built up as compilation proceeds, possibly including: The source text being saved for the printed listing (on batch systems). The symbol table the names and attributes of variables. The table containing integer, floating-point constants used. The parse tree, the syntactic analysis of the program. The stack used for procedure calls within the compiler.

Segmentation (2) Figure 3-31. In a one-dimensional address space with growing tables, one table may bump into another.