Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Background
Swapping
Contiguous Memory Allocation
Paging
Structure of the Page Table
Segmentation
Example: The Intel Pentium
perating System Concepts – 7th Edition, Feb 22, 2005 8.2 Silberschatz, Galvin and Gagne
Objectives
perating System Concepts – 7th Edition, Feb 22, 2005 8.3 Silberschatz, Galvin and Gagne
Background
perating System Concepts – 7th Edition, Feb 22, 2005 8.4 Silberschatz, Galvin and Gagne
Base and Limit Registers
A pair of base and limit registers define the logical
address space
perating System Concepts – 7th Edition, Feb 22, 2005 8.5 Silberschatz, Galvin and Gagne
Binding of Instructions and Data to
Memory
perating System Concepts – 7th Edition, Feb 22, 2005 8.6 Silberschatz, Galvin and Gagne
Multistep Processing of a User Program
perating System Concepts – 7th Edition, Feb 22, 2005 8.7 Silberschatz, Galvin and Gagne
Logical vs. Physical Address Space
perating System Concepts – 7th Edition, Feb 22, 2005 8.8 Silberschatz, Galvin and Gagne
Memory-Management Unit (MMU)
perating System Concepts – 7th Edition, Feb 22, 2005 8.9 Silberschatz, Galvin and Gagne
Dynamic relocation using a relocation
register
perating System Concepts – 7th Edition, Feb 22, 2005 8.10 Silberschatz, Galvin and Gagne
Dynamic Loading
perating System Concepts – 7th Edition, Feb 22, 2005 8.11 Silberschatz, Galvin and Gagne
Dynamic Linking
perating System Concepts – 7th Edition, Feb 22, 2005 8.12 Silberschatz, Galvin and Gagne
Swapping
perating System Concepts – 7th Edition, Feb 22, 2005 8.13 Silberschatz, Galvin and Gagne
Schematic View of Swapping
perating System Concepts – 7th Edition, Feb 22, 2005 8.14 Silberschatz, Galvin and Gagne
Contiguous Allocation
perating System Concepts – 7th Edition, Feb 22, 2005 8.15 Silberschatz, Galvin and Gagne
HW address protection with base and limit registers
perating System Concepts – 7th Edition, Feb 22, 2005 8.16 Silberschatz, Galvin and Gagne
Contiguous Allocation (Cont.)
Multiple-partition allocation
Hole – block of available memory; holes of various
size are scattered throughout memory
When a process arrives, it is allocated memory
from a hole large enough to accommodate it
Operating system maintains information about:
a) allocated partitions b) free partitions (hole)
OS OS OS OS
process process process process
5 5 5 5
process process
9 9
process process
8 10
perating System Concepts – 7th Edition, Feb 22, 2005 8.17 Silberschatz, Galvin and Gagne
Dynamic Storage-Allocation
Problem
perating System Concepts – 7th Edition, Feb 22, 2005 8.18 Silberschatz, Galvin and Gagne
Fragmentation
perating System Concepts – 7th Edition, Feb 22, 2005 8.19 Silberschatz, Galvin and Gagne
Paging
perating System Concepts – 7th Edition, Feb 22, 2005 8.20 Silberschatz, Galvin and Gagne
Address Translation Scheme
p d
m-n n
perating System Concepts – 7th Edition, Feb 22, 2005 8.21 Silberschatz, Galvin and Gagne
Paging Hardware
perating System Concepts – 7th Edition, Feb 22, 2005 8.22 Silberschatz, Galvin and Gagne
Paging Model of Logical and Physical
Memory
perating System Concepts – 7th Edition, Feb 22, 2005 8.23 Silberschatz, Galvin and Gagne
Paging Example
perating System Concepts – 7th Edition, Feb 22, 2005 8.25 Silberschatz, Galvin and Gagne
Implementation of Page Table
perating System Concepts – 7th Edition, Feb 22, 2005 8.26 Silberschatz, Galvin and Gagne
Associative Memory
perating System Concepts – 7th Edition, Feb 22, 2005 8.27 Silberschatz, Galvin and Gagne
Paging Hardware With TLB
perating System Concepts – 7th Edition, Feb 22, 2005 8.28 Silberschatz, Galvin and Gagne
Effective Access Time
perating System Concepts – 7th Edition, Feb 22, 2005 8.29 Silberschatz, Galvin and Gagne
Memory Protection
perating System Concepts – 7th Edition, Feb 22, 2005 8.30 Silberschatz, Galvin and Gagne
Valid (v) or Invalid (i) Bit In A Page
Table
perating System Concepts – 7th Edition, Feb 22, 2005 8.31 Silberschatz, Galvin and Gagne
Shared Pages
Shared code
One copy of read-only (reentrant) code shared
among processes (i.e., text editors, compilers,
window systems).
Shared code must appear in same location in
the logical address space of all processes
perating System Concepts – 7th Edition, Feb 22, 2005 8.32 Silberschatz, Galvin and Gagne
Shared Pages Example
perating System Concepts – 7th Edition, Feb 22, 2005 8.33 Silberschatz, Galvin and Gagne
Structure of the Page Table
Hierarchical Paging
perating System Concepts – 7th Edition, Feb 22, 2005 8.34 Silberschatz, Galvin and Gagne
Hierarchical Page Tables
perating System Concepts – 7th Edition, Feb 22, 2005 8.35 Silberschatz, Galvin and Gagne
Two-Level Page-Table Scheme
perating System Concepts – 7th Edition, Feb 22, 2005 8.36 Silberschatz, Galvin and Gagne
Two-Level Paging Example
1 1 1
where pi is an index into the outer page table, and p2 is the
displacement within the2 page0of the outer
0 page table
perating System Concepts – 7th Edition, Feb 22, 2005 8.37 Silberschatz, Galvin and Gagne
Address-Translation Scheme
perating System Concepts – 7th Edition, Feb 22, 2005 8.38 Silberschatz, Galvin and Gagne
Three-level Paging Scheme
perating System Concepts – 7th Edition, Feb 22, 2005 8.39 Silberschatz, Galvin and Gagne
Hashed Page Tables
perating System Concepts – 7th Edition, Feb 22, 2005 8.40 Silberschatz, Galvin and Gagne
Hashed Page Table
perating System Concepts – 7th Edition, Feb 22, 2005 8.41 Silberschatz, Galvin and Gagne
Inverted Page Table
perating System Concepts – 7th Edition, Feb 22, 2005 8.42 Silberschatz, Galvin and Gagne
Inverted Page Table Architecture
perating System Concepts – 7th Edition, Feb 22, 2005 8.43 Silberschatz, Galvin and Gagne
Segmentation
perating System Concepts – 7th Edition, Feb 22, 2005 8.44 Silberschatz, Galvin and Gagne
User’s View of a Program
perating System Concepts – 7th Edition, Feb 22, 2005 8.45 Silberschatz, Galvin and Gagne
Logical View of Segmentation
4
1
3 2
4
perating System Concepts – 7th Edition, Feb 22, 2005 8.46 Silberschatz, Galvin and Gagne
Segmentation Architecture
perating System Concepts – 7th Edition, Feb 22, 2005 8.47 Silberschatz, Galvin and Gagne
Segmentation Architecture (Cont.)
Protection
With each entry in segment table associate:
validation bit = 0 illegal segment
read/write/execute privileges
Protection bits associated with segments; code
sharing occurs at segment level
Since segments vary in length, memory
allocation is a dynamic storage-allocation
problem
A segmentation example is shown in the
following diagram
perating System Concepts – 7th Edition, Feb 22, 2005 8.48 Silberschatz, Galvin and Gagne
Segmentation Hardware
perating System Concepts – 7th Edition, Feb 22, 2005 8.49 Silberschatz, Galvin and Gagne
Example of Segmentation
perating System Concepts – 7th Edition, Feb 22, 2005 8.50 Silberschatz, Galvin and Gagne
Example: The Intel Pentium
Supports both segmentation and segmentation with
paging
CPU generates logical address
Given to segmentation unit
Which produces linear addresses
Linear address given to paging unit
Which generates physical address in main
memory
Paging units form equivalent of MMU
perating System Concepts – 7th Edition, Feb 22, 2005 8.51 Silberschatz, Galvin and Gagne
Logical to Physical Address Translation
in Pentium
perating System Concepts – 7th Edition, Feb 22, 2005 8.52 Silberschatz, Galvin and Gagne
Intel Pentium Segmentation
perating System Concepts – 7th Edition, Feb 22, 2005 8.53 Silberschatz, Galvin and Gagne
Pentium Paging Architecture
perating System Concepts – 7th Edition, Feb 22, 2005 8.54 Silberschatz, Galvin and Gagne
Linear Address in Linux
perating System Concepts – 7th Edition, Feb 22, 2005 8.55 Silberschatz, Galvin and Gagne
Three-level Paging in Linux
perating System Concepts – 7th Edition, Feb 22, 2005 8.56 Silberschatz, Galvin and Gagne
End of Chapter 8