Lecture9_opsys
Lecture9_opsys
3
Relocation
• When program loaded into memory the actual (absolute) memory
locations are determined
• A process may occupy different partitions which means different
absolute memory locations during execution
• Swapping
• Compaction
Addresses
• Logical
• Reference to a memory location independent of the
current assignment of data to memory.
• Relative
• Address expressed as a location relative to some known
point.
• Physical or Absolute
• The absolute address or actual location in main memory.
Relocation
17
Virtual Memory
Key points in
Memory Management
1) Memory references are logical addresses dynamically translated into
physical addresses at run time
• A process may be swapped in and out of main memory occupying different
regions at different times during execution
2) A process may be broken up into pieces that do not need to located
contiguously in main memory
• Two characteristics of paging and segmentation are the keys to this
breakthrough in memory management:
• 1. All memory references within a process are logical addresses that are
dynamically translated into physical addresses at run time. A process may
be swapped in and out of main memory occupying different regions of
main memory at different times during the course of execution.
• 2. A process may be broken up into a number of pieces (pages or segments)
and these pieces need not be contiguously located in main memory during
execution. The combination of dynamic run-time address translation and
the use of a page or segment table permits this.
Breakthrough in
Memory Management
• If both of those two characteristics are present,
• then it is not necessary that all of the pages or all of the segments of a
process be in main memory during execution.
• If the next instruction, and the next data location are in memory then
execution can proceed
• at least for a time
A Short History
• Before virtual memory was developed, computers had RAM and
secondary memory.
• Early computers used magnetic core memory for main memory and
magnetic drums for their secondary memory. Computer memory was
expensive and usually in short supply back in the 1940s and 1950s.
30
Page Tables
• Page tables are also stored in virtual memory
• When a process is running, part of its page table is in main memory
Two-level page Tables
Second-level page tables
Top-level
page table
32
Address Translation in a Two-Level
paging System
Hierarchical Page Table