Bootstrap Process Explained
Operating Systems: Processes and System Services
Bootstrap and Boot Loaders
When a computer starts up, the first program that runs is a bootstrap program. It checks the hardware to ensure sufficient resources are available, then searches for a storage device (hard disk, SSD, USB) that contains a more substantial operating system and transfers control to that OS.
The bootstrap program itself is minimal; it is not the full OS.
Modern computers are fast, so the hardware check may flash by quickly.
The bootstrap concept can be extended: instead of loading an OS directly, the bootstrap can load a boot loader that presents a menu of operating systems to choose from.
GRUB (Grand Unified Bootloader)
GRUB is a bootstrap loader that allows the user to select from multiple installed operating systems (e.g., Windows, Linux). It is not limited to Linux; it works with any OS.
Older PCs were tied to the OS being at a fixed location on disk; newer systems allow the OS anywhere on disk.
GRUB is a practical example of a bootstrap loader that supports multi-boot configurations.
Operating System Services
An operating system provides essential services, including:
File system management
User interface (graphical or command-line)
I/O system management (device drivers)
Memory management
Process management
Secondary storage management
Monolithic vs. Layered Operating Systems
Feature | Monolithic OS | Layered OS |
|---|---|---|
Structure | All services in one large block | Services separated into layers |
Speed | Faster – no inter‑layer communication overhead | Slower – communication between layers adds overhead |
Extensibility | Difficult – requires rewriting and reinstalling the OS | Easier – can add new layers or replace existing ones |
Windows takes a hybrid approach: much of the system is monolithic, but device drivers and add‑ons are loaded separately.
System Calls and System Programs
System Calls
A system call is how a user program requests a service from the operating system. It is an API (Application Programming Interface) provided by the OS.
System calls are used to create processes, manage files, perform I/O, etc.
They are not interrupts; an interrupt is a hardware signal, while a system call is a software request.
System Programs
System programs are utility programs that come with the OS to help manage the system. Examples:
DIR(list files)Check Disk (check hard disk integrity)
Task Manager (monitor processes and resource usage)
These programs do not directly help the user do work but support system administration and monitoring.
Command Interpreter (Shell)
The command interpreter accepts user commands and passes them to the OS. It is separate from the kernel so that different interfaces can be used (command line, GUI, etc.).
Example: bash (Bourne Again SHell) in Unix/Linux.
The shell executes system calls (e.g.,
fork,exec) to start new processes.
Processes
What is a Process?
A process is a program in execution. It is an active entity, whereas a program is a passive collection of instructions on disk.
A single program can spawn multiple processes (e.g., Firefox with multiple tabs).
Processes run sequentially in terms of instruction execution (fetch, execute, next instruction).
Process State
A process moves through several states during its lifetime:
New → Ready → Running → Waiting (blocked) → Terminated
↑ ↓ ↕
←────────←New: The process is being created.
Ready: The process is loaded in memory and waiting for CPU time.
Running: The process is currently being executed by the CPU.
Waiting (Blocked): The process is waiting for some I/O event (e.g., keyboard input, disk access).
Terminated: The process has finished execution.
A process can leave the running state for three reasons:
Waiting for I/O – moves to waiting queue; returns to ready when I/O completes.
Time slice expired – moves back to ready queue (time‑sharing).
Interrupt (e.g., higher‑priority process, crash) – similar to waiting but often handled specially.
Process Control Block (PCB)
Each process is represented by a Process Control Block (also called Task Control Block). The PCB contains:
Process ID (PID)
State (ready, running, waiting, etc.)
Program counter – address of next instruction to execute
CPU registers (accumulator, stack pointer, etc.)
Memory limits
List of open files
Scheduling information (time slice, priority)
Parent/child pointers (to form a process tree)
The PCB is stored in kernel memory and is essential for context switching.
Context Switching
When the CPU switches from one process to another, the operating system must save the state of the current process (its PCB) and load the state of the next process. This operation is called context switching.
Context switching introduces overhead – the CPU spends time saving and loading data rather than doing actual work.
The trade‑off: allowing multiple processes to share the CPU gives the illusion of simultaneous execution, but too many processes can cause the system to spend more time switching than running (e.g., high system interrupt rate).
Process Scheduling
The scheduler decides which process from the ready queue gets the CPU next. Different types of schedulers exist:
Long‑term scheduler – decides which jobs are admitted to the system (e.g., a backup job scheduled to run at 6 PM).
Short‑term scheduler – selects the next process to run from the ready queue; operates in milliseconds.
Medium‑term scheduler – can swap processes out of memory to disk (swapping) to reduce memory pressure.
Processes can be categorized as:
I/O‑bound – spends most of its time waiting for I/O (e.g., a word processor waiting for key presses)
CPU‑bound – spends most of its time using the CPU (e.g., video rendering)
A good process mix includes both types to maximize resource utilization.
Process Creation and Termination
Creation – Using system calls like
fork()(Unix) to create a child process. The child may then execute a different program viaexec().Termination –
exit()orkill(). When a parent process terminates before its children, the children become orphans and are typically adopted by an init process. If a child terminates but the parent does not wait, it becomes a zombie (the PCB is kept until the parent acknowledges exit).Cascading termination – when a parent terminates, all its children are terminated as well.
Threads
A thread is a unit of execution within a process. Multithreading allows a process to perform multiple tasks simultaneously (e.g., one thread handling input, another handling output).
On a multi‑core system, threads can truly run in parallel.
Threads share the same memory space, making communication easier than between separate processes.
Interprocess Communication (IPC)
Processes often need to exchange data. Several mechanisms exist:
Sockets
A socket is an endpoint for communication between processes on different machines (or on the same machine). It uses an IP address to identify the computer and a port number to identify the specific service.
Well‑known ports: port 80 (HTTP), port 25 (SMTP email).
Security: unused ports should be closed to prevent intrusion.
Remote Procedure Call (RPC)
RPC allows a process to execute a function (procedure) on a remote system as if it were local. The client sends a request to a server, which runs the procedure and returns the result.
Requires a mechanism to handle data representation differences (e.g., big‑endian vs. little‑endian).
Interface Definition Language (IDL) helps define the interface between heterogeneous systems.
Pipes
A pipe is a unidirectional communication channel between two processes on the same system. For example, a word processor could pipe its output to a printer process.
Bidirectional pipes allow data to flow both ways.
Named pipes (FIFOs) exist as file‑system objects and can be used by multiple processes.
Pipes can be half‑duplex or full‑duplex.
Endianness
Endianness refers to the byte order of multibyte data in memory. Big‑endian stores the most significant byte at the lowest address; little‑endian stores the least significant byte first. When communicating between systems with different endianness, data must be converted; middleware (e.g., RPC frameworks) often handles this transparently.
Process Hierarchies and Trees
Processes are organized in a tree structure. For example, Chrome starts a parent process that spawns child processes for each tab, UI, renderer, and plugin. The parent can terminate a child (closing a tab), and the system must handle orphan and zombie processes correctly.

Ask anything
We've read this whole study set, so questions about it get the best answers.