Operating Systems

What is an Operating System?; Functions of an Operating System; UNIX System Architecture

C-CAT

What is an Operating System?

Why is an OS Needed?

Basic functions of a computer:

  1. Data Storage — save data to storage devices

Data Processing — compute and transform data 3. Data Movement — transfer data between components 4. Control — coordinate all operations

Problem: Any user cannot communicate/interact directly with computer hardware to do different tasks. There is a need for some interface between user and hardware.

Solution: The Operating System

Definition of Operating System

An Operating System (OS) is system software that:

  • Manages computer hardware and software resources
  • Provides a common interface between users and hardware
  • Controls and coordinates use of hardware among various application programs for various users
  • Acts as a resource manager — allocates CPU, memory, I/O to processes

OS as an Intermediary

Applications (User Programs)
           ↕
    OPERATING SYSTEM
           ↕
      Hardware (CPU, Memory, I/O)

Popular Operating Systems

OSFamilyUse Case
Windows 11MicrosoftDesktop, Gaming
Ubuntu / DebianLinuxDevelopment, Server
macOSApple/UnixCreative, Development
AndroidLinux-basedMobile
iOSAppleMobile
UnixAT&T Bell LabsServer, Academic
LinuxOpen-source Unix-likeServer, Embedded

Functions of an Operating System

FunctionDescription
Process ManagementCreate, schedule, terminate processes; handle synchronization
Memory ManagementAllocate/deallocate memory; virtual memory management
File ManagementCreate/delete files and directories; access control
I/O ManagementControl I/O devices; provide device driver interface
Security & ProtectionProtect resources from unauthorized access
NetworkingTCP/IP stack; network communication
Error Detection & HandlingDetect hardware errors; take corrective action
User InterfaceCLI (command line) or GUI (graphical) interface

UNIX System Architecture

Overview

UNIX is one of the most influential operating systems ever designed (Bell Labs, 1969).

Major Subsystems of UNIX:

  1. File Subsystem — manages files and directories
  2. Process Control Subsystem — manages processes

UNIX Architecture Diagram

+-------------------------------------------------------+
|                  USER SPACE                           |
|   User Programs / Applications                        |
|   (Shell, Compiler, text editor, database client)    |
+------------------+-------------------------------------|
|       System Call Interface (API boundary)            |
+------------------+------------------------------------+
|                  KERNEL SPACE                         |
|   File Subsystem    |   Process Control Subsystem     |
|   (file operations) |   (process scheduling, IPC)    |
|   +---------------+ |   +-------------------------+   |
|   | File tables   | |   | CPU Scheduler           |   |
|   | Inodes        | |   | Memory Management       |   |
|   | Buffer cache  | |   | IPC (pipes, signals)    |   |
|   +---------------+ |   +-------------------------+   |
+----------------------+----------------------------------+
|         Hardware Control (Device Drivers)              |
+-------------------------------------------------------+
|               HARDWARE                                |
|   CPU | Memory | Disk | Network | Terminal            |
+-------------------------------------------------------+

UNIX Key Concepts

ConceptDescription
Everything is a fileDevices, sockets, pipes are represented as files
ShellCommand-line interface to the kernel (bash, sh, zsh, ksh)
PIDEvery process has a unique Process ID
UID/GIDUser ID and Group ID for security
File permissionsrwx for owner, group, others
KernelCore of the OS managing all resources
DaemonBackground process (like a service in Windows)

Continue learning

Related notes

Put this topic into timed practice

Open mock tests when you want full-exam pacing, or keep drilling in practice mode.