Chapter 91 Translation Lookaside Buffer (described later with virtual memory) Frame.

Slides:



Advertisements
Similar presentations
Memory.
Advertisements

Part IV: Memory Management
Memory Management Chapter 7.
Paging Hardware With TLB
4/14/2017 Discussed Earlier segmentation - the process address space is divided into logical pieces called segments. The following are the example of types.
Segmentation and Paging Considerations
Memory Management Operating Systems - Spring 2003 Gregory (Grisha) Chokler Ittai Abraham Zinovi Rabinovich.
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 (II)
Memory Management 2010.
Chapter 3.2 : Virtual Memory
Chapter 7: Main Memory CS 170, Fall Memory Management Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation.
03/22/2004CSCI 315 Operating Systems Design1 Virtual Memory Notice: The slides for this lecture have been largely based on those accompanying the textbook.
A. Frank - P. Weisberg Operating Systems Simple/Basic Paging.
Silberschatz, Galvin and Gagne  Operating System Concepts Segmentation Memory-management scheme that supports user view of memory. A program.
A. Frank - P. Weisberg Operating Systems Simple/Basic Segmentation.
Main Memory. Background Program must be brought (from disk) into memory and placed within a process for it to be run Main memory and registers are only.
03/17/2008CSCI 315 Operating Systems Design1 Virtual Memory Notice: The slides for this lecture have been largely based on those accompanying the textbook.
Memory Management Ch.8.
Chapter 8: Main Memory. 8.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 8: Memory Management Background Swapping Contiguous.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 346, Royden, Operating System Concepts Operating Systems Lecture 24 Paging.
CS 346 – Chapter 8 Main memory –Addressing –Swapping –Allocation and fragmentation –Paging –Segmentation Commitment –Please finish chapter 8.
Operating Systems Chapter 8
1 Memory Management Memory Management COSC513 – Spring 2004 Student Name: Nan Qiao Student ID#: Professor: Dr. Morteza Anvari.
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.
1 Chapter 3.2 : Virtual Memory What is virtual memory? What is virtual memory? Virtual memory management schemes Virtual memory management schemes Paging.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 34 Paging Implementation.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 9: Memory Management Background Swapping Contiguous Allocation Paging Segmentation.
Background Program must be brought into memory and placed within a process for it to be run. Input queue – collection of processes on the disk that are.
Chapter 8 – Main Memory (Pgs ). Overview  Everything to do with memory is complicated by the fact that more than 1 program can be in memory.
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-8 Memory Management (2) Department of Computer Science and Software.
8.1 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Paging Physical address space of a process can be noncontiguous Avoids.
8.1 Silberschatz, Galvin and Gagne ©2005 Operating System Principles Implementation of Page Table Page table is kept in main memory Page-table base.
CE Operating Systems Lecture 14 Memory management.
1 Memory Management (b). 2 Paging  Logical address space of a process can be noncontiguous; process is allocated physical memory whenever the latter.
1 Memory Management Chapter 7. 2 Memory Management Subdividing memory to accommodate multiple processes Memory needs to be allocated to ensure a reasonable.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming.  To allocate scarce memory.
9.1 Operating System Concepts Paging Example. 9.2 Operating System Concepts.
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.
CSC 360, Instructor Kui Wu Memory Management I: Main Memory.
Page Table Implementation. Readings r Silbershatz et al:
Memory Management. Background Memory consists of a large array of words or bytes, each with its own address. The CPU fetches instructions from memory.
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.
1 Memory Management n In most schemes, the kernel occupies some fixed portion of main memory and the rest is shared by multiple processes.
Chapter 8: Memory Management. 8.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 8: Memory Management Background Swapping Contiguous.
Chapter 7: Main Memory CS 170, Fall Program Execution & Memory Management Program execution Swapping Contiguous Memory Allocation Paging Structure.
W4118 Operating Systems Instructor: Junfeng Yang.
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.
Memory Management Chapter 7.
Basic Paging (1) logical address space of a process can be made noncontiguous; process is allocated physical memory whenever the latter is available. Divide.
Non Contiguous Memory Allocation
COMBINED PAGING AND SEGMENTATION
Simple/Basic Segmentation
Chapter 8: Main Memory Source & Copyright: Operating System Concepts, Silberschatz, Galvin and Gagne.
Day 19 Memory Management.
Paging and Segmentation
Operating System Concepts
Practice Six Chapter Eight.
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 8 11/24/2018.
Background Program must be brought into memory and placed within a process for it to be run. Input queue – collection of processes on the disk that are.
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 12/1/2018.
Lecture 3: Main Memory.
Chapter 8: Memory Management strategies
2P13 Week 7.
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 4/5/2019.
Operating Systems: Internals and Design Principles, 6/E
Virtual Memory 1 1.
Presentation transcript:

