Lecture 28: Virtual Memory-Address Translation

Slides:



Advertisements
Similar presentations
Part IV: Memory Management
Advertisements

Memory Protection: Kernel and User Address Spaces  Background  Address binding  How memory protection is achieved.
Computer Organization CS224 Fall 2012 Lesson 44. Virtual Memory  Use main memory as a “cache” for secondary (disk) storage l Managed jointly by CPU hardware.
Lecture 34: Chapter 5 Today’s topic –Virtual Memories 1.
CS 153 Design of Operating Systems Spring 2015
CS 333 Introduction to Operating Systems Class 11 – Virtual Memory (1)
Memory Management and Paging CSCI 3753 Operating Systems Spring 2005 Prof. Rick Han.
Memory Management 2010.
Memory Management 1 CS502 Spring 2006 Memory Management CS-502 Spring 2006.
CSE378 Virtual memory.1 Evolution in memory management techniques In early days, single program ran on the whole machine –used all the memory available.
Memory Management ◦ Operating Systems ◦ CS550. Paging and Segmentation  Non-contiguous memory allocation  Fragmentation is a serious problem with contiguous.
Review of Memory Management, Virtual Memory CS448.
Computer Architecture Lecture 28 Fasih ur Rehman.
Operating Systems ECE344 Ding Yuan Paging Lecture 8: Paging.
Operating Systems COMP 4850/CISG 5550 Page Tables TLBs Inverted Page Tables Dr. James Money.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming  To allocate scarce memory resources.
CS399 New Beginnings Jonathan Walpole. Virtual Memory (1)
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming.  To allocate scarce memory.
1 Memory Management. 2 Fixed Partitions Legend Free Space 0k 4k 16k 64k 128k Internal fragmentation (cannot be reallocated) Divide memory into n (possible.
Virtual Memory The memory space of a process is normally divided into blocks that are either pages or segments. Virtual memory management takes.
Swap Space and Other Memory Management Issues Operating Systems: Internals and Design Principles.
4.3 Virtual Memory. Virtual memory  Want to run programs (code+stack+data) larger than available memory.  Overlays programmer divides program into pieces.
CS2100 Computer Organisation Virtual Memory – Own reading only (AY2015/6) Semester 1.
Virtual Memory Ch. 8 & 9 Silberschatz Operating Systems Book.
The Memory Hierarchy Lecture 31 20/07/2009Lecture 31_CA&O_Engr. Umbreen Sabir.
Memory Management memory hierarchy programs exhibit locality of reference - non-uniform reference patterns temporal locality - a program that references.
CS161 – Design and Architecture of Computer
Translation Lookaside Buffer
VIRTUAL MEMORY.
SLC/VER1.0/OS CONCEPTS/OCT'99
Memory Management Virtual Memory.
Chapter 8: Main Memory.
CS161 – Design and Architecture of Computer
Page Table Implementation
Some Real Problem What if a program needs more memory than the machine has? even if individual programs fit in memory, how can we run multiple programs?
Memory Management References text: Tanenbaum ch.4.
PA1 is out Best by Feb , 10:00 pm Enjoy early
CS510 Operating System Foundations
Virtual Memory Chapter 8.
Lecture 26: Memory Management - Swapping
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy 11/12/2018.
Memory Management 11/17/2018 A. Berrached:CS4315:UHD.
Lecture 25: Introduction to Memory Management
Lecture 27: Virtual Memory
Memory Management References text: Tanenbaum ch.4.
Operating Systems Lecture November 2018.
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 8 11/24/2018.
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 12/1/2018.
CS399 New Beginnings Jonathan Walpole.
Lecture 29: Virtual Memory-Address Translation
Introduction to the Intel x86’s support for “virtual” memory
Translation Lookaside Buffer
Morgan Kaufmann Publishers Memory Hierarchy: Virtual Memory
CSE 451: Operating Systems Autumn 2005 Memory Management
Translation Buffers (TLB’s)
CSE 451: Operating Systems Autumn 2003 Lecture 9 Memory Management
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 4/5/2019.
CSC3050 – Computer Architecture
CSE 451: Operating Systems Autumn 2003 Lecture 9 Memory Management
CSE 471 Autumn 1998 Virtual memory
Evolution in memory management techniques
Evolution in memory management techniques
Evolution in memory management techniques
Virtual Memory Use main memory as a “cache” for secondary (disk) storage Managed jointly by CPU hardware and the operating system (OS) Programs share main.
Virtual Memory.
4.3 Virtual Memory.
Virtual Memory 1 1.
Lecture 26: Memory Management - Swapping
Lecture 25: Introduction to Memory Management
Page Main Memory.
Presentation transcript:

Lecture 28: Virtual Memory-Address Translation

Review: Memory management for different systems Processes are known in advance and can fit in memory Embedded systems, e.g., radios, washing machines, and microwaves Processes are unknown in advance, memory might not be large enough Swapping Virtual memory

Review: Swapping Each individual process can fit in memory But memory cannot fit all processes Memory allocation/de-allocation Bitmap Linked list Dynamic address translation Base register in CPU Process isolation Limit register in CPU

Virtual memory What if a single process is larger than memory? Not all parts of the large process are equally possible to be used Put the parts that are less used in disk The process can still run Load a part from disk to memory when needed

Paging: Key idea of virtual memory Divide a program into fixed-size small parts Called virtual pages or pages Divide the memory into fixed-size small blocks Called page frames Load some pages into page frames

An example of paging 64K Virtual Address Space 32K Physical Memory Divided into 16 pages 4K for each page 32K Physical Memory 8 pages of 4K each

Problems in paging Address translation Page fault When a page that the process is trying to use is not in memory, hardware issues page fault Load in the page into a page frame Which page frame goes to disk? This is called page replacement problem

Address translation Process generates a “virtual address” Virtual address is translated into a physical address Physical address goes onto the bus

Address translation: Memory Management Unit (MMU)

Address translation via Page Table Page table is a data structure Each page has an entry in this page table The index of the page is used to find the entry in the page table Each entry stores various information about the page

Address translation via Page Table

Typical Page Table Entry Present/absent: 1 if the page is in memory Protection: what operations to the page are allowed Modified: 1 if the page is modified since it is loaded. Also called “dirty” bit Referenced: 1 if the page is read or written Caching disabled: 1 if disabling caching this page

Page Fault What if required page not in memory? MMU reports a page fault to CPU CPU gives control to the OS OS fetches it from the disk Needs to evict an existing page from memory (page replacement policy) Instruction is restarted

Performance The address translation is done on every memory reference The translation better be fast!

Question Where is the page table stored? Registers? Memory?

Store in registers Need many registers Context switching is slow

Store in memory One register to store the start address of the page table Context switching is fast May do paging for the page table itself. Store some page entries in disk if the page table is too large.