B2. Operating Systems, Computer Hardware and How a Computer Works
| Level | Foundation and Intermediate (with a step towards Advanced: OS security) |
| Prerequisites | None, this is a starting topic |
| Study time | About 8 hours (4 h reading and video, 4 h hands-on) |
| Source | Teach-the-Teachers fiche B2 |
| Next topics | B5 Essentials · B7 Cyber hygiene · B9 Incident response |
Why this matters
You cannot protect what you do not understand. Every attack eventually runs as instructions on a processor, reads or writes memory and storage, and needs permission from an operating system to do so. Malware hides in running processes, ransomware encrypts files on disk, an attacker who becomes administrator owns the machine, and hardware flaws such as Spectre and Meltdown (2018) showed that even the CPU itself can leak secrets.
As a security specialist you will:
- harden systems (updates, user rights, disk encryption, secure boot),
- investigate incidents (which process did what, when, with which rights?),
- advise on end-of-life systems that no longer receive security updates.
All of that starts with knowing what is inside a computer and what the operating system does.
Learning objectives
Foundation. After this topic you can:
- Name the basic parts of a computer and explain the function of each one.
- Explain the difference between hardware, software and firmware.
- Outline the history of the computer in a few key steps.
Intermediate. In addition you can:
- Explain the binary number system and convert between decimal, binary and hexadecimal.
- Explain what an operating system does and name common operating systems.
- Describe how a computer executes a program (fetch–decode–execute) and how it boots.
Towards Advanced. You can also explain why updates, least privilege and secure boot matter for security, and what hardware vulnerabilities such as Spectre and Meltdown are.
Foundation: what is inside a computer
Hardware, software and firmware
- Hardware is everything you can physically touch: the processor, memory, disks, screen and cables. It can be internal (motherboard, CPU, RAM, internal SSD) or external (keyboard, mouse, monitor, external drive, printer).
- Software is the set of instructions that tells the hardware what to do: the operating system, apps and drivers.
- Firmware sits in between. It is software stored on a chip of the hardware itself, such as the UEFI/BIOS of your motherboard or the firmware of your router or SSD. Firmware is a security target too: malware in firmware survives reinstalling the operating system.
A computer cannot do anything useful with hardware alone (no instructions) or software alone (nothing to run on).
The main components
| Component | Function | Security relevance |
|---|---|---|
| CPU (Central Processing Unit) | Executes instructions; the "brain". Has cores, a clock speed and small, very fast caches | Hardware flaws (Spectre/Meltdown) can leak data between programs |
| RAM (Random Access Memory) | Short-term working memory for running programs; volatile (erased when power is off) | Holds passwords and keys while in use; memory forensics reads it |
| Storage (SSD / HDD) | Long-term memory for the OS, programs and files; non-volatile | Data stays after shutdown: use full-disk encryption |
| Motherboard | Connects all components; holds the firmware (UEFI/BIOS) and the TPM chip | Firmware attacks; secure boot is configured here |
| GPU (Graphics Processing Unit) | Renders graphics; thousands of small cores for parallel work | Also used to crack password hashes very fast (see B8) |
| NIC (Network Interface Card) | Wired or wireless network connection; has a MAC address | The door to the network (see B1) |
| PSU (Power Supply Unit) | Converts mains power for the components | Availability: no power, no service |
| TPM (Trusted Platform Module) | Security chip that stores keys and measures the boot process | Used by BitLocker, Windows Hello and secure boot |
A very short history
| Period | Milestone |
|---|---|
| 1830s | Charles Babbage designs the Analytical Engine; Ada Lovelace writes what is seen as the first program |
| 1936 | Alan Turing describes the "Turing machine", the theoretical basis of every computer |
| 1940s | Electronic computers: Colossus (code-breaking, 1943–44) and ENIAC (1945); John von Neumann describes the stored-program architecture still used today |
| 1947–1971 | The transistor (1947), the integrated circuit (1958) and the first microprocessor, Intel 4004 (1971) |
| 1970s–1980s | Personal computers (Apple II, IBM PC); ARPANET grows into the Internet; the first PC viruses (Brain, 1986) |
| 1990s–2000s | The World Wide Web, Windows and Linux, laptops; worms such as ILOVEYOU (2000) spread worldwide |
| 2007– | Smartphones, cloud computing, Internet of Things, and since 2022 generative AI |
Intermediate: how a computer works
Binary: everything is 0 and 1
A transistor is a tiny switch: on (1) or off (0). One such value is a bit; 8 bits make a byte. Every number, letter, image and program is ultimately a pattern of bits.
Binary is base 2. Each position is worth twice the one to its right:
| 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|
| 0 | 0 | 1 | 0 | 1 | 1 | 0 | 1 |
00101101 = 32 + 8 + 4 + 1 = 45. One byte holds 0 to 255. That is why an IPv4 address such as 192.168.1.20 consists of four numbers between 0 and 255: each is one byte.
Hexadecimal (base 16, digits 0–9 and A–F) is a short way to write bytes: one hex digit = 4 bits, so one byte = two hex digits. 45 decimal = 0010 1101 binary = 2D hex. You will see hex everywhere in security: MAC addresses (3c:22:fb:...), hashes, memory addresses and packet dumps.
Text is stored with an encoding. In ASCII/UTF-8 the letter A is 65 decimal = 0x41 = 01000001.
Fetch, decode, execute
The CPU runs a simple loop billions of times per second:
- Fetch the next instruction from memory (the program counter says where).
- Decode it: what operation, on which data?
- Execute it: calculate, read or write memory, or jump to another instruction.
Programs and data both live in memory (the von Neumann architecture). This is powerful, but it is also the root of a whole class of attacks. If an attacker can make the CPU treat data they supplied as instructions (a buffer overflow, for example), they control the program.
What the operating system does
The operating system (OS) is the most important software on a computer. It manages the hardware and offers services to applications, so that each program doesn't have to talk to the hardware directly.
| Task | What it means | Security angle |
|---|---|---|
| Process management | Starts, schedules and stops programs (processes) | Malware is a process too; you can find and stop it |
| Memory management | Gives each process its own virtual memory and keeps them apart | Isolation stops one program reading another's secrets |
| File systems | Organises data on storage into files and folders with permissions | File permissions decide who may read or change what |
| Device drivers | Lets the OS talk to hardware | Drivers run with high privileges; a bad driver is dangerous |
| Users and rights | Accounts, groups, administrator/root versus normal user | Least privilege: daily work without admin rights |
| Networking | Implements TCP/IP, the firewall and Wi-Fi | The OS firewall is your first line of defence |
The core of the OS is the kernel. It runs in a privileged CPU mode (kernel mode), while applications run in a restricted user mode. An application that needs something from the hardware asks the kernel through a system call. This separation is a key security boundary: a bug in an app should not give access to the whole machine.
Common operating systems. Windows, macOS and Linux distributions (Ubuntu, Debian, Fedora, Kali) on PCs and servers; Android (Linux-based) and iOS on phones; and many embedded systems (routers, IoT devices, cars), which often run Linux variants and are rarely updated.
How a computer boots
- Power on → the firmware (UEFI) tests the hardware.
- Secure Boot checks that the bootloader is digitally signed by a trusted party (see B8 Cryptography).
- The bootloader loads the kernel.
- The kernel starts drivers and system services.
- You log in, and your user session and apps start.
Malware that loads before the OS (a bootkit or rootkit) is very hard to detect from inside the OS. Secure Boot and the TPM are there to stop it.
Why updates and versions matter
Software contains bugs, and some bugs are vulnerabilities. Vendors fix them with patches. An OS that is no longer supported receives no patches, so every newly found vulnerability stays open forever. Microsoft ended normal support for Windows 10 in October 2025. Systems still running it without extended updates are an easy target. Hardware vulnerabilities such as Spectre and Meltdown abused speculative execution, a performance trick in modern CPUs, to read memory that should be off-limits. They were mitigated with a combination of firmware (microcode), OS and browser updates.
In practice
Exercise 1: inventory your own computer (Foundation, 30 min)
| What | Windows | Linux / macOS |
|---|---|---|
| CPU, RAM, OS version | systeminfo or Settings → System → About |
lscpu, free -h, uname -a / About This Mac |
| Storage | Disk Management | lsblk, df -h |
| Running processes | Task Manager (Ctrl+Shift+Esc) | top or htop, ps aux |
| Firmware, Secure Boot, TPM | msinfo32 (look for Secure Boot State), tpm.msc |
mokutil --sb-state |
| Disk encryption | manage-bde -status (admin) |
lsblk -f (look for crypto_LUKS) / FileVault |
Write down: which OS version you run, whether it still gets updates, whether Secure Boot is on and whether your disk is encrypted. This is the start of a security check.
Exercise 2: binary and hex (Intermediate, 30 min)
- Convert 13, 100 and 255 to binary and hex by hand, then check with CyberChef ("To Binary", "To Hex").
- Write your first name in ASCII hex.
- Play the Cisco binary game until you can do level 5 without a calculator.
Exercise 3: your first virtual machine (Intermediate, 1–2 h)
Security professionals test things in virtual machines (VMs), never on their own system or a production system.
- Install VirtualBox (or VMware Workstation, which is free for personal use).
- Download Ubuntu Desktop and install it in a VM.
- Make a snapshot, so you can always return to a clean state.
- In the VM, open a terminal and try
whoami,id,ls -l /etc/shadow,cat /etc/shadowandsudo cat /etc/shadow. The file holds the password hashes of all users. Why does the firstcatfail while thesudoversion works? (Hint: look at the permissions thatls -lshows, and think about least privilege.) - Run
sudo apt update && sudo apt upgradeand read what gets updated.
Exercise 4: look at processes like an analyst (Intermediate, 30 min)
Download Process Explorer (Sysinternals). Look at the process tree: which process started which? Enable Options → VirusTotal.com → Check VirusTotal.com to see how unknown processes are checked. Analysts use the same approach to spot malware.
Tools
| Tool | What you use it for | Cost |
|---|---|---|
| VirtualBox | Run virtual machines for safe experiments | Free |
| Ubuntu | Beginner-friendly Linux to learn the command line | Free |
| Linux Journey | Interactive lessons on Linux basics | Free |
| Sysinternals Suite | Process Explorer, Autoruns and more for Windows analysis | Free |
| CyberChef | Convert between binary, hex, text and Base64 | Free (runs in browser) |
| Cisco binary game | Practise binary conversion | Free |
Videos
- 🎬 Computer basics: basic parts of a computer – GCFLearnFree (Foundation)
- 🎬 Understanding operating systems – GCFLearnFree (Foundation)
- 🎬 Why do computers use 1s and 0s? Binary and transistors explained (Intermediate)
- 🎬 Crash Course Computer Science – full playlist (Foundation → Intermediate; episodes 1–20 cover hardware, binary and operating systems)
- 🎬 Meltdown and Spectre, simply explained (towards Advanced)
Handouts and reading
- 📄 Binary numbers – CS Unplugged activity (PDF)
- 📄 Binary worksheet – Corbettmaths (PDF)
- 📄 Components of a computer system – Tutorialspoint
- 📄 History of computers: a brief timeline – Live Science
- 📄 Meltdown and Spectre – official information site
Literature and courses
- Petzold, C. Code: The Hidden Language of Computer Hardware and Software (2nd ed., 2022). From light bulbs and switches to a working computer, very readable.
- Arpaci-Dusseau, R. & A. Operating Systems: Three Easy Pieces (free online). The best free introduction to processes, memory and file systems.
- 🎓 Nand2Tetris: build a computer from logic gates up (Intermediate → Advanced).
- CyBOK Operating Systems & Virtualisation Security KA and our summaries CyBOK 11.3-5 OS security principles and models and CyBOK 20 Hardware security.
Common mistakes
- "RAM and storage are the same." RAM is fast and temporary, storage is slower and permanent. This matters in forensics: switching a machine off destroys the evidence in RAM.
- Working as administrator all day. Malware you accidentally start then also runs as administrator. Use a normal account and elevate only when needed.
- "Deleting a file removes it." Usually only the reference is removed; the data stays on disk until it is overwritten. Use encryption, or secure wiping before disposal.
- "Macs and Linux don't get malware." Every OS has vulnerabilities; there is simply less malware written for some of them.
Check yourself
- Can a computer work with only hardware or only software? Explain.
- What does CPU stand for, and what are the three steps it repeats?
- Convert
11000000to decimal and to hex. - Name four tasks of an operating system.
- Why does an unsupported operating system become more dangerous over time?
- What is the difference between kernel mode and user mode?
Answers
1. No. Hardware needs instructions to do anything, and software needs hardware to run on.
2. Central Processing Unit. It repeats fetch, decode, execute.
3. 192 decimal, C0 hex.
4. Any four of: process management, memory management, file systems, device drivers, users and rights, networking.
5. New vulnerabilities keep being found but are never patched, so the number of known, exploitable holes only grows.
6. Kernel mode has full access to hardware and memory; user mode is restricted and must ask the kernel (system call). This limits the damage a faulty or malicious app can do.
Related topics
- B7 Cyber hygiene: updates, accounts and encryption in daily practice.
- B6 Attacks, threats, vulnerabilities: malware types.
- B8 Cryptography: signatures (secure boot) and disk encryption.