How Linux is put together: hardware, kernel and user space
What happens behind the scenes when you type a command? You learn Linux's layers, from hardware to kernel and from system call to process, through analogies and live observation.
Level 101 · 14 lessons · 12 practice labs
Lessons
The layers
- CPU, memory and disk: the three core parts
- The kernel's job: the referee that shares resources
- User space and kernel space
- System calls: a program asking the kernel for something
- Short task: count the system calls ls makes
Everything is a file
- "Everything is a file": devices, pipes and sockets
- /proc and /sys: windows into the kernel
- /dev: device files and null, zero, random
- Short task: build a system ID card using only /proc and /sys
From power-on to login
- Boot in brief: firmware, boot loader, kernel, init
- PID 1: the ancestor of every process
- Programs versus processes: many copies of one program
- Virtual memory: every process gets its own address space
- Capstone: explain a command's journey from start to finish
Practice labs
- Summarise the server's hardware: Find the CPU core count, total memory and disk size from /proc and lsblk and write them to the answer file.
- Build an ID card from /proc and /sys only: Without helper commands, read only /proc and /sys files to report the kernel version, uptime and network interfaces.
- Measure kernel versus user time: Run two programs under time, find which spends its time in kernel space and explain why in one sentence.
- Count a command's system calls: Use strace -c to find the system call the given command makes most often and submit it.
- Find the missing file with strace: Use strace to find the missing file a program tries to open before quitting without explanation, then create it.
- Find which config a program really reads: Use strace to work out which of several config files a tool actually reads, and in what order, and report it.
- Silence a noisy script with /dev/null: Send a cron script's needless output to /dev/null while keeping its error messages in a log file.
- Make test files from /dev/zero and /dev/urandom: Create two test files of the given sizes, one of zeros and one of random bytes, and compare how well they compress.
- Read a process's open files from /proc: Use the links under /proc/PID/fd of a mysterious process to find the file it writes and the socket it uses.
- Trace a process's ancestors in the tree: Trace the given process's parent chain up to PID 1 with pstree or ps and write it to the answer file.
- Count running copies of one program: Count the running copies of the same program and compare how much memory each one uses.
- Build the last boot's timeline: Use the boot logs to find when the kernel loaded, init started and the login prompt appeared, and list them in order.
About this course
What happens behind the scenes when you type a command? You learn Linux's layers, from hardware to kernel and from system call to process, through analogies and live observation.
What you will learn
- The layers
- Everything is a file
- From power-on to login
Prerequisites
No prior knowledge is needed; the course starts from zero.
Lab environment
Lessons run in your own Kali Linux terminal that opens in the browser. Nothing to install; the lab starts clean in every lesson.
Frequently asked questions
- Is this course right for my level?
- The course is at beginner level; every term is explained where it first appears.
- Is there anything to install?
- No. Every lesson runs in your own lab environment that opens in the browser.
- How do lessons work?
- Each lesson has 8 to 10 steps and a short quiz. Early steps show the command to type, later steps give less help; if two attempts fail, the solution opens.
- Can I try it for free?
- Yes. The first three lessons of every course are free.