Paging, and segmentation

Similar documents
Requirements, Partitioning, paging, and segmentation

Memory Management. Memory Management

Memory Management. Memory Management Requirements

Requirements, Partitioning, paging, and segmentation

Chapter 7 Memory Management

Memory Management william stallings, maurizio pizzonia - sistemi operativi

The Memory Management Unit. Operating Systems. Autumn CS4023

Memory Management. Memory Management

Computer Systems II. Memory Management" Subdividing memory to accommodate many processes. A program is loaded in main memory to be executed

Lecture 7. Memory Management

Computer Systems II. Memory Management" Subdividing memory to accommodate many processes. A program is loaded in main memory to be executed

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

Chapter 8: Memory Management

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

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

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

Background. Contiguous Memory Allocation

Operating Systems: Internals and Design Principles. Chapter 7 Memory Management Seventh Edition William Stallings

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

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

Chapter 8: Memory Management

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

Chapter 8: Main Memory

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

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

Chapter 9: Memory Management. Background

Module 8: Memory Management

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

Memory Management. Memory Management

Chapter 8: Main Memory

Main Memory (Part I)

Chapter 8: Memory Management Strategies

CS399 New Beginnings. Jonathan Walpole

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

CS420: Operating Systems

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

Module 8: Memory Management

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

Logical versus Physical Address Space

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

Operating Systems. Memory Management. Lecture 9 Michael O Boyle

3. Memory Management

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

Memory management. Requirements. Relocation: program loading. Terms. Relocation. Protection. Sharing. Logical organization. Physical organization

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


UNIT III MEMORY MANAGEMENT

Operating systems. Part 1. Module 11 Main memory introduction. Tami Sorgente 1

Addresses in the source program are generally symbolic. A compiler will typically bind these symbolic addresses to re-locatable addresses.

Virtual Memory: Mechanisms. CS439: Principles of Computer Systems February 28, 2018

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

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

Memory Management (1) Memory Management. CPU vs. memory. No.8. Prof. Hui Jiang Dept of Electrical Engineering and Computer Science, York University

Memory Management (1) Memory Management

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

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

12: Memory Management

CS307 Operating Systems Main Memory

CS370 Operating Systems

Chapter 9 Real Memory Organization and Management

Chapter 9 Real Memory Organization and Management

Memory Management. Dr. Yingwu Zhu

Lecture 8 Memory Management Strategies (chapter 8)

Memory Management Basics

Goals of Memory Management

memory management Vaibhav Bajpai

CS307: Operating Systems

Memory Management. Dr. Yingwu Zhu

Chapter 8 Memory Management

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

Chapter 8: Memory- Management Strategies

SHANDONG UNIVERSITY 1

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

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

The Virtual Memory Abstraction. Memory Management. Address spaces: Physical and Virtual. Address Translation

Chapters 9 & 10: Memory Management and Virtual Memory

CS 5523 Operating Systems: Memory Management (SGG-8)

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

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

Operating Systems (2INC0) 2017/18

General Objective:To understand the basic memory management of operating system. Specific Objectives: At the end of the unit you should be able to:

Chapter 8: Memory-Management Strategies

Memory: Overview. CS439: Principles of Computer Systems February 26, 2018

Memory management: outline

Memory management: outline

CHAPTER 8 - MEMORY MANAGEMENT STRATEGIES

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

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

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

Memory Management. COMP755 Advanced Operating Systems

Memory Management. Goals of Memory Management. Mechanism. Policies

Chapter 9 Memory Management

MEMORY MANAGEMENT/1 CS 409, FALL 2013

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

Main Memory Yi Shi Fall 2017 Xi an Jiaotong University

Course: Operating Systems Instructor: M Umair. M Umair

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

Chapter 8 Main Memory

Transcription:

Paging, and segmentation

Memory Management Subdividing memory to accommodate multiple processes Memory needs to be allocated efficiently to pack as many processes into memory as possible 2

