Ex6 6
Ex6 6
1 2
3 4
1
Dynamic Relocation Using a
Memory-Management Unit (MMU) Relocation Register
• Hardware device that maps virtual to physical
address
2
HW Address Protection with Base and Contiguous Allocation (Cont.)
Limit Registers • Multiple-partition allocation
Logical +
relocation – 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 8 process 10
3
Paging Model of Logical and
Paging Hardware
Physical Memory
19 20
4
Paging Hardware With TLB Memory Protection
• Memory protection implemented by associating
protection bit with each frame.
• Hierarchical Paging
29 30
5
Hierarchical Page Tables Two-Level Page-Table Scheme
• Break up the logical address space into
multiple page tables.
31 32
12 10 10
where p1 is an index into the outer page table, and p2 is the
displacement within the page of the outer page table 33 34
35 36
6
Hashed Page Table Inverted Page Table
• One entry for each real page of memory.
• Entry consists of the virtual address of the page
stored in that real memory location, with
information about the process that owns that
page.
• Decreases memory needed to store each page
table, but increases time needed to search the
table when a page reference occurs.
• Use hash table to limit the search to one — or at
37
most a few — page-table entries. 38
4
1
3 2
4
41 42
7
Segmentation Architecture Segmentation Architecture - Cont.
• Logical address consists of a two tuple:
<segment-number, offset>, • Protection
• Segment table – maps two-dimensional physical – With each entry in segment table associate:
addresses; each table entry has: • validation bit = 0 ⇒ illegal segment
– base – contains the starting physical address where the • read/write/execute privileges
segments reside in memory • Protection bits associated with segments; code
– limit – specifies the length of the segment sharing occurs at segment level.
• Segment-table base register (STBR) points to the • Since segments vary in length, memory allocation is
segment table’s location in memory a dynamic storage-allocation problem.
• Segment-table length register (STLR) indicates
number of segments used by a program;
segment number s is legal if s < STLR 43 44
45 46