How Programs Run
What an OS is for, and what happens between `./server` and the first instruction on a CPU: loader, address space, process, scheduler.
Several programs want the same CPU, memory, disk and network card at the same time; the operating system is the program that owns those resources and hands them out, and everything it does follows from that job.
Typing `./server` triggers a chain — shell, fork, exec, loader, address space, dynamic linker, stack, heap, registers, scheduler — and the first instruction of your `main` runs only after every one of those steps has succeeded.
A program is a passive file of instructions on disk; a process is one running instance of it with its own address space, state and PID — which is why one `chrome` binary can be twenty processes and why killing one leaves the file untouched.
A process’s virtual address space is divided into regions with different lifetimes and permissions — text, data, BSS, heap, mapped libraries, stack — and knowing which region a variable lives in tells you how it is allocated, how long it lives and how it can be corrupted.