Study Guides/Computer Science/Functions of the Operating System
Study Guide Ā· Computer Science

Functions of the Operating System — All Major Functions Explained

Functions of the operating system include process management, memory management, file management, device management, security and protection, and providing a user interface. An operating system (OS) is system software that acts as an intermediary between the user and computer hardware — it manages all hardware resources and provides services to application programs. Without an OS, users would have to interact directly with hardware using machine code. Every computer, smartphone, and server runs an operating system — common examples are Windows, macOS, Linux, Android, and iOS. This guide covers all major functions of the operating system with clear explanations, examples, and exam-ready FAQs.

Question (Click to Flip)

What are the main functions of an operating system?

Answer

The six main functions of an operating system are: (1) Process Management — creating, scheduling, and terminating processes. (2) Memory Management — allocating RAM, virtual memory, and memory protection. (3) File Management — organising, storing, and retrieving files. (4) Device Management — controlling I/O devices through drivers. (5) Security and Protection — authentication, access control, and encryption. (6) User Interface — providing GUI or CLI for user interaction.

Card 1 of 3 free previews

Key Facts

An operating system manages hardware resources and provides services to applications

6 main functions: process management, memory management, file management, device management, security, user interface

Process management handles CPU scheduling, multitasking, and process lifecycle

Memory management controls RAM allocation, virtual memory, and memory protection

File management organises data in directories with permissions (R/W/X)

Device management uses drivers to communicate with hardware devices

Security includes authentication, authorisation, encryption, and malware protection

User interface can be GUI (graphical) or CLI (command line)

Common OS: Windows, macOS, Linux, Android, iOS

The OS is loaded during booting and runs until the computer shuts down

What Is an Operating System?

An operating system (OS) is system software that manages computer hardware and software resources and provides common services for computer programs.

Key roles of an OS: • Acts as an intermediary between the user and the hardware • Manages all computer resources (CPU, memory, storage, I/O devices) • Provides a platform for application programs to run • Ensures efficient and fair use of resources among multiple programs and users

Examples of operating systems: • Desktop/Laptop: Windows 11, macOS, Ubuntu Linux, Chrome OS • Mobile: Android, iOS • Server: Windows Server, Red Hat Enterprise Linux, Ubuntu Server • Embedded: RTOS (Real-Time OS), FreeRTOS, VxWorks

Without an OS: • Users would need to write machine-level code to interact with hardware • No multitasking — only one program could run at a time • No file management — data stored as raw bytes with no organisation • No security — any program could access any resource

The OS is the first software loaded when a computer starts (booting) and the last to shut down.

The 6 Main Functions of the Operating System

The operating system performs six major functions:

  1. Process Management → Creates, schedules, and terminates processes (running programs)

  2. Memory Management → Allocates and deallocates RAM to processes, manages virtual memory

  3. File Management → Organises, stores, retrieves, and protects files on storage devices

  4. Device Management (I/O Management) → Controls all input/output devices through device drivers

  5. Security and Protection → Protects data and resources through authentication, authorisation, and access control

  6. User Interface → Provides GUI (Graphical User Interface) or CLI (Command Line Interface) for user interaction

Additional functions: • Networking — manages network connections and communication • Error detection and handling — detects hardware/software errors and takes corrective action • Resource allocation — distributes resources fairly among competing processes • Accounting — tracks which users/processes use how many resources • Booting — loads the OS into memory when the computer starts

Function 1 — Process Management

A process is a program in execution. Process management is one of the most critical functions of the OS.

What the OS does: • Creates processes when programs are launched • Allocates CPU time to each process • Schedules processes using scheduling algorithms • Manages process states: New → Ready → Running → Waiting → Terminated • Handles multitasking — running multiple processes simultaneously (or appearing to) • Manages inter-process communication (IPC) — processes sharing data • Terminates processes when they finish or when errors occur • Handles deadlocks — when two or more processes are stuck waiting for each other

Process vs Program: • Program: a file stored on disk (passive entity) • Process: a program loaded into memory and executing (active entity) • One program can create multiple processes (e.g., opening two Chrome windows)

