🖥️ Enroll in OS Course →
🖥️ Free Lecture Notes

Operating Systems
— Complete DIT Notes

All 5 modules — architecture, processes, memory, file systems, and CLI administration — with Windows vs Linux comparisons and every practical lab included. Free to read — no account needed.

✓ 100% Free 5 Modules 6 Practical Labs
MODULE 01

OS Fundamentals & Architecture

What an operating system actually does, how kernels are built, and what happens in the seconds before you see a login screen.

What Is an Operating System?

An OS is the software layer that sits between your hardware and every program you run. It allocates CPU time, manages memory, controls storage, and enforces security — so applications never have to talk to hardware directly.

OS design evolved through stages: Batch (jobs queued, no interaction) → Multiprogramming (multiple jobs held in memory, CPU switches between them) → Time-Sharing (multiple users, fast switching creates the illusion of simultaneity) → Real-Time (guaranteed response times for critical systems like medical devices or industrial control).

Kernel Architecture & System Calls

The kernel is the core of the OS — the part that actually talks to hardware. A Monolithic kernel (Linux) runs almost everything — drivers, file systems, memory management — in one privileged space for speed. A Microkernel (older QNX, parts of Windows NT) keeps only the bare essentials in privileged space and runs the rest as separate services, trading some speed for stability and security.

Programs never touch hardware themselves — they ask the kernel through system calls (e.g. open(), read(), fork()). This is the boundary between User Mode (where your applications run, restricted) and Kernel Mode (full hardware access, trusted code only).

Boot Process — Linux vs Windows
StageLinuxWindows
FirmwareBIOS or UEFI initializes hardwareBIOS or UEFI initializes hardware
Partition tableMBR (legacy) or GPT (UEFI)MBR (legacy) or GPT (UEFI)
BootloaderGRUB2 — shows a kernel selection menuWindows Boot Manager (bootmgr)
Kernel initKernel loads, mounts root filesystem, starts systemdntoskrnl.exe loads, starts Session Manager
First processsystemd (PID 1) starts all servicesServices.exe starts Windows services
View boot logsjournalctl -b or dmesgEvent Viewer → System log
Practical — Lab 1: Virtualization & Installation
# Install a hypervisor (Oracle VM VirtualBox or VMware Workstation)
# Then create two VMs for this course:

1. Create VM #1 # Desktop OS — install Windows 10/11
2. Create VM #2 # Server/CLI OS — install Ubuntu Server or Debian

# Recommended VM specs for both:
RAM:    2 GB minimum # (4 GB for Windows)
Disk:   20 GB dynamically allocated
Network: Bridged or NAT — NAT is simpler for a first install
Kernel
The core program that manages hardware and grants access to it via system calls.
System Call
A controlled request an application makes to the kernel — the only way to touch hardware.
BIOS / UEFI
Firmware that initializes hardware and hands control to the bootloader. UEFI is the modern replacement for BIOS.
MBR / GPT
Two partition table formats. GPT is newer, supports larger disks and more partitions.
Bootloader
The program that loads the kernel into memory — GRUB2 on Linux, Boot Manager on Windows.
Real-Time OS
An OS designed to guarantee a task completes within a fixed time window — used in embedded/industrial systems.
💡

Try it: After installing your Linux VM, run systemctl list-units --type=service --state=running to see everything systemd started during boot.


MODULE 02

Process & Thread Management

How the OS tracks every running program, decides who gets the CPU next, and what can go wrong when programs compete for resources.

Process Concepts

Every running program is a process, tracked by the kernel through a Process Control Block (PCB) — a data structure holding its ID, state, register values, memory pointers, and priority.

A process moves through five states: New (being created) → Ready (waiting for CPU) → Running (executing) → Waiting (blocked on I/O) → Terminated. It can bounce between Ready and Running many times before finishing.

CPU Scheduling

Since one CPU core can only run one instruction at a time, the OS uses schedulers to decide execution order. The long-term scheduler decides which processes enter the Ready queue; the short-term scheduler decides which Ready process runs next — this happens constantly, via context switching (saving one process's state, loading another's).

