Introduction to Paging. Readings r 4.3 of the text book.

Slides:



Advertisements
Similar presentations
Memory.
Advertisements

Allocating Memory.
CS 311 – Lecture 21 Outline Memory management in UNIX
Day 20 Memory Management. Assumptions A process need not be stored as one contiguous block. The entire process must reside in main memory.
Memory Management Design & Implementation Segmentation Chapter 4.
Chapter 7 Memory Management
1 Memory Management Virtual Memory Chapter 4. 2 The virtual memory concept In a multiprogramming environment, an entire process does not have to take.
Chapter 91 Translation Lookaside Buffer (described later with virtual memory) Frame.
A. Frank - P. Weisberg Operating Systems Simple/Basic Paging.
Chapter 7 Memory Management
Virtual Memory Chantha Thoeun. Overview  Purpose:  Use the hard disk as an extension of RAM.  Increase the available address space of a process. 
Memory Management Ch.8.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 346, Royden, Operating System Concepts Operating Systems Lecture 24 Paging.
Operating System Chapter 7. Memory Management Lynn Choi School of Electrical Engineering.
Example of a Resource Allocation Graph CS1252-OPERATING SYSTEM UNIT III1.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 32 Paging Read Ch. 9.4.
Paging Examples Assume a page size of 1K and a 15-bit logical address space. How many pages are in the system?
Operating Systems Chapter 8
Chapter 8 Memory Management Dr. Yingwu Zhu. Outline Background Basic Concepts Memory Allocation.
8.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Chapter 08 Main Memory (Page table questions)
8.4 paging Paging is a memory-management scheme that permits the physical address space of a process to be non-contiguous. The basic method for implementation.
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-8 Memory Management (2) Department of Computer Science and Software.
Lecture 11 Page 1 CS 111 Online Memory Management: Paging and Virtual Memory CS 111 On-Line MS Program Operating Systems Peter Reiher.
8.1 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Paging Physical address space of a process can be noncontiguous Avoids.
CGS 3763 Operating Systems Concepts Spring 2013 Dan C. Marinescu Office: HEC 304 Office hours: M-Wd 11: :30 AM.
1 Memory Management (b). 2 Paging  Logical address space of a process can be noncontiguous; process is allocated physical memory whenever the latter.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Virtual Memory Hardware.
Paging Paging is a memory-management scheme that permits the physical-address space of a process to be noncontiguous. Paging avoids the considerable problem.
Copyright ©: Nahrstedt, Angrave, Abdelzaher, Caccamo 1 Memory management & paging.
Page Table Implementation. Readings r Silbershatz et al:
Chapter 8: Main Memory. 8.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 22, 2005 Memory and Addressing It all starts.
8.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Fragmentation External Fragmentation – total memory space exists to satisfy.
Silberschatz, Galvin and Gagne  Operating System Concepts Paging Logical address space of a process can be noncontiguous; process is allocated.
CGS 3763 Operating Systems Concepts Spring 2013 Dan C. Marinescu Office: HEC 304 Office hours: M-Wd 11: :30 AM.
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.
Main Memory: Paging and Segmentation CSSE 332 Operating Systems Rose-Hulman Institute of Technology.
COMP 3500 Introduction to Operating Systems Paging: Basic Method Dr. Xiao Qin Auburn University Slides.
MEMORY MANAGEMENT. memory management  In a multiprogramming system, in order to share the processor, a number of processes must be kept in memory. 
Virtual Memory (Section 9.3). The Need For Virtual Memory Many computers don’t have enough memory in RAM to accommodate all the programs a user wants.
COMP 3500 Introduction to Operating Systems Memory Management: Part 2 Dr. Xiao Qin Auburn University Slides.
Basic Paging (1) logical address space of a process can be made noncontiguous; process is allocated physical memory whenever the latter is available. Divide.
Memory Management By: Piyush Agarwal ( ) Akashdeep ( )
Memory Management.
Non Contiguous Memory Allocation
Outline Paging Swapping and demand paging Virtual memory.
COMBINED PAGING AND SEGMENTATION
Chapter 8: Main Memory Source & Copyright: Operating System Concepts, Silberschatz, Galvin and Gagne.
Day 19 Memory Management.
Paging Examples Assume a page size of 1K and a 15-bit logical address space. How many pages are in the system?
Paging and Segmentation
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy 11/12/2018.
Operating System Concepts
Memory Management 11/17/2018 A. Berrached:CS4315:UHD.
Paging Lecture November 2018.
So far… Text RO …. printf() RW link printf Linking, loading
Main Memory Background Swapping Contiguous Allocation Paging
Lecture 32 Syed Mansoor Sarwar
Virtual Memory Hardware
Main Memory Session - 16.
Lecture 3: Main Memory.
CSE451 Memory Management Introduction Autumn 2002
So far in memory management…
Operating System Chapter 7. Memory Management
Chapter 8: Memory Management strategies
Segmentation Observation: Programmers don’t think in pages!
Paging Memory Relocation and Fragmentation Paging
COMP755 Advanced Operating Systems
Page Main Memory.
Presentation transcript:

