Main Memory (II) Operating Systems. Autumn CS4023

Similar documents
CS3600 SYSTEMS AND NETWORKS

Chapter 8: Main Memory

Chapter 8: Main Memory

Chapter 8: Memory Management Strategies

8.1 Background. Part Four - Memory Management. Chapter 8: Memory-Management Management Strategies. Chapter 8: Memory Management

Part Three - Memory Management. Chapter 8: Memory-Management Strategies

I.-C. Lin, Assistant Professor. Textbook: Operating System Concepts 8ed CHAPTER 8: MEMORY

I.-C. Lin, Assistant Professor. Textbook: Operating System Principles 7ed CHAPTER 8: MEMORY

Chapter 9: Memory Management. Background

Module 8: Memory Management

Module 9: Memory Management. Background. Binding of Instructions and Data to Memory

Module 8: Memory Management

Chapter 8: Memory Management

Memory Management. CSCI 315 Operating Systems Design Department of Computer Science

Chapter 8: Memory- Manage g me m nt n S tra r t a e t gie i s

Goals of Memory Management

Chapter 8: Memory Management. Operating System Concepts with Java 8 th Edition

Chapter 7: Main Memory. Operating System Concepts Essentials 8 th Edition

CSE 4/521 Introduction to Operating Systems. Lecture 14 Main Memory III (Paging, Structure of Page Table) Summer 2018

Logical versus Physical Address Space

Memory Management. Memory Management

Chapter 8: Memory- Management Strategies. Operating System Concepts 9 th Edition

CS420: Operating Systems. Paging and Page Tables

CS370 Operating Systems

Lecture 8 Memory Management Strategies (chapter 8)

CS307 Operating Systems Main Memory

CS307: Operating Systems

Page Table Structure. Hierarchical Paging. Hashed Page Tables. Inverted Page Tables

Main Memory (Part II)

Chapter 8: Memory- Management Strategies

Chapter 8: Memory- Management Strategies. Operating System Concepts 9 th Edition

Chapter 9 Memory Management Main Memory Operating system concepts. Sixth Edition. Silberschatz, Galvin, and Gagne 8.1

Memory management. Last modified: Adaptation of Silberschatz, Galvin, Gagne slides for the textbook Applied Operating Systems Concepts

Chapter 8: Main Memory

Memory Management Cache Base and Limit Registers base limit Binding of Instructions and Data to Memory Compile time absolute code Load time

Chapter 8: Memory-Management Strategies

SHANDONG UNIVERSITY 1

CHAPTER 8: MEMORY MANAGEMENT. By I-Chen Lin Textbook: Operating System Concepts 9th Ed.

6 - Main Memory EECE 315 (101) ECE UBC 2013 W2

CHAPTER 8 - MEMORY MANAGEMENT STRATEGIES

Chapter 8: Main Memory. Operating System Concepts 9 th Edition

Main Memory. CISC3595, Spring 2015 X. Zhang Fordham University

Chapter 8 Memory Management

Chapter 8: Main Memory

Memory Management (2)

Principles of Operating Systems

CS 3733 Operating Systems:

Chapter 8: Memory Management. Background Swapping Contiguous Allocation Paging Segmentation Segmentation with Paging

Memory Management. Contents: Memory Management. How to generate code? Background

Memory Management. Memory

Chapter 8 Main Memory

Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation

Memory Management. Dr. Yingwu Zhu

P r a t t hr h ee e : e M e M m e o m r o y y M a M n a a n g a e g m e e m n e t 8.1/72

Virtual Memory. CSCI 315 Operating Systems Design Department of Computer Science

Memory Management. Reading: Silberschatz chapter 9 Reading: Stallings. chapter 7 EEL 358

Chapter 8: Memory- Management Strategies Dr. Varin Chouvatut

Memory Management. Minsoo Ryu. Real-Time Computing and Communications Lab. Hanyang University.

Memory Management Minsoo Ryu Real-Time Computing and Communications Lab. Hanyang University

Roadmap. Tevfik Koşar. CSC Operating Systems Spring Lecture - XII Main Memory - II. Louisiana State University

Background. Contiguous Memory Allocation

Paging & Segmentation

Main Memory Yi Shi Fall 2017 Xi an Jiaotong University

CSE 421/521 - Operating Systems Fall Lecture - XII Main Memory Management. Tevfik Koşar. University at Buffalo. October 18 th, 2012.

ECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective. Part I: Operating system overview: Memory Management

CS370 Operating Systems

Topics: Memory Management (SGG, Chapter 08) 8.1, 8.2, 8.3, 8.5, 8.6 CS 3733 Operating Systems

Outlook. Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation Example: The Intel Pentium

File Systems. OS Overview I/O. Swap. Management. Operations CPU. Hard Drive. Management. Memory. Hard Drive. CSI3131 Topics. Structure.

Multi-Process Systems: Memory (2) Memory & paging structures: free frames. Memory & paging structures. Physical memory

Chapter 9 Memory Management

Main Memory. Electrical and Computer Engineering Stephen Kim ECE/IUPUI RTOS & APPS 1

Performance of Various Levels of Storage. Movement between levels of storage hierarchy can be explicit or implicit

Chapter 8 & Chapter 9 Main Memory & Virtual Memory

Unit-03 Deadlock and Memory Management Unit-03/Lecture-01

Memory Management and Protection

Memory Management. Dr. Yingwu Zhu

