Fall 2000M.B. Ibáñez Lecture 17 Paging Hardware Support.

Slides:



Advertisements
Similar presentations
Chapters 7 & 8 Memory Management Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College, Venice,
Advertisements

Chapter 8 Virtual Memory
OS Fall’02 Virtual Memory Operating Systems Fall 2002.
Segmentation and Paging Considerations
Chapter 8 Virtual Memory Operating Systems: Internals and Design Principles, 6/E William Stallings Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice.
Virtual Memory Management
Chapter 101 Virtual Memory Chapter 10 Sections and plus (Skip:10.3.2, 10.7, rest of 10.8)
OS Spring ‘04 Paging and Virtual Memory Operating Systems Spring 2004.
Virtual Memory Chapter 8.
Virtual Memory Chapter 8.
Memory Management (II)
Virtual Memory Chapter 8. Hardware and Control Structures Memory references are dynamically translated into physical addresses at run time –A process.
Lecture 11: Memory Management
Memory Management and Paging CSCI 3753 Operating Systems Spring 2005 Prof. Rick Han.
Paging and Virtual Memory. Memory management: Review  Fixed partitioning, dynamic partitioning  Problems Internal/external fragmentation A process can.
Memory Management 2010.
Virtual Memory Chapter 8.
1 Virtual Memory Chapter 8. 2 Hardware and Control Structures Memory references are dynamically translated into physical addresses at run time –A process.
Chapter 3.2 : Virtual Memory
1 Lecture 9: Virtual Memory Operating System I Spring 2007.
1 Chapter 8 Virtual Memory Virtual memory is a storage allocation scheme in which secondary memory can be addressed as though it were part of main memory.
Virtual Memory (Chapter 8) Memory Management is an intimate and complex interrelationship between processor hardware and operating system software. Paging.
Chapter 9 Virtual Memory Produced by Lemlem Kebede Monday, July 16, 2001.
Virtual Memory Chapter 8.
Computer Organization and Architecture
Virtual Memory I Chapter 8.
03/22/2004CSCI 315 Operating Systems Design1 Virtual Memory Notice: The slides for this lecture have been largely based on those accompanying the textbook.
Chapter 8 Virtual Memory
Virtual Memory Management
CS 241 Section Week #12 (04/22/10).
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 346, Royden, Operating System Concepts Operating Systems Lecture 24 Paging.
Lecture 21 Last lecture Today’s lecture Cache Memory Virtual memory
Operating Systems Chapter 8
Virtual Memory Chapter 8. Characteristics of Paging and Segmentation A process may be broken up into pieces (pages or segments) that do not need to be.
Topics covered: Memory subsystem CSE243: Introduction to Computer Architecture and Hardware/Software Interface.
Computer Architecture Lecture 28 Fasih ur Rehman.
CMP 301A Computer Architecture 1 Lecture 4. Outline zVirtual memory y Terminology y Page Table y Translation Lookaside Buffer (TLB)
Cosc 2150: Computer Organization Chapter 6, Part 2 Virtual Memory.
1 Chapter 3.2 : Virtual Memory What is virtual memory? What is virtual memory? Virtual memory management schemes Virtual memory management schemes Paging.
IT253: Computer Organization
Virtual Memory Chapter 8. Hardware and Control Structures Memory references are dynamically translated into physical addresses at run time –A process.
1 Virtual Memory Chapter 8. 2 Hardware and Control Structures Memory references are dynamically translated into physical addresses at run time –A process.
1 Virtual Memory Chapter 8. 2 Hardware and Control Structures Memory references are dynamically translated into physical addresses at run time –A process.
Memory Management Fundamentals Virtual Memory. Outline Introduction Motivation for virtual memory Paging – general concepts –Principle of locality, demand.
1 Virtual Memory Chapter 8. 2 Virtual memory concept Simple paging/ segmentation  pages or segments are loaded into frames that may not necessarily be.
Virtual Memory 1 1.
Virtual Memory Chapter 8. Hardware and Control Structures Memory references are dynamically translated into physical addresses at run time –A process.
Chapter 91 Logical Address in Paging  Page size always chosen as a power of 2.  Example: if 16 bit addresses are used and page size = 1K, we need 10.
Introduction: Memory Management 2 Ideally programmers want memory that is large fast non volatile Memory hierarchy small amount of fast, expensive memory.
Informationsteknologi Wednesday, October 3, 2007Computer Systems/Operating Systems - Class 121 Today’s class Memory management Virtual memory.
Lectures 8 & 9 Virtual Memory - Paging & Segmentation System Design.
1 Lecture 8: Virtual Memory Operating System Fall 2006.
Chapter 7: Main Memory CS 170, Fall Program Execution & Memory Management Program execution Swapping Contiguous Memory Allocation Paging Structure.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 33 Paging Read Ch. 9.4.
Virtual Memory Chapter 8.
Computer Organization
ITEC 202 Operating Systems
Day 20 Virtual Memory.
Chapter 8 Virtual Memory
Virtual Memory Chapter 8.
Lecture 10: Virtual Memory
Chapter 9 Virtual Memory
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 8 11/24/2018.
Computer Architecture
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 12/1/2018.
Virtual Memory فصل هشتم.
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 4/5/2019.
Operating Systems Concepts
Operating Systems: Internals and Design Principles, 6/E
Virtual Memory 1 1.
Presentation transcript:

Fall 2000M.B. Ibáñez Lecture 17 Paging Hardware Support

Fall 2000M.B. Ibáñez Characteristics of Paging and Segmentation Memory references are dynamically translated into physical addresses at run time –a process may be swapped in and out of main memory such that it occupies different regions A process may be broken up into pieces that do not need to located contiguously in main memory –All pieces of a process do not need to be loaded in main memory during execution From Operating Systems. Internals and Design Principles. W. Stalling. Prentice Hall.