Chapter 91 Translation Lookaside Buffer (described later with virtual memory) Frame

Chapter 92 Page Tables and Virtual Memory  Page tables can be very large ( bit logical addresses today) If (only) 32 bits are used (4GB) with 12 bit offset (4KB pages), a page table may have 2^{20} (1M) entries. Every entry will be at least several bytes.  The entire page table can take up a lot of main memory.  We may have to use a 2-level (or more) structure for the page table itself.

Chapter 93 Multilevel Page Tables  With a 2 level page table (386, Pentium), the page number is split into two numbers p1 and p2  p1 indexes the outer page table (directory) in main memory whose entries point to a page containing page table entries for some range of virtual memory  The second level entry is indexed by p2.  Except for the directory (outer table), page tables entries can be swapped in and out as needed

Chapter 94 Inverted Page Table One entry per FRAME rather than one per PAGE Search for matching page #

Chapter 95 Sharing Pages  Several users can share one copy of the same program  Shared code must be reentrant (non self- modifying) so that more than one process can execute the same code  With paging, each process will have a page table with entries pointing to the same code frames only one copy of each page is actually in a frame in main memory  Each user also needs to have its own private data pages

Chapter 96 Sharing Pages: a Text Editor

Chapter 97 Segmentation  Processes actually consist of logical parts (segments), such as: one or more executable segments one or more data segments stack segment  Another idea: make allocation more flexible by loading segments independently.

Chapter 98 Segmentation  Divide each program into unequal size blocks called segments  When a process is loaded into main memory, its individual segments can be located anywhere  The methods for allocating memory to segments are those we have seen so far: just replace process by segment  Because segments are of unequal size, this is similar to dynamic partitioning (at the segment level).

Chapter 99 Logical address used in simple segmentation with dynamic partitioning  We need a segment table for each process, containing: the starting physical address of that segment. the length of that segment (for protection)  A CPU register holds the starting address of the the segment table  Given a logical address (segment, offset) = (s,d), we access the s th entry in the segment table to get base physical address k and the length l of that segment  The physical address is obtained by adding d to k the hardware also compares the offset d with the length l to determine if the address is valid

Chapter 910 Address Translation in Segmentation (See also Figure 9.18) Disp = d

Chapter 911 Logical-to-Physical Address Translation in Segmentation displacement

Chapter 912 Sharing in Segmentation Systems  The segment tables of 2 different processes can point to the same physical locations  Example: one shared copy of the the code segment for the text editor  Each user still needs its own private data segment è more logical than sharing pages

Chapter 913 Segment Sharing: Text Editor Example

Chapter 914 Evaluation of Simple Segmentation  Advantage: memory allocation unit is a logically natural view of program Segments can be loaded individually on demand (dynamic linking). Natural unit for protection purposes No internal fragmentation  Disadvantage: same problems as dynamic partitioning. External fragmentation Unlike paging, it is not transparent to programmer No simple relationship between logical and physical address

Chapter 915 Combined Segmentation and Paging  Combines advantages of both  Several combinations exist. Example: Each process has:  one segment table  one page table per segment Virtual address consists of:  segment number: index the segment table to get starting address of the page table for that segment  page number: index that page table to obtain the physical frame number  offset: to locate the word within the frame  Segment and page tables can themselves be paged

Chapter 916 Address Translation in Combined Segmentation/Paging System (see also Fig 9.21)

Chapter 917 Advantages of Segmentation + Paging  Solves problems of both loading and linking. Linking a new segment amounts to adding a new entry to a segment table  Segments can grow without having to be moved in physical memory (just map more pages!)  Protection and sharing can be done at the ‘logical’ segment level.