What virtual memory is

Virtual memory is all about making use of address space.

The address space of a processor refers the range of possible addresses that it can use when loading and storing to memory. The address space is limited by the width of the registers, since as we know to load an address we need to issue a load instruction with the address to load from in a register. Most current processors have registers that are 32 bits wide; this means the addresses that can be stored in a register range from 0x00000000 to 0xFFFFFFF. 2^32 is equal to 4GB, so a 32 bit processor can load or store to up to 4GB of memory.

64 bit computing

Most new processors are moving towards 64 bit processors, which have registers 64 bits wide. As an exercise, you should work out the address space available to these processors (hint: it's big!).

Using the address space

As with most components of the operating system, virtual memory acts as an abstraction between the address space and the physical memory available in the system. This means that when a program uses an address that address does not refer to the bits in an actual physical location in memory, but must be translated by the operating system.

So to this end, we say that all addresses the program uses are virtual. The operating system keeps track of virtual addresses and how they point to physical address. When a program does a load or store from an address, the processor and operating system work together to convert this virtual address to the actual address in the system memory chips.