CS6401- Operating System UNIT-III STORAGE MANAGEMENT

Operating Systems. Designed and Presented by Dr. Ayman Elshenawy Elsefy

COSC Operating Systems Design, Fall 2001, Byunggu Yu. Chapter 9 Memory Management (Lecture Note #8) 1. Background

Basic Memory Management. Basic Memory Management. Address Binding. Running a user program. Operating Systems 10/14/2018 CSC 256/456 1

Chapter 8: Main Memory. Operating System Concepts 8th Edition

VII. Memory Management

Basic Memory Management

CS 143A - Principles of Operating Systems

SE-292 High Performance Computing. Memory Hierarchy. R. Govindarajan

Chapters 9 & 10: Memory Management and Virtual Memory

Virtual Memory. Patterson & Hennessey Chapter 5 ELEC 5200/6200 1

CS 333 Introduction to Operating Systems. Class 11 Virtual Memory (1) Jonathan Walpole Computer Science Portland State University

Chapter 8: Memory Management

Outline. V Computer Systems Organization II (Honors) (Introductory Operating Systems) Advantages of Multi-level Page Tables

Operating Systems Memory Management. Mathieu Delalandre University of Tours, Tours city, France

UNIT-III VIRTUAL MEMORY

CS399 New Beginnings. Jonathan Walpole

Main Memory: Address Translation

Operating System 1 (ECS-501)

1. Creates the illusion of an address space much larger than the physical memory

Introduction to Operating Systems

csci 3411: Operating Systems

Operating Systems. Paging... Memory Management 2 Overview. Lecture 6 Memory management 2. Paging (contd.)

Transcription:

Operating Systems Autumn 2017-2018

Outline 1 Main Memory (II)

Outline Main Memory (II) 1 Main Memory (II)

Paging Main Memory (II) Physical address space of a process can be noncontiguous; process is allocated physical memory whenever the latter is available Divide physical memory into fixed-sized blocks called frames (size is power of 2, between 512 bytes and 8,192 bytes) Divide logical memory into blocks of same size called pages Keep track of all free frames To run a program of size x pages, need to find x free frames and load the program into them Set up a page table to translate logical to physical addresses

Address Translation Scheme Address generated by CPU is divided into 2 pieces: Page number (p) used as an index into a page table which contains base address of each page in physical memory Page offset (d) combined with base address to define the physical memory address that is sent to the memory unit page number page offset p d (m n) bits n bits For given logical address space 2 m (m bits) and page size 2 n

Paging Hardware Main Memory (II)

Paging Model of Logical and Physical Memory

Paging Example Main Memory (II) 16-byte logical address space (m = 4) 4-byte pages (n = 2) (32-byte physical memory)

Free Frames Main Memory (II)

Implementation of Page Table Page table is kept in main memory Page-table base register (PTBR) points to the page table Page-table length register (PTLR) indicates size of the page table In this scheme every data/instruction access requires two memory accesses: one for the page table and one for the data/instruction The two memory access problem can be solved by the use of a special fast-lookup hardware cache called associative memory or translation look-aside buffers (TLBs) Some TLBs store address-space identifiers (ASIDs) in each TLB entry uniquely identifies each process to provide address-space protection for that process

Associative Memory Main Memory (II) Associative memory Answers do I know about item x? Does it in (almost always) one clock cycle! Analogy: find me the index in an array where the value (say) 1.34 is stored; do this in one clock cycle Parallel search! Address translation (p, d) If p is in associative register, return corresponding frame no. Otherwise get frame number from page table in memory

Paging Hardware With TLB

Memory Protection Main Memory (II) Memory protection implemented by associating protection bit with each frame Valid-invalid bit attached to each entry in the page table: valid indicates that the associated page is in the process logical address space, and is thus a legal page invalid indicates that the page is not in the process logical address space

Valid (v) or Invalid (i) Bit In A Page Table Page size 2KB System with logical address space 8 2K = 16K: 14-bit address space, 0 16383 Program only uses addresses 0 10468 internal fragmentation: 10469 16383 2 13 = 8192 < 10468 < 16383 = 2 14 1 (see table)

Outline Main Memory (II) 1 Main Memory (II)

Main Memory (II) Shared code One copy of read-only (reentrant) code shared among processes (i.e., text editors, compilers, window systems) Shared code must appear in same location in the logical address space of all processes Private code and data Each process keeps a separate copy of the code and data The pages for the private code and data can appear anywhere in the logical address space

Example

Outline Main Memory (II) 1 Main Memory (II)

Main Memory (II) Memory-management scheme that supports user view of memory A program is a collection of segments A segment is a logical unit such as: main program procedure function method object local variables, global variables common block (FORTRAN prog. language) stack symbol table arrays

User s View of a Program segments differently sized each segment is put somewhere in memory not necessarily consecutively ordered memory no longer divided in to equal frames

Architecture Logical address consists of a two-tuple: <segment-number, offset> Segment table maps two-dimensional physical addresses; each table entry has: base contains the starting physical address where the segment resides in memory limit specifies the length of the segment Segment-table base register (STBR) points to the segment table s location in memory Segment-table length register (STLR) indicates number of segments used by a program: segment number s is legal if s < STLR

Hardware

Example of

Example: Intel Pentium Supports both segmentation and segmentation with paging CPU generates logical address Given to segmentation unit Which produces linear addresses Linear address given to paging unit Which generates physical address in main memory Paging units form equivalent of MMU