Pages and Paging

As we already understand now, memory is among the most basic, yet essential resources of processes. Memory management includes responsibilities such as allocation, manipulation, and release of memory slots.

The address space of a program is all the memory slots that the operating system gave to that program to stores its variables in. The program, therefore, has legal access to these memory locations.

On modern computers, the CPU doesn't work with physical addresses, which are the actual addresses of memory slots in RAM. Instead, when looking at a program's code, the CPU sees this program's address space as the 'entire universe', without even being aware of the existence of other memory slots or other programs that run on that computer.

As such, the addresses the program uses (called logical addresses or virtual addresses) are different from physical memory addresses, so, to know where exactly we need to access main memory given a logical address, the CPU uses a software called the memory management unit (MMU) to covert each logical address to a physical address.