CPU Scheduling Algorithms: • FCFS (First Come First Served) — processes run in arrival order • SJF (Shortest Job First) — shortest process runs first • Round Robin — each process gets a fixed time slice in rotation • Priority Scheduling — highest priority process runs first • Multilevel Queue — processes grouped into queues by priority

Example: When you open a browser, music player, and word processor simultaneously, the OS manages all three processes — giving each CPU time so they appear to run at the same time.

Function 2 — Memory Management

Memory management is how the OS controls and coordinates the use of RAM (main memory).

What the OS does: • Keeps track of which parts of memory are in use and which are free • Allocates memory to processes when they need it • Deallocates memory when processes finish or no longer need it • Manages virtual memory — uses disk space as an extension of RAM • Prevents processes from accessing each other's memory (memory protection) • Handles swapping — moving processes between RAM and disk when memory is full

Key concepts:

  1. RAM Allocation • Each process needs a portion of RAM to run • OS decides how much memory each process gets • If RAM is full, some processes are swapped to disk (virtual memory)

  2. Virtual Memory • Makes the computer appear to have more RAM than it physically has • Uses a portion of the hard disk/SSD as 'virtual' RAM (called swap space or page file) • Allows running programs larger than physical RAM • Example: A PC with 8 GB RAM can run programs needing 12 GB using virtual memory

  3. Paging • Memory is divided into fixed-size blocks called pages (in logical memory) and frames (in physical memory) • OS maps pages to frames using a page table • Allows non-contiguous memory allocation

  4. Memory Protection • OS ensures one process cannot read or write another process's memory • Prevents crashes and security breaches

Function 3 — File Management

The file system is how the OS organises, stores, retrieves, and manages data on storage devices (hard drives, SSDs, USB drives).

What the OS does: • Creates, reads, writes, and deletes files • Organises files into directories (folders) in a hierarchical structure • Manages file permissions (who can read, write, or execute a file) • Tracks file locations on the storage device • Handles file naming, extensions, and metadata (size, date, type) • Manages disk space — allocates and frees storage blocks • Provides file search and retrieval functions

File system types: • NTFS — Windows (supports large files, permissions, encryption) • ext4 — Linux (default file system, journaling) • APFS — macOS (optimised for SSD, encryption) • FAT32 — universal (USB drives, memory cards, max file size 4 GB) • exFAT — universal (USB drives, no 4 GB limit)

File operations managed by OS: • Create — make a new file • Open — load file for reading or editing • Read — retrieve data from a file • Write — add or modify data in a file • Delete — remove a file from storage • Rename — change a file's name • Copy/Move — duplicate or relocate a file • Set permissions — control access (read/write/execute)

Example: When you save a document, the OS finds free space on the disk, writes the data, updates the directory entry, and records the file's location — all invisibly.

Function 4 — Device Management (I/O Management)

Device management is how the OS controls and communicates with all hardware devices connected to the computer.

What the OS does: • Manages all input/output (I/O) devices — keyboard, mouse, monitor, printer, USB drives, etc. • Uses device drivers — special software that translates OS commands into device-specific commands • Allocates devices to processes (e.g., which process can use the printer) • Handles data transfer between devices and the CPU/memory • Manages buffers (temporary storage for data being transferred) • Uses spooling for devices like printers — stores print jobs in a queue

Device drivers: • Every hardware device needs a driver to communicate with the OS • Drivers act as translators between the OS and the hardware • When you install a new printer, you install its driver so the OS can communicate with it • Plug and Play (PnP) — modern OS automatically detects and installs drivers for new devices

I/O techniques: • Programmed I/O — CPU waits for device (slow, wastes CPU time) • Interrupt-driven I/O — device sends an interrupt when ready (more efficient) • DMA (Direct Memory Access) — device transfers data directly to memory without CPU (fastest)

Example: When you press a key on the keyboard, the keyboard sends a signal → the device driver interprets it → the OS passes the character to the active application. All of this happens in milliseconds.

Function 5 — Security and Protection

The OS is responsible for protecting the system from unauthorised access, malware, and data breaches.

