Chapter 3 Memory Management 3.7 Segmentation. A compiler has many tables that are built up as compilation proceeds, possibly including: The source text.

Slides:



Advertisements
Similar presentations
Memory.
Advertisements

Chapter 3 Memory Management
Chapter 4 Memory Management 4.1 Basic memory management 4.2 Swapping
Memory Management Paging &Segmentation CS311, CS350 & CS550.
MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 3 Memory Management Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
MODERN OPERATING SYSTEMS Third Edition ANDREW S
Paging Hardware With TLB
CSC 322 Operating Systems Concepts Lecture - 18: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved Processes Figure 1-5.
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.
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)
Chapter 1 Introduction
1 Pertemuan 16 Isu-Isu pada Sistem Paging dan Segmentasi Matakuliah: T0316/sistem Operasi Tahun: 2005 Versi/Revisi: 5.
Chapter 3.2 : Virtual Memory
Chapter 3 Memory Management
Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved The Operating System Machine.
Chapter 2 Processes and Threads Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved
Memory management, part 3: outline
1 Virtual Memory Sample Questions Project 3 – Build Pthread Lib Extra Office Hour: Wed 4pm-5pm HILL 367 Recitation 6.
Virtual Memory:Part 2 Kashyap Sheth Kishore Putta Bijal Shah Kshama Desai.
File System Implementation
Chapter 91 Translation Lookaside Buffer (described later with virtual memory) Frame.
Memory Management 2 Tanenbaum Ch. 3 Silberschatz Ch. 8,9.
A. Frank - P. Weisberg Operating Systems Simple/Basic Segmentation.
CS 333 Introduction to Operating Systems Class 12 - Virtual Memory (2) Jonathan Walpole Computer Science Portland State University.
Virtual Memory  Early computers had a small and fixed amount to memory. All programs had to be able to fit in this memory. Overlays were used when the.
Operating System Machine Level  An operating system is a program that, from the programmer’s point of view, adds a variety of new instructions and features,
MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 11 Case Study 2: Windows Vista Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
CS333 Intro to Operating Systems Jonathan Walpole.
Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved OPERATING SYSTEMS DESIGN.
Cosc 3P92 Week 9 & 10 Lecture slides
Segmentation & O/S Input/Output Chapter 4 & 5 Tuesday, April 3, 2007.
Cosc 2150: Computer Organization Chapter 6, Part 2 Virtual Memory.
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.
MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 1 Introduction Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc.
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.
Paging Example What is the data corresponding to the logical address below:
ITFN 2601 Introduction to Operating Systems Lecture 16 Segmentation.
8.1 Silberschatz, Galvin and Gagne ©2005 Operating System Principles Implementation of Page Table Page table is kept in main memory Page-table base.
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.
Chapter 4 Memory Management Segmentation. (a) One address space. (b) Separate I and D spaces. Separate Instruction and Data Spaces.
9.1 Operating System Concepts Paging Example. 9.2 Operating System Concepts.
操作系统原理 OPERATING SYSTEM Chapter 3 Memory Management 内存管理.
Page Replacement Implementation Issues Text: –Tanenbaum ch. 4.7.
1 Memory Management Chapter Basic memory management 4.2 Swapping 4.3 Virtual memory 4.4 Page replacement algorithms 4.5 Modeling page replacement.
 Segmentation  Case studies o MULTICS o Pentium o Unix o Linux o Windows Memory management, part 3: outline 1 Operating Systems, 2015, Danny Hendler,
Memory Management Chapter 3
MODERN OPERATING SYSTEMS Third Edition ANDREW S
Memory Management Paging (continued) Segmentation
Session 3 Memory Management
COMBINED PAGING AND SEGMENTATION
Simple/Basic Segmentation
Page Replacement Implementation Issues
Chapter 8: Main Memory.
Memory wrap-up: paging and segmentation File-System: Interface
Segmentation Lecture November 2018.
Memory Management Paging (continued) Segmentation
The Operating System Machine Level
Page Replacement Implementation Issues
Memory management, part 3: outline
Main Memory Session - 16.
Lecture 3: Main Memory.
Memory Management Paging (continued) Segmentation
CSE 542: Operating Systems
Presentation transcript:

Chapter 3 Memory Management 3.7 Segmentation

A compiler has many tables that are built up as compilation proceeds, possibly including: The source text being saved for the printed listing (on batch systems). The symbol table – the names and attributes of variables. The table containing integer, floating-point constants used. The parse tree, the syntactic analysis of the program. The stack used for procedure calls within the compiler. Segmentation (1) Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Figure In a one-dimensional address space with growing tables, one table may bump into another. Segmentation (2) Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Figure A segmented memory allows each table to grow or shrink independently of the other tables. Segmentation (3) Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Figure Comparison of paging and segmentation. Implementation of Pure Segmentation Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Figure (a)-(d) Development of checkerboarding. (e) Removal of the checkerboarding by compaction. Segmentation with Paging: MULTICS (1) Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Figure The MULTICS virtual memory. (a) The descriptor segment points to the page tables. Segmentation with Paging: MULTICS (2) Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Figure The MULTICS virtual memory. (b) A segment descriptor. The numbers are the field lengths. Segmentation with Paging: MULTICS (5) Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

When a memory reference occurs, the following algorithm is carried out: The segment number used to find segment descriptor. Check is made to see if the segment’s page table is in memory. –If not, segment fault occurs. –If there is a protection violation, a fault (trap) occurs. Segmentation with Paging: MULTICS (6) Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Page table entry for the requested virtual page examined. –If the page itself is not in memory, a page fault is triggered. –If it is in memory, the main memory address of the start of the page is extracted from the page table entry The offset is added to the page origin to give the main memory address where the word is located. The read or store finally takes place. Segmentation with Paging: MULTICS (7) Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Figure A 34-bit MULTICS virtual address. Segmentation with Paging: MULTICS (8) Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Figure Conversion of a two-part MULTICS address into a main memory address. Segmentation with Paging: MULTICS (9) Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Figure A simplified version of the MULTICS TLB. The existence of two page sizes makes the actual TLB more complicated. Segmentation with Paging: MULTICS (10) Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Figure A Pentium selector. Segmentation with Paging: The Pentium (1) Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Figure Pentium code segment descriptor. Data segments differ slightly. Segmentation with Paging: The Pentium (2) Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Figure Conversion of a (selector, offset) pair to a linear address. Segmentation with Paging: The Pentium (3) Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Figure Mapping of a linear address onto a physical address. Segmentation with Paging: The Pentium (4) Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Figure Protection on the Pentium. Segmentation with Paging: The Pentium (5) Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved