Based on the Linux Master 1 exam syllabusReport an error
The Level 1 exam doesn't test command memorization; it asks "why does this command behave this way?" at the kernel level. The starting point is the definition of an operating system.
open(), read(), write() and the operating system handles the real hardware.| Resource | Managed by (kernel subsystem) | Key function |
|---|---|---|
| CPU | Process scheduler | Decides which process runs, when, and for how long |
| Memory | Memory manager (uses the MMU) | Virtual memory, paging, swap |
| Storage | Filesystem / block I/O layer | File and directory abstraction, disk scheduling |
| I/O devices | Device drivers | Control hardware such as keyboards, networks, and disks |
| Network | Network stack (TCP/IP) | Sending and receiving packets, socket interface |
💡 Concept: The four core functions of an operating system are process management, memory management, file management, and device (I/O) management. Adding the user interface (shell/GUI) and security/permission management makes six functions. The Level 1 exam often asks about each function together with the kernel subsystem responsible for it.
| Mode | Ring | Privileges | Who runs in it |
|---|---|---|---|
| Kernel mode (privileged mode) | Ring 0 | Can execute all CPU instructions and access all memory regions | Kernel code |
| User mode (unprivileged mode) | Ring 3 | Can execute only a restricted set of instructions | Ordinary applications |
# Let's watch the system calls a program makes, using strace
strace -c ls /tmp
# Statistics for system calls such as write, read, openat, close, mmap are printedls makes dozens of system calls (openat, read, write, close, stat, etc.).A system call is not a simple function call. It is a hardware event in which the CPU raises its privilege level from Ring 3 to Ring 0. In the past the int 0x80 software interrupt was used, but modern x86-64 Linux uses the faster syscall instruction. Because of this switching cost, high-performance programs use buffering to reduce the number of system calls.
There are two main philosophies of kernel design, and both are in scope for the Level 1 exam.
| Category | Monolithic kernel | Microkernel |
|---|---|---|
| Structure | Puts the filesystem, drivers, network stack, and scheduler all in one kernel space (a single address space) | The kernel keeps only the minimum (IPC, basic scheduling, memory management). Filesystems and drivers are separate services in user space |
| Communication | Function calls | Message passing between services (IPC) |
| Advantages | Fast | High stability and modularity |
| Disadvantages | A bug in one part can bring down the whole kernel; the code becomes huge | Can be slow due to IPC overhead |
| Typical examples | Linux | MINIX, GNU Hurd |
lsmod # List currently loaded kernel modules
modinfo e1000 # Show information about a specific module
sudo modprobe vfat # Load a module (dependencies are resolved automatically)
sudo rmmod vfat # Remove a module
uname -r # Show the running kernel versionIn 1992, a famous debate (the Tanenbaum–Torvalds debate) took place on Usenet between Professor Andrew Tanenbaum, the author of MINIX, and Linus Torvalds, over "monolithic kernels are obsolete vs. microkernels are too slow." Tanenbaum criticized Linux as "an obsolete design," but in the end monolithic Linux came to dominate the world. It is often cited as a case where practicality beat academic elegance.
ls -l, the shell interprets it → finds and runs the appropriate program → shows the result to the user.| Shell | Developer / origin | Features |
|---|---|---|
| sh (Bourne Shell) | Stephen Bourne (1977) | The first standard Unix shell, the prototype of shell scripting |
| csh (C Shell) | Bill Joy | Borrowed C language syntax, introduced history and aliases |
| ksh (Korn Shell) | David Korn | sh-compatible plus csh features merged in |
| bash (Bourne Again Shell) | Brian Fox (GNU) | An extended version of sh, the default Linux shell |
| zsh | Paul Falstad | bash-compatible with powerful auto-completion |
| tcsh | Extension of csh | csh plus command-line editing |
echo $SHELL # Show the current login shell
cat /etc/shells # List of usable shells registered on the system
chsh -s /bin/zsh # Change the login shell to zsh (updates /etc/passwd)
echo $0 # Name of the shell currently running/etc/passwd.user:x:1000:1000:User:/home/user:/bin/bash → the final /bin/bash is that user's login shell.⚠️ Pitfall: The exam asks for
chshas "the command to change the default shell," and the new shell must be one registered in/etc/shells. Also,chshdoes not take effect immediately; it applies from the next login. To use a different shell right away in the current session, simply type the shell name (zsh) to launch a subshell.
When a user types ls, the shell goes through the following steps. This process shows the operating system's process creation mechanism exactly as it is.
*), variables ($HOME), and quotes.ls program via the execve() system call.fork-exec-wait model is one of the most elegant designs in Unix — every program execution happens through two steps: "clone, then replace."If you append & to a command (sleep 100 &), the shell does not wait() and returns the prompt immediately. This is background execution. Conversely, if the parent dies while it is waiting, the child becomes an orphan process and is adopted by init (PID 1). If the child dies but the parent does not collect its exit status, it becomes a zombie process.
The biggest legacy Unix left behind is not code but philosophy.
# Combine small tools with pipes (|) to perform a complex task
cat /etc/passwd | grep "/bin/bash" | wc -l
# passwd output → filter only bash shell users → count linescat, grep, wc) does only one thing, but chained with pipes they create a new task: "count the users who use the bash shell." This is the essence of the Unix philosophy.The name Unix (UNIX) is a pun poking fun at its predecessor, MULTICS (Multiplexed Information and Computing Service). As a reaction to MULTICS being too complex and huge, they pursued simplicity and called it "UNICS (Uniplexed)," which became UNIX. The drive toward simplicity is engraved in the name.
"Hello everybody out there ... I'm doing a (free) operating system (just a hobby, won't be big and professional like gnu) ..."
Strictly speaking, "Linux" refers to the kernel only. What we install and use, like Ubuntu or CentOS, is a distribution that bundles the Linux kernel + GNU tools + a package manager + applications. In exam blanks like "Linux is ( )", the answer is often "the kernel."
Next time, we'll look at the licenses that made Linux free and the distribution families that split off as a result.
lsmod and modprobe.Click a choice to reveal the answer and explanation.
Question 1
In an operating system, what is the mechanism by which a user-mode program requests the kernel to perform privileged operations such as disk I/O or network communication?
Question 2
Which statement best describes the design approach of the Linux kernel and its characteristics?
Question 3
Which is the correct order of the standard Unix process-creation model that the shell goes through when executing the command ls typed by the user?
Question 4
Which of the following is the default login shell on Linux, whose name is an abbreviation of "Bourne Again Shell"?
Question 5
Which of the following is NOT a correct description of the Unix philosophy "Everything is a file"?
Question 6
Which statement about the history of Linux is correct?