C Program Lifecycle Visualization

.c
Source Code
Human-readable C code
PP
Preprocessor
Processes directives
.o
Compiler
Generates object code
🔗
Linker & Loader
Links libraries & loads executable
▶️
Executable
Ready to run program

Source Code (.c)

This is where it all begins - you write human-readable C code in a text editor.

#include <stdio.h>

int main() {
    printf("Hello, World!");
    return 0;
}

From Program to Process

When an executable runs, the operating system transforms it into a process with memory space and resources:

Executable Program
Text (Code)
Data
BSS
OS Loader
Running Process
Stack
Function calls, local variables
Heap
Dynamic memory allocation
Data
Global/static variables
Text
Machine code instructions
CPU
RAM
File
Socket
1
OS loads executable into memory
2
Memory space allocation
3
PCB (Process Control Block) creation
4
Resource allocation
5
Process execution begins

OS loads executable into memory

The operating system reads the executable file from disk and loads it into RAM, preparing it for execution.

Click on each stage or step to learn more about that phase of the compilation or process creation.