Big Picture kernel memory proc struct kernel stack/u area Stack kernel stack/u area Stack kernel stack/u area Stack Data Text (shared) Data Text (shared) Data Text (shared) 3

Memory mgnt requirements Relocation Protection Sharing Logical organization Physical organization 4

Relocation When program loaded in memory, absolute memory locations assigned A process may occupy different partitions thus different absolute memory locations during execution (from swapping) Compaction will also cause a program to occupy a different partition which means different absolute memory locations 5

Addresses Logical Reference to a storage location independent of the current assignment of data or program to memory Translation must be made to the physical address Relative Address expressed as a location relative to some known point A relative address is an example of a logical address Physical The absolute address or actual location in memory 6

Hardware Support for Relocation Relative address Base Register Process Control Block Adder Program Bounds Register Comparator Absolute address Interrupt to operating system Data Stack Process image in main memory 7

Registers Used during Execution Base register Starting address for the process Bounds register Ending location of the process These values are set when the process is loaded and when the process is swapped in 8

Registers Used during Execution The value of the base register is added to a relative address to produce an absolute address The resulting address is compared with the value in the bounds register If the address is not within bounds, an interrupt is generated to the operating system 9

Simple paging Partition memory into small equal size pieces Pieces of memory are called frames Divide each process into the same size pieces Pieces of a process are called pages All process pages are loaded in memory frames when process is loaded Operating system maintains a page table for each process Contains the frame number for each process page Absolute address = frame number + offset 10

Simple paging Like fixed partitioning, but: Partitions are small A process can occupy more than 1 partitions Partitions do not need to be contiguous Some internal fragmentation (last page), but no external fragmentation 11

12 0 1 2 3 4 5 6 7 A.0 A.1 B.0 B.1 A.0 A.1 C.0 B.0 B.1 A.0 A.1 C.0 A.0 A.1 C.0 A.0 A.1 D.0 D.1 D.2 D.3 0 1 2 3 2 3 5 6 Process D Page Table 7 Free Frame List 0 1 2 3 4 5 6 7 Memory frames

Address translation in paging To make it convenient, the size of a page is a power of 2 Given a (page #, offset), find (frame #, offset) 2 n > number of pages in process => n bits to hold the page number 2 k > number of frames in memory => k bits to hold the frame number 2 m = number of bytes in a page => m bits to determine the offset within a page Logical address is nm Physical address is simply km where k is the frame that stores page n (obtained from the page table) 13

Address translation in paging Page # (n bits) Offset (m bit) 0 0 0 0 0 1 0 1 1 1 0 1 1 1 1 0 Process Page Table: 0 1 2 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 1 0 1... Frame # (k bits) 0 0 0 0 1 1 0 1 1 1 0 1 1 1 1 0 Physical Address 14

Address translation e.g. Main memory Frame # Physical address Value 0 0 E Page # Logical Address Value 0 1 F 0 2 G 0 0 A 0 1 B 0 2 C 0 3 D 1 4 E 1 5 F 1 6 G 1 7 H 2 8 I 2 9 J 2 10 K 2 11 L Page # Frame # 0 2 1 0 2 5 3 4 Page table 0 3 H 1 4 1 7 2 8 A 2 9 B 2 10 C 2 11 D 3 12 3 15 4 16 M 4 17 N 4 18 O 4 19 P 3 12 M 5 20 I 3 13 N 5 21 J 3 14 O 3 15 P Process 5 22 K 5 23 L 15

Segmentation Divide a process into unequal size blocks called segments There is a maximum segment length A logical address consists of two parts A segment number and an offset Since segments are not equal Segmentation is similar to dynamic partitioning 16

Address translation in segmentation Segment # Offset 0 0 0 1 0 0 1 0 1 1 1 1 0 0 0 0 Process Segment Table: 0 1 001011101110 011110011110 0000010000000000 0010000000100000 + Length Base Address 0 0 1 0 0 0 1 1 0 0 0 1 0 0 0 0 Physical Address 17