Introduction to Paging

Readings r 4.3 of the text book

Outline r Introduction to Paging Concepts

Paging r Partition memory into small equal-size chunks and divide each process into the same size chunks r The chunks of a process are called pages and chunks of memory are called frames r Operating system maintains a page table for each process m Contains the frame location for each page in the process m Memory address consist of a page number and offset within the page

Page Example Process A Process B Frame Number A0 A1 A2 A3 B0 B1 B2

Paging r A program requires N free frames r There is a need to set up a page table to translate logical to physical addresses r Internal fragmentation

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

Address Translation Scheme r If the number of logical address bits is m and the number of bits in the offset is n then r Logical address space is 2 m r Page size (number of entries) is 2 n r Example: m = 4, n = 2 r Number of address is 16 r Number of entries in a page is 4

Paging Hardware The hardware is referred to as the memory management unit (MMU)

Paging Hardware r The CPU issues a logical address (remember that all addresses are binary) r The hardware extracts the page number, p, and the page offset d r The page number, p, is used to index the page table m The entry in the page table consists of the frame number, f r The actual address is the concatenation of the bits that make up f and d.

Paging Example m=4 n=2 Page size of 4 bytes Physical memory of 32 bytes (8 pages) Binary representations:

Paging Example r First a little reminder. All addresses are in bits. The example on the previous page gives the base 10 equivalent of binary numbers

Example r Logical address in binary form is 0000 m From the bits we extract the page number as 00 and the offset as 00 m Page number 00 corresponds to the first entry of the page table. m There we find that the corresponding frame is 5 (or 0101) m The physical address produced is the concatenation of the bits of the frame number and the offset m In base 10 we find that the physical address is 20 (5*4+0)

Example r Logical address in binary form is 0101 m From the bits we extract the page number as 01 and the offset as 00 m Page number 01 corresponds to the second entry of the page table. m There we find that the corresponding frame is 6 (or 0110) m The physical address produced is the concatenation of the bits of the frame number and the offset m In base 10 we find that the physical address is 24(6*4+0) r What do you think logical address 13 maps to?

Observations r Let’s look at logical addresses: m 0000 (0), 0001 (1), 0010(2) and 0011(3) m The first two bits (page number) are the same m This means that these logical addresses will be in the same frame. m The position in the frame is determined by the offset r For a process its pages can be in any order m For our example page 1 is in a frame that appears “later” than the frame associated with page 2

Observations r The logical address space and the physical address space DO NOT have to be the same size r The logical address space can be larger then the physical address space (more on this later)

Paging r No external fragmentation m Any free frame can be allocated to a process that needs it r There may be some internal fragmentation m The memory requirements may not coincide with page boundaries m The last frame allocated may not be completely full

Paging r Internal fragmentation is on average one half page per process r Larger page sizes means more wasted space r Smaller page sizes means larger tables

Summary r This section introduced the concept of paging in memory