Operating system objectives, functions and types
Operating system objectives, functions and types — what an OS must provide, the services it gives, and the major classification of OS designs and families.
Drafted with Aria, reviewed by the AiCanCode.org team · Updated . How we write and check our notes. Spotted an error? Use Give Feedback at the bottom of the page.
Why it matters
Two or three sentences: where an engineer uses this. An operating system (OS) is the layer of software engineers depend on to run applications, manage hardware and provide services such as protection and I/O. Understanding OS objectives, functions and types lets an engineer choose or design the right OS for embedded systems, servers, real-time controllers or general-purpose desktops and to reason about performance, reliability and security trade-offs.
Key ideas
Build from first principles. Define terms before use and state assumptions.
Operating system (OS) — the software that acts as an intermediary between user programs and physical hardware; it provides an abstract machine and manages resources. (Assumes a von Neumann architecture and separate user/kernel modes unless otherwise stated.)
Kernel — the central part of the OS running in privileged mode; provides low-level services (process switching, device access, memory management). Kernel vs user-space: kernel code executes with higher privileges; user programs run unprivileged.
Process — an instance of a running program that the OS manages; typically has its own virtual address space (on systems with an MMU), CPU context, and resources. (Do not confuse with thread: a process may contain multiple threads.)
Thread — a schedulable unit of execution that shares a process address space but has its own CPU registers and stack.
Primary objectives of an OS (exact statements an exam expects):
- Correctness: ensure programs behave according to specification when interacting with hardware and other programs (handle errors, prevent crashes). Assumes correct implementation of protection mechanisms and system calls.
- Efficiency: maximise resource utilisation (CPU, memory, I/O) subject to constraints. Efficiency is quantified using metrics (see Formulas). Assumes measurable workload and steady-state behaviour.
- Fairness: allocate resources so no user or process is starved over long time spans. Requires scheduling and quota mechanisms.
- Abstraction and convenience: provide higher-level abstractions (files, virtual memory, processes) so programmers need not manage hardware details.
- Protection and security: prevent illegal access to resources and enforce policies (authentication, access control). Assumes hardware support for privilege levels and MMU.
- Portability: minimise hardware-dependent code so OS can be moved across architectures (e.g., separate machine-dependent and -independent layers).
- Reliability and availability: survive faults, support recovery and maintain service for required uptime (important in real-time and server systems).
Core functions of an OS with exact definitions and typical mechanisms:
- Process management — create, schedule, suspend, resume and terminate processes. Key mechanisms: process control block (PCB), context switch, CPU scheduler. Assumes preemption support for multitasking.
- Memory management — allocate and deallocate main memory, map virtual addresses to physical frames; provide protection and sharing. Mechanisms: contiguous allocation, paging, segmentation, TLB (see other topics list). Assumes MMU hardware.
- File system management — provide file abstraction, directories, access control, and persistent storage allocation. Mechanisms: inodes, FAT, journaling (refer to later topics: file systems in practice).
- I/O and device management — abstract hardware devices, provide drivers, buffering, and blocking/non-blocking I/O.
- Resource allocation and accounting — track resource usage, enforce quotas, and collect statistics for billing and performance tuning.
- Security and protection — enforce access controls, isolation between processes, and encryption/verification where needed.
- Networking and distributed services — manage sockets, protocols and distributed resources (refer to Distributed and network operating systems).
Types (classifications) of operating systems — exact categories and defining properties (draw diagrams when asked):
- By user model: single-user vs multi-user (single user can hold console; multi-user supports concurrent users).
- By task model: single-tasking vs multi-tasking (multi-tasking runs more than one process concurrently). Time-sharing is a form of multi-tasking with interactive response goals.
- By time constraints: batch, time-sharing, real-time (hard and soft). Define: hard real-time — missing a deadline is a system failure; soft real-time — deadlines desirable but occasional misses tolerated. Assumes known task deadlines and WCET analysis for hard real-time.
- By kernel structure/architecture: monolithic, microkernel, layered, modular/hybrid, exokernel. Describe kernel structures precisely (exam diagrams below).
- By system organization: standalone, network OS, distributed OS. Define: network OS provides services like remote login and networked file/print across distinct nodes; distributed OS provides a single-system image across multiple nodes with global naming/scheduling.
- By hardware: uniprocessor vs multiprocessor/multicore; include distinctions such as SMP (symmetric multiprocessing) vs AMP (asymmetric multiprocessing).
- By application domain: embedded OS (resource-constrained, often no MMU), desktop/server OS (general-purpose), mobile OS (power/GUI/sensor focused).
Diagrams to draw (describe exactly):
- Layered OS: draw vertical stack of rectangles labelled bottom->top: Hardware, Kernel (lowest layer), ..., User-level services, Applications. Add arrows showing only adjacent-layer calls. Label each layer number.
- Monolithic kernel: draw single large block labelled Kernel containing subsystems: file system, device drivers, network, memory manager; draw a line separating kernel and user space and show system-call interface.
- Microkernel: draw a small central block labelled Microkernel (IPC, minimal scheduling), around it several server boxes (file server, device server, network server) in user space, with arrows showing message passing (IPC) to and from user processes.
Precise comparisons (common exam question): list advantages/disadvantages of monolithic vs microkernel with clear assumptions (performance, reliability, portability).
Formulas
Each formula on its own line, what each symbol means, SI units, when it applies.
CPU_utilization = (CPU_busy_time) / (Total_time) — CPU_busy_time: time CPU was not idle (executing user or kernel code) (s); Total_time: observation period (s). Use when measuring average utilization.
Throughput = N_completed / Total_time — N_completed: number of jobs completed; Total_time in seconds (result unit: jobs/s). Use for system or device throughput.
Turnaround_time = Completion_time - Arrival_time — times in seconds; applies to batch or job scheduling metrics (see other topics for scheduling formulas).
Waiting_time = Turnaround_time - (CPU_burst_time + I/O_time) — times in seconds; applies to per-process scheduling analysis.
Response_time = Time_of_first_response - Arrival_time — seconds; important in interactive and time-sharing systems.
(No advanced physical constants needed here.)
Worked examples
- Numerical: CPU utilisation and throughput. Given: Over a 2-hour observation period (Total_time = 7200 s) a server's CPU was busy executing processes for 4860 s. During the period the system completed 360 jobs. Compute CPU utilization and throughput. Steps:
- Formula:
CPU_utilization = CPU_busy_time / Total_time. - Substitute:
CPU_utilization = 4860 s / 7200 s = 0.675. - So CPU utilisation = 67.5%.
- Throughput formula:
Throughput = N_completed / Total_time. - Substitute:
Throughput = 360 jobs / 7200 s = 0.05 jobs/s. - Convert throughput to jobs per minute: 0.05 × 60 = 3 jobs/minute. (Units: s for time, jobs/s or jobs/minute for throughput.)
- Theory: model answer — "Explain the functions of an operating system." (Exam style) A full answer begins with a one-line definition: "An operating system is system software that provides an interface between user programs and hardware and manages system resources." Then list and explain functions with short examples:
- Process management: creation, scheduling and termination of processes; context switching; example: CPU scheduler selects next process to run.
- Memory management: allocation, protection, virtual memory; example: paging maps virtual addresses to physical frames.
- File system: hierarchical namespace, access control, persistent storage; example: open/read/write/close system calls.
- I/O and device management: drivers, buffering and interrupt handling; example: DMA for disk transfer.
- Security and protection: authentication, access control lists, isolation; example: per-file permissions.
- Resource accounting: tracking CPU/time, storage usage for billing or quotas. Conclude with why these functions meet OS objectives: convenience, efficiency, protection and portability.
- Short constructed response: "Compare monolithic kernel and microkernel." (Model answer)
- Monolithic: single large kernel with many services in kernel space. Advantages: faster system calls/service invocations (fewer context switches to user-space servers). Disadvantages: larger code base, more bugs can crash OS, less modular.
- Microkernel: minimal kernel (scheduling, IPC, basic memory mgmt). Most services run in user-space servers. Advantages: better isolation, easier to extend and port. Disadvantages: more IPC overhead and potential performance cost. A full mark answer gives both definition, 2 pros and cons each, and notes about performance vs reliability trade-offs.
Common mistakes
- Mixing objectives: don’t equate portability with performance; they are often opposing goals.
- Forgetting units in formulas (report CPU busy time and total time in same units).
- In diagrams, failing to label user space vs kernel space or not showing IPC arrows for microkernel.
For your exam
Kinds of questions this topic produces:
- Definitions: define OS, kernel, process, thread, types of OS.
- Short notes: objectives of an OS, functions of process/memory/file management.
- Comparisons/diagrams: monolithic vs microkernel, layered OS — draw and explain.
- Derivations/metrics: compute CPU utilisation, throughput, turnaround time from supplied data. What a full-marks answer includes:
- Clear one-line definition, bold listing of objectives and functions, relevant assumptions, a labelled diagram when required, correct formulas with units, and concise examples or trade-offs.
Quick check
- Define "operating system" in one sentence.
- Name three primary objectives of an OS.
- Give one advantage and one disadvantage of a microkernel design.
Answers: 1) Software that mediates between hardware and user programs, providing abstractions and managing resources. 2) Efficiency (resource use), protection/security, and abstraction/convenience (also fairness, portability, reliability). 3) Advantage: better fault isolation and modularity; Disadvantage: higher IPC overhead and possible performance loss.
Finished this topic? Mark it so your progress, study plan and readiness keep up.
Stuck on something here?