<aside>
💡
Summary of Section 7.1: Requirements for Efficient Memory Management
</aside>
Logical vs. Physical Memory
- Physical Memory (RAM):
- A linear sequence of words (fixed-size data units, e.g., 1, 2, or 4 bytes).
- Identified using physical addresses (range 0 to n-1).
- Logical Address Space:
- An abstraction allowing programs to run independently of actual memory locations.
- Uses logical addresses (range 0 to m-1), mapped to physical memory before execution.
Program Transformations
- Source Module: High-level program (e.g., C, Assembly).
- Object Module: Machine code output from the compiler/assembler.
- Load Module: Ready-to-execute program, created by the linker.
- Execution Process:
- Compilation → Linking → Loading → Execution.
Relocation and Address Binding
- Relocation: Moving a program between address spaces.
- Static Relocation:
- Logical addresses are mapped to physical addresses before execution.
- Dynamic Relocation:
- Addresses remain logical until they are accessed at runtime.
Dynamic Relocation Using Relocation Registers
- A relocation register stores the starting physical address of a program.
- Single relocation register: Shifts all addresses in a program uniformly.