What the OS does:

  1. Authentication • Verifies user identity — passwords, PINs, biometrics (fingerprint, face recognition) • User must log in before accessing the system • Multi-factor authentication (MFA) for additional security

  2. Authorisation and Access Control • Determines what resources a user/process can access • File permissions: Read (R), Write (W), Execute (X) • User roles: Administrator (full access), Standard User (limited access), Guest • In Linux: owner, group, and others each have separate R/W/X permissions

  3. Memory Protection • Prevents one process from accessing another process's memory space • Uses hardware support (MMU — Memory Management Unit) • Prevents malicious programs from reading sensitive data of other programs

  4. Firewall and Network Security • Built-in firewall controls incoming and outgoing network traffic • Monitors for suspicious network activity

  5. Encryption • OS can encrypt files and drives (e.g., BitLocker in Windows, FileVault in macOS) • Protects data even if the physical drive is stolen

  6. Malware Protection • Modern OS includes built-in antivirus/antimalware (e.g., Windows Defender) • Scans files and programs for known threats

  7. Auditing and Logging • Records system events — login attempts, file access, errors • Helps detect and investigate security breaches

Function 6 — User Interface

The user interface is how the user interacts with the operating system and the computer.

The OS provides two main types of interface:

  1. GUI (Graphical User Interface) • Visual interface with windows, icons, menus, and pointers (WIMP) • User interacts using mouse/touchscreen — click, drag, tap • Examples: Windows desktop, macOS Finder, Ubuntu GNOME, Android home screen • Advantages: easy to learn, intuitive, visual feedback • Disadvantages: uses more system resources, slower for advanced tasks

  2. CLI (Command Line Interface) • Text-based interface where users type commands • Examples: Windows Command Prompt, PowerShell, Linux Terminal (Bash), macOS Terminal • Advantages: powerful, fast for experienced users, uses fewer resources, scriptable (automation) • Disadvantages: steep learning curve, must memorise commands

  3. Touch Interface • Designed for touchscreens — swipe, pinch, tap gestures • Examples: Android, iOS, iPadOS • Optimised for mobile devices

The OS also provides: • Desktop environment — wallpaper, taskbar, start menu, system tray • Window management — open, close, minimise, maximise, resize windows • Notifications — alerts from apps and the system • Settings/Control Panel — configure system preferences • Task Manager — view and control running processes

Example: When you double-click a file, the GUI sends the request to the OS, which finds the file on disk, identifies the correct application, loads it into memory, and displays the result — all within seconds.

Additional Functions of the Operating System

Beyond the 6 main functions, the OS also handles:

  1. Networking • Manages network connections (Wi-Fi, Ethernet, Bluetooth) • Handles TCP/IP protocols for internet communication • File sharing across networks • DNS resolution — translating domain names to IP addresses

  2. Error Detection and Handling • Detects hardware errors (disk failure, memory errors) • Detects software errors (crashes, infinite loops) • Displays error messages (Blue Screen of Death in Windows, Kernel Panic in Linux/macOS) • Takes corrective action — restart process, log error, alert user

  3. Resource Allocation • Distributes CPU time, memory, and I/O devices fairly among competing processes • Prevents any one process from monopolising resources (starvation) • Uses scheduling algorithms to ensure fairness

  4. Booting • The startup process that loads the OS into memory • Steps: Power ON → BIOS/UEFI → POST (Power-On Self Test) → Boot loader → OS kernel loads → User login • Cold boot: starting from power off • Warm boot: restarting without power off (Ctrl+Alt+Del)

  5. Job Accounting • Tracks which users and processes use how many resources • Useful in multi-user systems for billing or performance analysis

  6. Batch Processing • Groups similar jobs together and processes them sequentially without user interaction • Used in payroll systems, bank transactions, report generation

Types of Operating Systems