CPU Scheduling Algorithms
AlgorithmHow it picksTrade-off
FIFO / FCFSFirst process to arrive runs firstSimple, but a long job blocks everyone behind it
SJFShortest job runs nextMinimizes average wait time, but needs to know job length in advance
Round RobinEach process gets a fixed time slice, then goes to the back of the queueFair for interactive systems, more context-switch overhead
PriorityHighest-priority process runs firstFast for urgent tasks, risks starving low-priority ones

Threads & Concurrency

A thread is a lightweight unit of execution inside a process — multiple threads in one process share the same memory space, unlike separate processes which are isolated. A single-threaded app does one thing at a time; a multi-threaded app (e.g. a web browser) runs several tasks concurrently within the same process. A basic hazard to know: a deadlock happens when two processes each hold a resource the other needs, and neither can proceed.

View & manage processes — Linux vs Windows
# Linux
ps aux                 # list all running processes
top                     # live process monitor
kill -9 <PID>           # force-terminate a process

# Windows (CMD/PowerShell — used in Lab 2)
tasklist                # list all running processes
taskkill /PID <pid> /F  # force-terminate a process
PCB
Process Control Block — the kernel's record of everything it needs to know about a process.
Context Switch
Saving the state of one process and loading another so the CPU can move on.
Thread
A lightweight execution unit within a process; threads in the same process share memory.
Deadlock
A standstill where two or more processes each wait on a resource the other is holding.
ℹ️

Windows equivalent of top: Task Manager's Details tab shows live CPU/memory per process — same information, GUI instead of terminal.


MODULE 03

Memory Management

How the OS gives every process the illusion of having its own private, unlimited memory — with a fixed amount of physical RAM.

Address Spaces & Linking

A process works with a logical (virtual) address space — addresses it thinks it owns. The Memory Management Unit translates these to physical addresses in real RAM. Dynamic loading loads a routine into memory only when it's called; dynamic linking connects a program to shared libraries at run time instead of baking them in at compile time.

Swapping & Fragmentation

Swapping temporarily moves an inactive process out of RAM to disk to free space for others. With contiguous allocation, memory develops internal fragmentation (wasted space inside an allocated block) and external fragmentation (free memory scattered in unusable small chunks) — solved by periodic compaction, which shuffles processes together to consolidate free space.

Paging, Segmentation & Virtual Memory

Paging splits memory into fixed-size pages, tracked in a per-process page table; a TLB (Translation Lookaside Buffer) caches recent translations for speed. Segmentation instead divides memory by logical unit (code, stack, heap) with variable sizes. Virtual memory combines these ideas with demand paging — pages load only when actually needed, triggering a page fault if a needed page isn't in RAM. When RAM is full, a page replacement algorithm decides what to evict.

Page Replacement Algorithms
AlgorithmRule
FIFOEvict the page that has been in memory the longest
LRUEvict the page that hasn't been used for the longest time — usually a better predictor of future use
Check memory usage — Linux vs Windows
# Linux
free -h                # total/used/free RAM and swap, human-readable
vmstat 1                # live memory + CPU stats, refresh every second

# Windows
systeminfo | findstr Memory   # quick memory summary
# or: Task Manager → Performance tab → Memory
Page Fault
An interrupt raised when a process references a page not currently in physical memory.
TLB
A hardware cache that speeds up virtual-to-physical address translation.
Thrashing
A state where the system spends more time swapping pages than executing — happens when RAM is badly oversubscribed.
⚠️

Watch for: heavy swap usage on `free -h` output usually means the system doesn't have enough physical RAM for its workload — not a bug to fix in software.


MODULE 04

File Systems & Storage Structure

How data is organized on disk, how directories are structured, and how to partition and format a drive.

Files, Attributes & Access Methods

Every file has attributes — name, type, size, permissions, timestamps. Files support operations like create, read, write, delete, and can be accessed sequentially (read start to finish, like a tape) or via direct/random access (jump straight to any byte, like a disk).

Directory Structures

A single-level directory holds all files in one flat list (fine for tiny systems, unusable at scale). A two-level directory gives each user their own directory. A tree-structured directory — what every modern OS uses — allows unlimited nested subdirectories.

