The model
A program file is a persistent description of code and data; a process is a running instance with execution state and an address space. The operating system gives a process a virtual view of memory, while hardware and the kernel translate that view to physical resources under protection rules.
A concrete walk-through
At launch, the loader maps executable code and data, creates a stack, prepares arguments and environment, and arranges runtime initialization. A function call changes registers and stack state inside the process. A system call crosses into privileged kernel code to request an operation the process cannot perform directly.
Costs and failure cases
Virtual addresses are not physical addresses and may not map to RAM until accessed. A process can have multiple threads sharing the same address space, so process isolation does not remove races within that process. Resource limits and file descriptors are part of execution context too.
Check your understanding
Explain how two processes can both use the same virtual address for different private data. What mechanism prevents one from freely reading the other’s memory?