Memory Management Paging &Segmentation CS311, CS350 & CS550.

Slides:



Advertisements
Similar presentations
Chapter 4 Memory Management 4.1 Basic memory management 4.2 Swapping
Advertisements

Chapter 3 Memory Management
Memory Management.
Chapter 4 Memory Management Page Replacement 补充:什么叫页面抖动?
Chapter 4 Memory Management 4.1 Basic memory management 4.2 Swapping
MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 3 Memory Management Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
1 Virtual Memory Management B.Ramamurthy. 2 Demand Paging Main memory LAS 0 LAS 1 LAS 2 (Physical Address Space -PAS) LAS - Logical Address.
CSC 322 Operating Systems Concepts Lecture - 18: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
CS 333 Introduction to Operating Systems Class 12 - Virtual Memory (2) Jonathan Walpole Computer Science Portland State University.
CS 333 Introduction to Operating Systems Class 12 - Virtual Memory (2) Jonathan Walpole Computer Science Portland State University.
Chapter 8.3: Memory Management
Memory Management (II)
1 Pertemuan 16 Isu-Isu pada Sistem Paging dan Segmentasi Matakuliah: T0316/sistem Operasi Tahun: 2005 Versi/Revisi: 5.
Informationsteknologi Friday, November 16, 2007Computer Architecture I - Class 121 Today’s class Operating System Machine Level.
Chapter 3.2 : Virtual Memory
Memory Management (continued) CS-3013 C-term Memory Management CS-3013 Operating Systems C-term 2008 (Slides include materials from Operating System.
Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved The Operating System Machine.
Virtual Memory Management B.Ramamurthy. Paging (2) The relation between virtual addresses and physical memory addres- ses given by page table.
1 Virtual Memory Management B.Ramamurthy Chapter 10.
Chapter 4 Memory Management 4.1 Basic memory management 4.2 Swapping
Chapter 3 Memory Management 3.7 Segmentation. A compiler has many tables that are built up as compilation proceeds, possibly including: The source text.
Segmentation CS 537 – Introduction to Operating Systems.
Memory Management Page replacement algorithms, segmentation Tanenbaum, ch. 3 p Silberschatz, ch. 8, 9 p
Memory Management From Chapter 4, Modern Operating Systems, Andrew S. Tanenbaum.
Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved OPERATING SYSTEMS DESIGN.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 8: Main Memory.
Cosc 3P92 Week 9 & 10 Lecture slides
Segmentation & O/S Input/Output Chapter 4 & 5 Tuesday, April 3, 2007.
Memory Management 3 Tanenbaum Ch. 3 Silberschatz Ch. 8,9.
1 Chapter 3.2 : Virtual Memory What is virtual memory? What is virtual memory? Virtual memory management schemes Virtual memory management schemes Paging.
1 Chapter 2: Computer-System Structures  Computer System Operation  I/O Structure  Storage Structure  Storage Hierarchy  Hardware Protection  General.
Page 110/20/2015 CSE 30341: Operating Systems Principles So far…  Page  Fixed size pages solve page allocation problem (and external fragmentation) 
1 Memory Management 4.1 Basic memory management 4.2 Swapping 4.3 Virtual memory 4.4 Page replacement algorithms 4.5 Modeling page replacement algorithms.
CS 149: Operating Systems March 3 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak
Chapter 4 Memory Management Virtual Memory.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 9: Virtual Memory.
Chapter 4 Memory Management Segmentation. (a) One address space. (b) Separate I and D spaces. Separate Instruction and Data Spaces.
操作系统原理 OPERATING SYSTEM Chapter 3 Memory Management 内存管理.
Page Replacement Implementation Issues Text: –Tanenbaum ch. 4.7.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
1 Memory Management Chapter Basic memory management 4.2 Swapping 4.3 Virtual memory 4.4 Page replacement algorithms 4.5 Modeling page replacement.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 9: Virtual-Memory Management.
1 Memory Management Adapted From Modern Operating Systems, Andrew S. Tanenbaum.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 8: Main Memory.
Chapter 8: Memory Management. 8.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 8: Memory Management Background Swapping Contiguous.
8.1 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Example: The Intel 32 and 64-bit Architectures Dominant industry chips.
1.1 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 1: Introduction What Operating Systems Do √ Computer-System Organization.
Memory Management Chapter 3
MODERN OPERATING SYSTEMS Third Edition ANDREW S
Memory Management Paging (continued) Segmentation
Session 3 Memory Management
Chapter 9: Virtual Memory
Modeling Page Replacement Algorithms
x86 segmentation, page tables, and interrupts
Page Replacement Implementation Issues
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
CS 286: Memory Paging and Virtual Memory
2P13 Week 2.
Chapter 4 Memory Management 4.1 Basic memory management 4.2 Swapping
Chapter 9: Virtual-Memory Management
Page Replacement.
Memory Management Paging (continued) Segmentation
MICROPROCESSOR MEMORY ORGANIZATION
The Operating System Machine Level
Page Replacement Implementation Issues
Modeling Page Replacement Algorithms
Memory management, part 3: outline
Chapter 4: Memory Management
Lecture 37 Syed Mansoor Sarwar
Memory Management Paging (continued) Segmentation
Presentation transcript:

Memory Management Paging &Segmentation CS311, CS350 & CS550

CS552 Implementation Issues in Paging Four times when OS involved with paging 1. Process creation  determine program’s resident-set size  create page table 2. Process execution  MMU reset for new process  TLB flushed 3. Page fault time  determine (virtual) address causing fault  swap target page out, needed page in 4. Process termination time  release page table, pages 2

CS552 Page Fault Handling (1) 1. Hardware traps to kernel, t1 is interrupted 2. Mode switch into kernel: Privilege mode ON, Interrupts OFF, Protection OFF 3. General (users) registers saved 4. OS determines which (virtual) page needed 5. OS checks validity of (virtual) address 6. OS Seeks target/victim; if victim dirty, then write it to disk 7. OS schedules I/O request for new page from disk 8. OS dispatches another task (t n ), while waiting 9. Page-in I/O completes, t2 registers saved 10. Page tables updated 11. Faulting instruction backed up to when it began 12. Faulting process scheduled 13. Registers restored 14. Program (t1) continues 3

CS552 Locking Pages in Memory  (Virtual) memory and I/O occasionally interact  Proc issues call for read from device into buffer  while waiting for I/O, another processes starts up  has a page fault  buffer for the first proc may be chosen to be paged out  Need to specify some pages locked  exempted from being target pages 4

CS552 Separation of Policy and Mechanism Page fault handling with an external pager 5

CS552 Segmentation (Pt1)  One-dimensional address space with growing tables  One table may bump into another (solution?) 6

CS552 Segmentation (Pt2) Allows each table to grow or shrink, independently 7

CS552 Segmentation (Pt3) Comparison of paging and segmentation 8

CS552 Implementation of Pure Segmentation (a)-(d) Development of checkerboarding (external fragmentation) (e) Removal of the checkerboarding by compaction 9

CS552 Segmentation with Paging: MULTICS (Pt1)  Descriptor segment points to page tables  Segment descriptor – numbers are field lengths 10

CS552 Segmentation with Paging: MULTICS (Pt2) Conversion of a 2-part MULTICS address into a main memory address 11

CS552 Segmentation with Paging: Pentium (Pt1) A Pentium selector GDT = Global Descriptor Table LDT = Local Descriptor Table Similar to MULTICS, but addresses a number of different design goals  Code segment descriptor  Data segments differ slightly 12

CS552 Segmentation with Paging: Pentium (Pt2) Conversion of a (selector, offset) pair to a linear address 13

CS552 Segmentation with Paging: Pentium (Pt3) Mapping of a linear address onto a physical address 14

CS552 Segmentation with Paging: Pentium (Pt4) Protection on the Pentium Level 15

CS552 References  Chapters 8 and 9 :OS Concepts, Silberschatz, Galvin, Gagne  Chapter 4: Modern Operating Systems, Andrew S. Tanenbaum  X86 architecture   Memory segment   Memory model   IA-32 Intel Architecture Software Developer’s Manual, Volume 1: Basic Architecture  16