1.1 The Basic Structure of a Computer
Prerequisites: Know how to open the system terminal
Estimated time: 8–12 minutes
You are ready to continue when: you can explain what role the CPU, memory, and persistent storage each play, and can view them on your current platform
Running a program requires stored instructions, working space, and instruction execution. Persistent storage, memory, and the CPU do those jobs. A larger SSD does not directly fix a shortage of RAM; the shopping list has to respect the distinction too.
These three items aren't the entire computer, but they're enough to build the first layer of a mental model. When we encounter processes, files, and networks later, we'll return to refine this model.
First Grasp Three Types of Components
| Component | Primary Responsibility | After Power Off | Ambiguous Boundaries |
|---|---|---|---|
| CPU | Execute instructions; contains core, registers, and cache components | State is not retained | The CPU is not equivalent to "the entire computer's brain"; devices and operating systems also participate in the work |
| Memory (RAM) | Store currently used code and data | Usually lost | Processes see virtual addresses, not directly physical memory |
| Persistent Storage | Save programs and data in the file system | Usually retained | Performance and reliability differ among SSDs, mechanical hard drives, and network storage |
A minimal model says that the CPU executes instructions, memory holds code and data currently in use, and persistent storage keeps bytes through a file system. It does not yet explain CPU caches, virtual memory, DMA, or durability timing; later lessons add those mechanisms explicitly.
How Data Flows
Files in Persistent Storage
│ Read or Memory-Mapped
▼
Code and Data in Memory
│ CPU Fetches and Writes; Devices May Also Transfer via DMA
▼
Computing Results Remain in Memory; Applications Write Back to Files or Send to Devices as NeededSaving is not automatic. A program crash, an unflushed cache, or a storage device failure can all result in the loss of data that has not yet been persisted.
Check on Your Own Machine
The model can't just stay in the table. Choose a set of commands by platform; the output may vary depending on hardware, operating system, virtualization, and container limitations.
| Platform | CPU | Memory | File system capacity |
|---|---|---|---|
| Linux | lscpu | free -h | df -h / |
| macOS | sysctl -n machdep.cpu.brand_string | vm_stat | df -h / |
| Windows PowerShell | Get-CimInstance Win32_Processor | Get-CimInstance Win32_OperatingSystem | Get-Volume |
Linux can run:
lscpu | sed -n '1,12p'
free -h
df -h /Type: runnableEnvironment: Linux Observation: lscpu reports cores, logical CPUs, and architecture; free reports memory; df reports root file system capacity. A virtual machine usually reports its guest configuration. In containers, lscpu and free may still show host information, which does not establish the resources the container is allowed to use.
About Speed
A CPU cache access is usually faster than a DRAM access, and actually reading a storage device usually takes longer. But a file read may hit the operating system cache, so it does not necessarily measure an SSD access. A useful comparison states the access size, sequential or random pattern, cache state, and whether queueing time is included. The capacity commands on this page do not measure latency.
Check the Boundaries Before Continuing
Use your output to explain how the reported logical CPU count differs from the physical core count, why free and available differ, and which file system df -h / describes. Check the output again if any field is unclear.
The next page is Programs and Files. The persistent storage already contains many bytes. Next, distinguish which are data and which can start the machine working.