File System Types — Linux vs Windows
AspectLinux (ext4)Windows (NTFS)
Allocation methodIndexed (inode-based)Indexed ($MFT — Master File Table)
Case sensitivityCase-sensitive (File.txt ≠ file.txt)Case-preserving but insensitive
Path separatorForward slash /Backslash \
Older FAT32Supported for USB drives (4 GB file size limit)Still default for USB/SD cards
Permissions modelrwx for owner/group/otherACL-based, per-user/group
Practical — Lab 5: Storage Management & Partitioning
# Linux — using fdisk and mkfs on a virtual disk
sudo fdisk /dev/sdb          # enter partitioning tool for a second disk
# inside fdisk: n (new partition), w (write changes)
sudo mkfs.ext4 /dev/sdb1     # format the new partition as ext4
sudo mount /dev/sdb1 /mnt/data

# Windows — Disk Management (diskmgmt.msc) or DiskPart
diskpart
list disk
select disk 1
create partition primary
format fs=ntfs quick
assign
Inode
A Linux data structure storing a file's metadata and pointers to its data blocks — not the filename itself.
FAT / NTFS / ext4
File system formats — FAT32 is old and universal, NTFS is Windows' modern default, ext4 is Linux's modern default.
MBR vs GPT
Partition table styles — GPT supports disks over 2 TB and more than 4 primary partitions.
💡

Never format your only disk by mistake: always double-check the device name (/dev/sdb vs /dev/sda) before running mkfs — sda is usually your main OS disk.


MODULE 05

CLI & Administration

Windows CMD/PowerShell and the Linux Bash shell — file operations, users, permissions, and system monitoring from the command line.

Command Line Fundamentals

Windows CLI comes in two flavours — the legacy Command Prompt (CMD) and the modern, scriptable PowerShell. Linux uses Bash almost universally, built around pipelines (|) that feed one command's output into the next, and redirection (>, >>) to send output to a file instead of the screen.

File Operations — Bash vs CMD/PowerShell
TaskBash (Linux)CMD / PowerShell (Windows)
List filesls -ladir / Get-ChildItem
Change directorycd /var/logcd C:\Logs
Create directorymkdir projectmkdir project
Copy filecp a.txt b.txtcopy a.txt b.txt
Delete filerm file.txtdel file.txt
Mirror a folderrsync -av src/ dst/robocopy src dst /E
Practical — Lab 3: Linux Shell & File Permissions
# Navigate and manage the filesystem
pwd                     # print working directory
touch notes.txt         # create empty file
cp notes.txt backup.txt

# Permissions — symbolic and numeric (octal) modes
chmod u+x script.sh     # symbolic: add execute for owner
chmod 750 script.sh     # numeric: rwx for owner, r-x for group, --- for others
chown ahmed:devteam script.sh   # change owner and group
Practical — Lab 4: User & Group Administration
# Linux
sudo useradd -m ahmed          # create user with home directory
sudo passwd ahmed              # set password
sudo groupadd devteam
sudo usermod -aG devteam ahmed # add ahmed to devteam group

# Windows (CMD)
net user ahmed Passw0rd! /add
net localgroup devteam /add
net localgroup devteam ahmed /add
Practical — Labs 2 & 6: CLI Admin + Performance Monitoring
# Windows CLI system admin (Lab 2)
systeminfo              # full system report
attrib +r file.txt      # set read-only attribute
chkdsk C: /f             # check and fix disk errors

# Resource monitoring (Lab 6)
top                      # Linux — live CPU/memory per process
htop                     # Linux — friendlier top with color and mouse support
df -h                    # Linux — disk space usage by mount point
# Windows — Task Manager / Resource Monitor (resmon.exe)
Pipeline (|)
Sends one command's output directly into another command as input.
Redirection (>, >>)
Sends command output to a file — overwrite (>) or append (>>).
sudo
Runs a single command with administrator (root) privileges on Linux.
Octal permissions
A 3-digit shorthand for rwx permissions — e.g. 750 = rwxr-x---.
💡

Course uses: Windows 10/11 and Ubuntu Server side by side in VirtualBox so every command in this module can be run on both, back to back.


🖥️

Ready to go beyond reading?

The live course includes hands-on labs, Q&A sessions, and a final enterprise project for your GitHub portfolio. Same instructor who wrote these notes.

💬 Enroll via WhatsApp →

Batch info & fee on request