Refined Comprehensive Study Notes
These notes combine and refine the key ideas repeated across the six slide sets. The material follows a logical progression:
An operating system (OS) is system software that manages computer hardware and software resources and provides services for application programs. It acts as:
As an intermediary, it allows users and applications to interact with hardware through a controlled interface.
As a resource allocator, it decides how CPU time, memory, storage, and I/O devices are distributed.
As a control program, it supervises execution and prevents improper or unsafe use of system resources.
A computer system is commonly viewed as:
At a lower level, the main hardware elements are:
The CPU executes instructions and uses registers such as:
The processor repeatedly performs:
This cycle continues until an interrupt or exception changes the flow.
An interrupt is a signal that causes the CPU to suspend its current work and handle an event.
I/O devices are slower than the CPU. Instead of forcing the processor to constantly check devices, the system lets devices notify the CPU when something important happens.
Memory is organized as a hierarchy:
Main memory: volatile, directly used by the CPU.
Secondary storage: nonvolatile, used for files and long-term storage.
Cache memory:
Booting is the process of starting the computer and loading the operating system.
The kernel is the central core of the operating system. It is responsible for the most critical system functions and remains active while the system runs.
Hardware support that makes this protection possible:
The OS provides services both for users/programs and for efficient system operation.
user interface, program execution, I/O operations, file-system manipulation, communication, error detection
resource allocation, accounting, protection and security
editors, debuggers, loaders, status/monitoring tools
A system call is the programming interface through which a user program requests a service from the kernel.
Programs use APIs instead of raw calls:
Parameter passing techniques: registers, memory block/table, stack.
These concepts are easy to confuse, so they must be kept separate.
A process is a program in execution.
A process includes:
Important distinction:
Program = passive entity
Process = active entity
Two running copies of the same program are two separate processes because they have different execution contexts.
A context switch happens when the CPU stops running one process and starts running another.
Saved/restored items (stored in PCB):
registers, program counter, stack pointer, process state, scheduling info.
Important note:
A context switch is overhead. During the switch itself, the CPU is not doing useful work for user programs.
The OS stores process information in a process table. Each entry is a PCB (Process Control Block), which typically contains:
The PCB allows the OS to pause and later resume a process correctly.
fork() creates a child process as a copy of the parent.exec() replaces the child’s memory image with a new program.PID behavior after fork():
pid == 0 → currently in child
pid > 0 → currently in parent (value is child PID)
After fork(), both parent and child continue execution from the same point. Always check PID!
Unsafe pattern:
fork();
execl(...); // Might overwrite parent!
Correct pattern:
pid = fork();
if (pid == 0) {
execl(...);
} else {
// parent code
}
Gives programs the illusion of a larger logical memory space. Allows programs to run even when not fully in RAM.
Divides memory into fixed-size pages. Virtual address = page number + offset
Logical: seen by process.
Physical: real RAM address.
Hardware unit responsible for translating logical to physical addresses.
create/delete/open/close/read/write files & directories, manage structures, backup support.
free-space management, storage allocation, disk scheduling.
coordination via drivers/controllers, allocation, status tracking, synchronized hardware use.
Loadable kernel modules separate core components and load when needed. Modern systems are hybrid, balancing monolithic performance with microkernel security/modularity.
Users interact with system programs (compilers, file tools). Background services (daemons) start at boot to handle logging, printing, etc.
These slides together explain that a computer system is built from processor, memory, I/O, and storage hardware, and that the operating system is the protected software layer that manages all of these resources. The OS provides services, controls execution, handles interrupts, supports memory management, organizes files and devices, and protects the system. Processes are the main execution unit, and the OS must create, schedule, suspend, resume, and terminate them correctly. Modern operating-system design also depends on architecture choices such as monolithic kernels, microkernels, modularity, and multiprocessing.