How operating systems manage memory
Understand logical and physical addresses, memory protection, and when address binding takes place.
Read the Korean original on Velog ↗English translation

A program sees memory as an address space, but the timing of address assignment and the placement of data in physical memory are more complicated. Tracing address binding before and during execution helps make that relationship clearer.
Processes and memory
Memory management is central to system performance and stability.
Processes
A process is a running program, including its code, data, and execution state, such as register values and the program counter. Each process needs memory to run, and its memory must be protected from other processes.
Memory
Main memory provides fast storage for executing code and data. The operating system allocates, releases, and distributes it among processes.
Protecting memory regions
A process must not access memory outside its assigned region. Base and limit registers illustrate a simple approach to protection and address translation.
Base register
Stores the starting address of the process's memory region.
Limit register
Defines the size or boundary of the region the process may access.

How protection works
An out-of-range access triggers a trap. Control passes to the operating system, which saves the relevant process state and handles the fault. Depending on the situation, it may terminate the process or report an error.
Process control block (PCB) A PCB stores process information such as the program counter, CPU registers, scheduling data, and memory-management state. Base and limit register values are part of that state.
Memory addresses
A memory address identifies a location. It is useful to distinguish logical addresses from physical addresses.
Logical addresses
Addresses used by a process within its own address space to refer to data and instructions.
Physical addresses
Addresses identifying actual locations in physical memory.
Address binding
Address binding associates a program's addresses with locations in memory. It can take place at different stages.
Compile-time binding
If the execution location is known in advance, addresses can be fixed during compilation. Changing the starting location requires recompilation.
Load-time binding
The final location is chosen when the program is loaded. The compiler does not need to know its physical starting address, and the loader adjusts addresses for the selected location.
Execution-time binding
Addresses are translated while the program runs. In a virtual-memory system, the program uses virtual addresses and the memory management unit translates them into physical addresses.

Memory management unit
The MMU is hardware responsible for address translation between the CPU and main memory. It lets processes operate in separate virtual address spaces while their data occupies physical memory.
