Operating Systems
CSSD 111: Introduction to Computer Science – Week 5
Lecturer: Prof. Eric Amankwa (PhD)
Learning Objectives
• Define what an operating system is and its primary functions
• Trace the historical evolution of operating systems
• Understand operating system architecture (Kernel vs. System
Programs)
• Explain key OS functions:
• Process Management and Scheduling
• Memory Management
• File Systems
• Distinguish between different types of operating systems
What is an Operating System?
• An operating system is the software that supports a computer's basic
functions, such as scheduling tasks, executing applications, and
controlling peripherals
• The OS acts as an intermediary between the user/application
programs and the computer hardware.
• It's the core software component of the computer
Why Do We Need an Operating System?
• Without an OS:
• Every program would need its own drivers for every hardware device
• Only one program could run at a time
• Users would need to understand complex hardware details
• No standard way to store files
• With an OS:
• Hardware Abstraction: Programs don't need to know hardware details
• Multitasking: Multiple programs can run concurrently
• Resource Management: Fair allocation of CPU, memory, and I/O devices
• User Interface: Makes the computer accessible to humans
A Brief History: The Evolution of OS
Era Technology Key Characteristic
No OS; human operators loaded
1940s-1950s Resident Monitor programs manually. One program
at a time.
Multiple programs in memory;
1960s Multiprogramming CPU works while one program
waits for I/O.
Interactive systems; many users
1970s Timesharing connected via terminals; context
switching.
GUI introduced; single-user
1980s Personal Computers systems; DOS, early Mac OS,
Windows.
Distributed OS; multiprocessing;
1990s-Present Networked/Mobile real-time systems; Android, iOS,
Linux.
Evolution in Detail: Resident Monitor Era
(1940s-1950s)
• Hardware Context: Main memory measured in kilobytes; tape drives
were primary storage .
• Characteristics:
• One program ran at a time (sequential execution)
• The "resident monitor" was a small program permanently in memory
• Its only job: load a program, execute it, terminate it, then load the
next
• No protection between programs; a crashing program could take
down the whole system
• Analogy: A single-lane road with one car at a time, and a traffic
controller at the entrance letting cars in one by one.
Evolution: Multiprogramming (1960’s)
• Hardware Context: Memory became large enough to hold multiple
programs .
• The Problem:
Programs often wait for I/O (disk, keyboard, printer). During I/O, the CPU
sits idle.
• The Solution - Multiprogramming:
• Keep multiple programs in memory at once
• When Program A waits for I/O, the CPU switches to Program B
• Keeps the CPU busy almost 100% of the time
• Dramatically improves system throughput
• Analogy: A chef who starts preparing the next dish while waiting for water
to boil for the current dish.
Evolution: Timesharing (1970s)
• Hardware Context: Computers expensive; many users needed access.
• The Concept:
• Interactive multiprogramming
• Each user gets a small "slice" of CPU time (a timeslice)
• CPU switches rapidly between users (e.g., 100 times per second)
• Each user feels like they have the entire machine to themselves
• Key Mechanism - Context Switch:
When a process is taken from the CPU and replaced by another, we say that
a context switch has occurred . The OS saves the state of the current
process and loads the saved state of the next process.
• Analogy: A teacher attending to students in a classroom, spending a few
minutes with each, so every student gets individual attention.
Evolution: Personal Computer Era - 1980s
onwards
• Hardware Context: Affordable personal computers; one user per machine.
• Characteristics:
• Designed for ease of use rather than high performance
• Introduction of Graphical User Interfaces (GUIs) (Mac OS 1984, Windows
3.0 1990)
• Single-user, but multitasking between applications
• GUIs made computers accessible to users with little formal computer
education
• The BIOS Innovation:
The BIOS (Basic Input-Output Operating System) chip permitted a single
operating system to function on different types of small systems by
handling the details of divergent peripheral device designs
Evolution: Networked, Mobile, and Modern
Systems - 1990s - Present
• Modern OS Types:
• Distributed Systems: Loosely coupled multiprocessor systems with
physically separate memory; they appear as a single system to users
• Networked Systems: Collections of interconnected, collaborating
workstations
• Real-Time Operating Systems (RTOS): Control computers that
respond to their environment
• Hard real-time: Tight timing constraints (e.g., aircraft control)
• Soft real-time: Less strict (e.g., multimedia systems)
• Mobile OS: iOS, Android – designed for touch, power efficiency, and
constant network connectivity
Operating System Architecture
• Two Crucial Components :
• The Kernel
• The core of the operating system
• Always resides in memory
• Performs: scheduling, synchronization, memory management, interrupt
handling
• Provides security and protection
• System Programs
• Utilities that help use the system (file managers, command shells,
configuration tools)
• Not part of the kernel, but essential for usability
Kernel Design: Monolithic vs. Microkernel
Monolithic Kernel Microkernel
All OS services in one large program Minimal kernel with basic services
Fast execution (everything in one place) Better security, easier maintenance
Difficult to port to new hardware More portable
If one part crashes, entire system can Services run as separate processes;
fail failure isolated
Examples: Linux, MacOS, DOS Examples: Windows 2000, Mach, QNX
Core Function #1: Process Management
• A process is a program in execution.
• Process Management Responsibilities :
• Creating and deleting processes
• Scheduling process access to the CPU
• Suspending and resuming processes
• Providing synchronization mechanisms for processes that share
resources
• Providing inter-process communication services
• Process States:
• New: Being created
• Ready: Ready to run, waiting for CPU
• Running: Currently using CPU
• Waiting: Blocked, waiting for I/O or an event
• Terminated: Finished execution
CPU Scheduling: The Decision Maker
• Two Levels of Scheduling :
• 1. Long-Term Scheduling:
• Determines which processes shall be granted access to the CPU
(admitted to the ready queue)
• 2. Short-Term Scheduling:
• Determines which ready process will have access to the CPU at any
particular moment
• Context Switch:
When a process is taken from the CPU and replaced by another,
information relating to the state of the process is preserved so it can
be resumed late
Preemptive vs. Nonpreemptive Scheduling
Nonpreemptive Preemptive
A process keeps the CPU until it Each process is allocated a
terminates or voluntarily waits for I/O fixed timeslice
When timeslice expires, a context switch
Simple to implement; low overhead
occurs
Can lead to unfairness – one long Can also switch if a higher-priority
process hogs CPU process needs CPU
Used in older batch systems Used in modern interactive systems
CPU Scheduling Algorithms (1) - First-Come,
First-Served (FCFS)
•Jobs serviced in arrival sequence; run to completion
•Simple, but short jobs can get stuck behind long ones
•Analogy: Single queue at a bank
Algorithm 2: Shortest Job First
•Smallest jobs get scheduled first
•Minimizes average waiting time
•Problem: How do you know which job is
shortest? (Must estimate/predict)
•Risk: Long jobs may never run ("starvation")
Algorithm 3: Round Robin
• Each job is allotted a fixed amount of CPU time (a timeslice or
quantum)
• A context switch occurs when the time expires
• If a process finishes early, it releases CPU voluntarily
• Fair and responsive – ideal for timesharing systems
• Key parameter: The quantum size (typically 10-100ms)
Algorithm 4: Priority Scheduling
• Each process has a priority
• A higher-priority process preempts a lower-priority one when it needs
the CPU
• Problem: Low-priority processes may never run (starvation)
• Solution: "Aging" – gradually increase priority of waiting processes
Core Function #2: Memory Management
• Objectives:
• Allocate memory efficiently among competing processes
• Protect processes from interfering with each other's memory
• Provide memory abstraction (virtual memory) so programs see a simpler
view
• Key Concepts:
• Multiprogramming: Multiple processes in memory simultaneously
• Memory Protection:
• A process should not be able to read or write another process's memory
• Requires hardware support (base and limit registers, or paging hardware)
• Memory Allocation Strategies:
• Fixed partitions
• Variable partitions
• Paging (dividing memory into fixed-size frames and pages)
Virtual Memory
• The Problem:
Physical RAM is limited. What if a program needs more memory than
is physically available?
• The Solution: Virtual Memory
• Allows programs to execute even if they are larger than physical
memory
• Uses disk space as an extension of RAM
• Only parts of the program currently needed are kept in RAM
• Rest stays on disk until needed
• Mechanism:
• Memory divided into fixed-size pages (e.g., 4KB)
• When a program accesses a page not in RAM → page fault
• OS loads the needed page from disk, possibly writing another page
back to disk
• Analogy: A large reference book – you don't keep it all in your head;
you only keep the current chapter on your desk, and go back to the
shelf when you need another chapter.
Core Function #3: File System Management
• Purpose:
Provide a logical, user-friendly view of data stored on physical media
(disks, SSDs, USB drives).
• Key Responsibilities:
• Organizing files into directories/folders (hierarchical structure)
• Naming – allowing users to refer to data by human-readable names,
not disk addresses
• Access control – who can read/write/execute which files
• Allocation – tracking which disk blocks belong to which files
• Metadata management – storing information about files (size,
creation date, owner, permissions)
• Common File Systems:
• NTFS (Windows)
• ext4 (Linux)
• APFS (macOS)
• FAT32/exFAT (cross-platform compatibility)
Types of Operating Systems
Type Characteristics Examples
Jobs with similar needs grouped;
Batch OS Early mainframe systems
minimal user interaction
Multiple users interact
Timesharing OS UNIX, MULTICS
simultaneously; context switching
Multiple computers appear as single
Distributed OS Modern cloud platforms
system to user
Computers communicate over
Network OS Windows Server, Novell
network; each retains own OS
Deterministic response times; hard
Real-Time OS VxWorks, QNX, RTLinux
vs. soft real-time
Touch-optimized; power-efficient;
Mobile OS Android, iOS
app-focused
Built into devices; often
Embedded OS FreeRTOS, embedded Linux
single-purpose
Popular Operating Systems
• Desktop/Laptop:
• Microsoft Windows: Most common on PCs; GUI-focused; wide software support
• macOS: Apple's OS; Unix-based; known for design and creative professional focus
• Linux: Open-source; many distributions (Ubuntu, Fedora); popular for servers and
developers
• Mobile:
• Android: Google; open-source; most worldwide market share
• iOS: Apple; proprietary; iPhone/iPad
• Server/Enterprise:
• Linux: Dominates web servers, cloud infrastructure
• Windows Server: Common in corporate environments with Microsoft ecosystems
Security and Protection
• The OS Role in Security:
• Authentication: Verifying user identity (passwords, biometrics,
tokens)
• Authorization: Controlling access to resources (files, devices)
• Isolation: Keeping processes separate so they can't interfere
• Auditing: Logging security-relevant events
• Protection Mechanisms:
• User accounts with different privilege levels
• File permissions (read/write/execute for owner/group/others)
• Memory protection (hardware-enforced)
• Kernel/user mode separation – critical operations require kernel
privileges
• Analogy: The OS is like a security guard who checks IDs, ensures
people only go to authorized areas, and keeps logs of who enters the
building.
Practical Lab: Command Line Basics
• Lab Objectives:
• Navigate the file system using command-line commands
• Create, copy, move, and delete files and directories
• View running processes
• Check system information
Common Commands (Windows Command
Prompt):
•dir – List files in current directory
•cd – Change directory
•mkdir – Create a new directory
•copy – Copy files
•del – Delete files
•tasklist – Show running processes
Lecture Summary: Key Takeaways
• An Operating System is core software that manages hardware and provides
services for applications
• OS evolution has progressed from simple resident monitors to
multiprogramming, timesharing, and modern networked/mobile systems
• OS architecture consists of the kernel (core services) and system programs
(utilities)
• Process management involves scheduling CPU time using algorithms like
FCFS, Round Robin, and Priority scheduling
• Memory management includes allocation, protection, and virtual memory
• File systems organize persistent data hierarchically
• Different OS types exist for different needs: desktop, server, mobile,
real-time, embedded
Required Reading
• Brookshear & Brylow – Chapter 3: "Operating Systems"
• Review the chapter sections on:
• History of Operating Systems (3.1)
• Operating System Architecture (3.2)
• Coordinating the Machine's Activities (3.3)
• Handling Competition Among Processes (3.4)
Assignment - In your own words
• Why do you think Linux became so dominant in servers but not on
the desktop?
• What scheduling algorithm do you think your phone's OS uses?
• If you were designing an OS for a self-driving car, what features would
be most critical?
• How does an operating system know when to switch between
running programs?
• Due date: one week from given date
• Mode of submission: via course email address