CSC 394 · Operating Systems
Our notes
2 min readSystem calls
A system call is the way a program asks the kernel for a service. The program places arguments, runs a special trap instruction, the CPU switches to kernel mode, the kernel does the work and returns.
| Type | UNIX examples |
|---|---|
| Process control | fork(), exec(), exit(), wait() |
| File management | open(), read(), write(), close() |
| Device management | ioctl(), read(), write() |
| Information | getpid(), time() |
| Communication | pipe(), socket(), shmget() |
Library functions (printf in C, print in Python) call these for you.
Interrupts
An interrupt is a signal that makes the CPU stop what it is doing, save its state, and run an interrupt handler.
- Hardware interrupts: a key pressed, disk finished, timer tick.
- Software interrupts (traps): system calls, errors such as divide-by-zero.
The timer interrupt lets the OS take the CPU back from a program (needed for time-sharing).
Dual-mode operation
A mode bit separates user mode (restricted) and kernel mode (all instructions allowed). Privileged instructions (I/O, changing memory maps, turning off interrupts) only run in kernel mode; this protects the system from faulty or malicious programs.
OS structures
| Structure | Idea | Pros / cons |
|---|---|---|
| Simple / monolithic | the whole OS is one big program in kernel mode | fast; hard to maintain, one bug can crash all (MS-DOS, early UNIX) |
| Layered | layers, each using only the one below (layer 0 hardware … layer N user interface) | easy to debug; can be slow; hard to define layers (THE system) |
| Microkernel | only the essentials (IPC, scheduling, basic memory) in the kernel; drivers and file systems run as user processes | reliable, secure, extensible; message passing is slower (Mach, MINIX, QNX) |
| Modular (loadable modules) | a core kernel plus modules loaded when needed | flexible and fast (Linux, Solaris) |
| Hybrid | mixes the above | Windows NT, macOS (XNU) |
Virtual machines
A hypervisor lets one computer run several operating systems at once, each in its own virtual machine (VirtualBox, VMware, cloud servers). Containers (Docker) share one kernel but isolate programs.
OS services for users
Program execution, I/O operations, file-system manipulation, communication, error detection; and for the system: resource allocation, accounting, protection and security.
The shell
The shell (command interpreter) reads user commands and runs them: bash on Linux, PowerShell on Windows. Examples: ls (list files), cd (change directory), cp, mv, rm, ps (list processes), kill.
Exams usually ask: define a system call and give types with examples; explain interrupts; dual-mode operation; compare monolithic, layered and microkernel structures; what a virtual machine is.
Common mistake: saying the shell is the kernel. The shell is a user program that talks to the kernel through system calls.
Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.
Read
-
Best pick Introduction to Computer Science, 6.2 Fundamental OS Concepts
(opens openstax.org in a new tab)
OpenStax, Introduction to Computer Science, 6.2 Fundamental OS Concepts, CC BY-NC-SA 4.0 · licence
-
OSTEP: Mechanism: Limited Direct Execution
Free chapter PDF from the authors' site (131 KB).
(opens pages.cs.wisc.edu in a new tab)
-
OSTEP: Interlude: Process API (fork, exec, wait)
Free chapter PDF from the authors' site (119 KB).
(opens pages.cs.wisc.edu in a new tab)
-
System call
(opens en.wikipedia.org in a new tab)
Wikipedia, System call, CC BY-SA 4.0 · licence
Watch
We link to free material and never copy it. Every link was opened by our team before it went up; video data is a rough guide at 360p.