Search⌘ K

Process Creation: A Little More Detail

Explore how operating systems transform programs into running processes by loading executable code and static data into memory, allocating stack and heap memory, setting up I/O resources, and starting execution at the program's entry point. This lesson clarifies the detailed steps behind process creation.

One mystery that we should unmask a bit is how programs are transformed into processes. Specifically, how does the OS get a program up and running? How does process creation actually work?

Transforming a program into a process

The first thing that the OS must do to run a program is to load its code and any static data (e.g., initialized variables) into memory, into the address space of the process. Programs initially reside on disk (or, in some modern systems, flash-based SSDs) in some kind of executable format; thus, the process of loading a program and static data into memory requires the OS to read those bytes from disk and place them in memory somewhere (as ...