Semester 3Operating Systems
Address Binding
1. Compile-time (static) binding
- The compiler knows the exact address where the program will be loaded, so it emits absolute code with fully resolved addresses.
- Fast — no translation at load or run time.
- Fragile: if the load address changes (e.g., another process occupies it), the program must be recompiled.
- Classic example: MS-DOS
.COMfiles. Rarely used in general-purpose OSes today.
2. Load-time binding
- The compiler produces relocatable code with addresses relative to the program start.
- A relocating loader adds the load base address as the program is brought into memory.
- Simple and flexible at load time, but once loaded the process cannot be moved — the binding is permanent for the process lifetime.
3. Execution-time (dynamic/runtime) binding
- Address translation is deferred until the instruction actually executes.
- The CPU's MMU adds a hardware relocation (base) register value to each logical address; a limit register bounds it.
- Because translation happens on every access, the process can be moved during execution — this is what enables swapping, paging, segmentation, and virtual memory.
- Requires hardware support; used by essentially all modern OSes.
| Method | When bound | Movable after load? | Hardware support | Example |
|---|---|---|---|---|
| Compile-time | Compile | No | None | DOS .COM |
| Load-time | Load | No | None (loader does it) | Early simple loaders |
| Execution-time | Run | Yes | MMU + base/limit regs | Linux/Windows/macOS |