Fall 2000M.B. Ibáñez Execution of a Program Operating system brings into main memory a few pieces of the program Resident set - portion of process that is in main memory An interrupt is generated when an address is needed that is not in main memory Operating system places the process in a blocking state From Operating Systems. Internals and Design Principles. W. Stalling. Prentice Hall.

Fall 2000M.B. Ibáñez Execution of a Program Piece of process that contains the logical address is brought into main memory –operating system issues a disk I/O Read request –another process is dispatched to run while the disk I/O takes place –an interrupt is issued when disk I/O complete which causes the operating system to place the affected process in the Ready state From Operating Systems. Internals and Design Principles. W. Stalling. Prentice Hall.

Fall 2000M.B. Ibáñez Advantages of Breaking up Process More processes may be maintained in main memory –only load in some of the pieces of each process With so many processes in main memory, it is very likely a process will be in the Ready state at any particular time It is possible for a process to be larger than all the main memory From Operating Systems. Internals and Design Principles. W. Stalling. Prentice Hall.

Fall 2000M.B. Ibáñez Advantages of Breaking up Processes Programmer is dealing with memory the size of the hard disk It would be wasteful to load in many pieces of the process when only a few pieces will be used Time can be saved because unused pieces are not swapped in and out of memory From Operating Systems. Internals and Design Principles. W. Stalling. Prentice Hall.

Fall 2000M.B. Ibáñez Types of Memory Real memory –main memory Virtual memory –memory on disk From Operating Systems. Internals and Design Principles. W. Stalling. Prentice Hall.

Fall 2000M.B. Ibáñez Principle of Locality Program and data references within a process tend to cluster Only a few pieces of a process will be needed over a short period of time Possible to make intelligent guesses about which pieces will be needed in the future This suggests that virtual memory may work efficiently From Operating Systems. Internals and Design Principles. W. Stalling. Prentice Hall.

Fall 2000M.B. Ibáñez Support Needed for Virtual Memory Hardware must support paging and segmentation Operating system must be able to management the movement of pages and/or segments between secondary memory and main memory From Operating Systems. Internals and Design Principles. W. Stalling. Prentice Hall.

Fall 2000M.B. Ibáñez Paging Each process has its own page table Each page table entry contains the frame number of the corresponding page in main memory A bit is needed to indicate whether the page is in main memory or not From Operating Systems. Internals and Design Principles. W. Stalling. Prentice Hall.

Fall 2000M.B. Ibáñez Paging Virtual Address Page Table Entry Page Number Offset PM Frame Number Other Control Bits From Operating Systems. Internals and Design Principles. W. Stalling. Prentice Hall.

Fall 2000M.B. Ibáñez Address Translation in a Paging System ProgramPagingMain Memory Virtual Address Register Page Table Page Frame Offset P# Frame # Page Table Ptr Page #OffsetFrame #Offset + From Operating Systems. Internals and Design Principles. W. Stalling. Prentice Hall.

Fall 2000M.B. Ibáñez Page Table Implemented as a set of dedicated Registers These registers should be built with very high-speed logic to make the paging address translation efficient. DEC PDP-11 is an example of such architecture. The address consists of 16 bits, and the page size is 8K. The page table consists of eight entries.

Fall 2000M.B. Ibáñez Page Table Kept in Main Memory Two items: –Page table in main memory –page-table base register (PTBR) points to the page table Problem: access(location i): –index into the page table using PTBR, we get the frame number –actual address = frame-number + page-offset Thus, memory access is slowed by factor of 2

Fall 2000M.B. Ibáñez Page Tables The entire page table may take up too much main memory Page tables are also stored in virtual memory When a process is running, part of its page table is in main memory From Operating Systems. Internals and Design Principles. W. Stalling. Prentice Hall.

Fall 2000M.B. Ibáñez Translation Look-aside Buffer (Associative Registers) Each virtual memory reference can cause two physical memory accesses –one to fetch the page table –one to fetch the data To overcome this problem a special cache is set up for page table entries –called the TLB - Translation Look-aside Buffer From Operating Systems. Internals and Design Principles. W. Stalling. Prentice Hall.

Fall 2000M.B. Ibáñez Translation Look-aside Buffer Contains page table entries that have been most recently used Works similar to main memory cache From Operating Systems. Internals and Design Principles. W. Stalling. Prentice Hall.

Fall 2000M.B. Ibáñez Translation Look-aside Buffer Given a virtual address, processor examines the TLB If page table entry is present (a hit), the frame number is retrieved and the real address is formed If page table entry is not found in the TLB (a miss), the page number is used to index the process page table From Operating Systems. Internals and Design Principles. W. Stalling. Prentice Hall.

Fall 2000M.B. Ibáñez Translation Look-aside Buffer First checks if page is already in main memory –if not in main memory a page fault is issued The TLB is updated to include the new page entry From Operating Systems. Internals and Design Principles. W. Stalling. Prentice Hall.

Fall 2000M.B. Ibáñez Translation Look-aside Buffer Each register consists of two parts: –A key –A value When the associative registers are presented with an item, –it is compared with all the keys simultaneously –If the item is found, the corresponding value field is output

Fall 2000M.B. Ibáñez Use of a Translation Look-aside Buffer Virtual Address Translation Lookaside Buffer Page Table TLB miss Page fault Real Address TLB hit Offset Main Memory Secondary Memory Load page Page #Offset Frame #Offset From Operating Systems. Internals and Design Principles. W. Stalling. Prentice Hall.

Fall 2000M.B. Ibáñez START CPU checks the TLB Page table entry in TLB? Access page table Page in main memory? Update TLB CPU generates Physical Address Yes No Yes Page fault handling routing No Operation of TLB