Computer & OS Fundamentals · beginner · ~10 min

CPU, RAM, disk, and processes

Distinguish the storage tiers and explain what a process actually is.

Overview

CPU (registers/cache) → RAM (volatile working memory) → disk (persistent, slow). A process is a running program with its own virtual memory, handles, and security context; threads share a process's memory.

Why it matters

Knowing what runs as which user, what's resident in memory, and how processes are isolated underpins privilege escalation, credential harvesting from memory, and understanding why race conditions exist.

Core concepts

Memory hierarchy. Registers → cache → RAM → disk, each far slower than the last. Volatile vs persistent. RAM is lost on power-off; disk survives. Process. Program + virtual memory + handles + security context. Thread. Shares the process's memory — fast but race-prone.

Lesson

Performance and behaviour come from how these four pieces interact.

The hardware tiers

  • CPU — executes instructions; has a few tiny, ultra-fast registers and small caches (L1/L2/L3).
  • RAM — fast, volatile working memory; lost on power-off. Programs run here.
  • Disk (SSD/HDD) — slow, persistent storage. Survives reboots.

The speed gap is enormous: registers are sub-nanosecond, RAM tens of nanoseconds, disk thousands of times slower. This is why "swap to disk" tanks performance.

What a process is

A process is a running program plus its state: its own virtual memory (code, stack, heap), open file handles, environment, and a security context (which user it runs as). The OS gives each process the illusion of having the machine to itself via virtual memory.

Threads

A process can have multiple threads — independent execution paths sharing the same memory. Shared memory is fast but is exactly why race conditions and data corruption happen.

Pentest relevance

Process listings (ps, Task Manager), the user a process runs as, and what's loaded in memory are all reconnaissance and privilege-escalation signals. A process running as root with a vulnerability is a path up.

Summary

The storage tiers trade speed for persistence; a process is a running program with isolated virtual memory and a user identity, and threads share that memory. The user a process runs as is a recurring privilege-escalation signal.