Operating systems are classified by how they function:

  1. Batch Operating System • Groups similar jobs and processes them without user interaction • Example: early mainframe OS, IBM OS/360

  2. Multi-programming OS • Multiple programs loaded in memory simultaneously • CPU switches between programs to maximise utilisation

  3. Multitasking / Time-sharing OS • Multiple users/processes share CPU time in rapid rotation • Each user gets a time slice • Examples: Unix, Linux, Windows

  4. Real-Time OS (RTOS) • Processes data immediately with guaranteed response time • Used in: aircraft systems, medical devices, industrial robots, ABS brakes • Types: Hard RTOS (strict deadlines) and Soft RTOS (flexible deadlines)

  5. Distributed OS • Manages a group of networked computers as a single system • Examples: Google's infrastructure, Apache Hadoop

  6. Network OS • Manages network resources — file sharing, printer sharing, user management • Examples: Windows Server, Novell NetWare

  7. Mobile OS • Designed for smartphones and tablets • Examples: Android, iOS • Optimised for touch input, battery life, and mobile hardware

  8. Embedded OS • Built into specialised devices (not general-purpose computers) • Examples: OS in washing machines, smart TVs, ATMs, cars

Questions and Answers

What are the main functions of an operating system?+

The six main functions of an operating system are: (1) Process Management — creating, scheduling, and terminating processes. (2) Memory Management — allocating RAM, virtual memory, and memory protection. (3) File Management — organising, storing, and retrieving files. (4) Device Management — controlling I/O devices through drivers. (5) Security and Protection — authentication, access control, and encryption. (6) User Interface — providing GUI or CLI for user interaction.

What is process management in an operating system?+

Process management is how the OS handles running programs (processes). It creates processes, allocates CPU time using scheduling algorithms (FCFS, SJF, Round Robin), manages process states (Ready, Running, Waiting, Terminated), enables multitasking, handles inter-process communication, resolves deadlocks, and terminates processes. It ensures multiple programs can run simultaneously by rapidly switching CPU time between them.

What is memory management in an OS?+

Memory management is how the OS controls RAM usage. It tracks which memory is free or in use, allocates memory to processes, deallocates it when done, manages virtual memory (using disk as extended RAM), implements paging (dividing memory into fixed blocks), and provides memory protection (preventing processes from accessing each other's memory). Virtual memory allows running programs larger than physical RAM.

What is the difference between GUI and CLI?+

GUI (Graphical User Interface) uses visual elements — windows, icons, menus, and a mouse pointer. It is easy to learn and intuitive (e.g., Windows desktop, macOS). CLI (Command Line Interface) is text-based — users type commands to interact with the OS (e.g., Linux Terminal, Windows Command Prompt). CLI is more powerful and faster for experienced users but has a steep learning curve. GUI uses more system resources than CLI.

How does the OS manage devices?+

The OS manages devices through device drivers — software that translates OS commands into device-specific instructions. It allocates devices to processes, handles data transfer using techniques like interrupt-driven I/O and DMA (Direct Memory Access), manages buffers for temporary data storage, and uses spooling for printers. Modern OS supports Plug and Play (PnP), automatically detecting and installing drivers for new devices.

What is virtual memory?+

Virtual memory is a memory management technique where the OS uses a portion of the hard disk/SSD as an extension of RAM. When physical RAM is full, the OS swaps less-used data to disk (swap space/page file) and loads active data into RAM. This allows running programs that need more memory than the physical RAM available. For example, a PC with 8 GB RAM can run programs needing 12 GB using virtual memory.

How does the operating system provide security?+

The OS provides security through: (1) Authentication — verifying user identity via passwords, PINs, biometrics. (2) Authorisation — controlling what resources users/processes can access (file permissions: read, write, execute). (3) Memory protection — preventing processes from accessing each other's memory. (4) Firewall — controlling network traffic. (5) Encryption — protecting data (BitLocker, FileVault). (6) Antimalware — scanning for threats (Windows Defender). (7) Auditing — logging system events.

What are examples of operating systems?+

Desktop/Laptop OS: Windows 11, macOS, Ubuntu Linux, Chrome OS. Mobile OS: Android, iOS. Server OS: Windows Server, Red Hat Enterprise Linux. Real-time OS: FreeRTOS, VxWorks (used in aircraft, medical devices). Embedded OS: found in smart TVs, washing machines, ATMs. The most widely used OS worldwide is Android (mobile) and Windows (desktop).

More in Computer Science

Study Smarter with Shinyu.ai

Turn this guide into revision flashcards, a practice exam, or an AI-generated podcast — free, no signup required.