Phase 1: The Wake-Up Call (Storage to RAM
Programs live on your Disk (SSD/HDD) as a collection of “dormant” 1s and 0s. When you run the program:
- The OS Steps In: The Operating System (Windows, macOS, etc.) locates the program’s executable file on the disk.
- The Loading: The CPU sends a command to the disk controller to “copy” the necessary data into the RAM.
- Why? The disk is too slow to talk to the CPU directly. Moving the data to RAM creates a high-speed “workspace” where the CPU can actually work.
Phase 2: Allocation & Initialization
Before the code starts flying, the computer needs to set some ground rules:
- Memory Space: The OS carves out a specific “sandbox” in the RAM just for that program so it doesn’t interfere with other apps.
- GPU Prep: If it’s a game or a video editor, the GPU starts loading textures and shaders into its own specialized memory (VRAM).
Phase 3: The Fetch-Execute Cycle (The CPU takes over)
Now that the data is in the RAM, the CPU starts “reading” it. This happens through the Instruction Cycle we touched on earlier:
- Fetch: The CPU pulls the first instruction from the RAM into its Registers.
- Decode: The CPU figures out what the instruction wants (e.g., “Draw a blue pixel” or “Check if the mouse clicked”).
- Execute: The CPU performs the math.
- Repeat: This happens billions of times per second.
Phase 4: The Visual Output (CPU to GPU)
As the CPU processes the logic of the program, it needs to show you what’s happening:
- The CPU sends “draw calls” to the GPU.
- The GPU takes those instructions, calculates the millions of pixels required for your resolution, and sends that data to your Monitor.
- This happens 60 to 240+ times per second (your Refresh Rate).
Summary of the “Relay Race”
| Component | Role in Running a Program |
| Disk (SSD) | The “Library” where the program is stored long-term. |
| RAM | The “Desk” where the active files are kept for speed. |
| CPU | The “Worker” that follows the instructions and does the math. |
| GPU | The “Artist” that renders the images and UI onto the screen. |
| Registers | The “Note-pad” the worker uses for instant calculations. |
What if it “Freezes”?
A program usually freezes for one of two reasons:
- The “Wait”: The CPU is asking for data from the Disk, but the Disk is busy or slow (I/O Wait).
- The “Loop”: The CPU is stuck in a logic loop where it’s doing so much math it can’t “listen” to your mouse clicks anymore.
Would you like to see how this process differs for “Web Apps” (like Chrome) versus “Native Apps” (like a video game)?
