Lesson
07 of 26
Translate

Operating System & Interfaces

Kernel, CLI vs GUI, process states, device drivers, types of OS (batch, real-time, multitasking), memory management for UPSSSC AGTA.

What is an Operating System?

An Operating System (OS) is system software that acts as an intermediary between the user and the computer hardware. Without an OS, you would have to write binary instructions for every task — even moving the mouse cursor. The OS manages all hardware resources, runs your applications, and provides a user-friendly interface.

Definition: An Operating System is a collection of programs that manages hardware resources, provides services to application programs, and acts as an interface between the user and the computer.


Functions of an Operating System

flowchart TD
OS["Operating System"]
OS --> PM["Process Management"]
OS --> MM["Memory Management"]
OS --> FM["File Management"]
OS --> DM["Device Management"]
OS --> SEC["Security"]
OS --> UI["User Interface"]
Core Functions of an Operating System
FunctionWhat It Does
Process ManagementCreates, schedules, and terminates processes; handles multitasking
Memory ManagementAllocates and deallocates RAM to programs; manages virtual memory
File ManagementCreates, deletes, organizes files and directories; manages permissions
Device ManagementControls hardware devices through device drivers
SecurityUser authentication (login/password), access control, firewall
User InterfaceProvides GUI (icons, windows) or CLI (text commands)

Types of Operating Systems

This is one of the most frequently asked topics. Know each type with its key characteristic.

TypeKey FeatureExample
Batch OSJobs collected in batches, processed without user interactionEarly IBM mainframes, IBSYS
Multi-programming OSMultiple programs loaded in memory; CPU switches when one waits for I/OTHE OS, early Unix
Multi-tasking OSMultiple tasks run simultaneously with rapid CPU switching (time slicing)Windows, macOS, Linux
Time-sharing OSMultiple users share system resources; each gets a time sliceUnix, Multics
Real-time OS (RTOS)Processes data within a strict time deadlineMissile guidance, ABS brakes, medical devices
Network OSManages resources across a network; supports file sharingWindows Server, Novell NetWare
Distributed OSMultiple computers appear as a single systemLOCUS, Amoeba
Embedded OSBuilt into devices with limited resourcesATM, washing machine, microwave, car ECU
Mobile OSDesigned for smartphones and tabletsAndroid, iOS

Real-time OS — Two Types

TypeDeadlineExample
Hard Real-timeMissing deadline = system failure (life-critical)Missile system, pacemaker, ABS brakes
Soft Real-timeMissing deadline = degraded performance (not fatal)Video streaming, online gaming, VoIP calls

OSDeveloperTypeOpen Source?
WindowsMicrosoftDesktop / ServerNo (Proprietary)
LinuxLinus Torvalds (1991)Desktop / ServerYes
macOSAppleDesktop (Mac only)No
UnixKen Thompson & Dennis Ritchie (1969, AT&T Bell Labs)ServerProprietary (variants exist)
AndroidGoogle (based on Linux kernel)MobileYes
iOSAppleMobile (iPhone/iPad)No
MS-DOSMicrosoft (1981)CLI-only desktopNo
z/OSIBMMainframeNo
UbuntuCanonicalDesktop / Server (Linux distro)Yes
Chrome OSGoogleCloud-based, ChromebooksYes (Chromium OS)

Unix (1969) is the “grandfather” of modern OS. Linux, macOS, and Android all have Unix roots. Linux distributions include Ubuntu, Fedora, CentOS, Debian, and Red Hat.


Kernel — The Core of an OS

The Kernel is the core component of an operating system. It is the first program loaded into memory when a computer starts and remains in memory throughout the session. The kernel directly communicates with the hardware.

flowchart TD
A["User Applications<br/>(Word, Chrome, Excel)"]
B["OS Services<br/>(File Mgmt, GUI, Security)"]
C["KERNEL"]
D["HARDWARE<br/>(CPU, RAM, Disk)"]
A --> B --> C --> D
OS Architecture — Kernel at the Core

Types of Kernel

TypeHow It WorksExample
Monolithic KernelAll OS services run in kernel space — fast but largeLinux, Unix
Micro KernelMinimal kernel; most services run in user space — modular, secureMinix, QNX, L4
Hybrid KernelCombines monolithic speed + micro modularityWindows NT, macOS
Nano KernelExtremely minimal — only basic task managementExperimental systems

CLI vs GUI

FeatureCLI (Command Line Interface)GUI (Graphical User Interface)
InteractionType text commandsClick icons, menus, buttons
SpeedFaster for expertsEasier for beginners
Resource UsageUses less RAM and CPUUses more resources
ExamplesMS-DOS, Linux Terminal, Command Prompt, PowerShellWindows Desktop, macOS, Android
PrecisionVery precise — exact commandsLess precise — limited to GUI options
MultitaskingPossible but harder to visualizeEasy — multiple windows visible

Common CLI Commands

TaskWindows (CMD)Linux / macOS Terminal
List filesdirls
Change directorycd folder_namecd folder_name
Create foldermkdir namemkdir name
Delete filedel filenamerm filename
Copy filecopy src destcp src dest
Clear screenclsclear
Show current pathcdpwd
Rename fileren old newmv old new
Network configipconfigifconfig
Show processestasklistps

Process Management

A process is a program in execution. When you open Chrome, the OS creates a process for it. Each process has its own memory space, registers, and state. The OS manages thousands of processes simultaneously.

Process States

stateDiagram-v2
[*] --> New
New --> Ready : Admitted
Ready --> Running : Dispatch
Running --> Ready : Preempted
Running --> Waiting : I/O request
Waiting --> Ready : I/O complete
Running --> Terminated : Exit
Terminated --> [*]
Process State Transitions
StateDescription
NewProcess is being created
ReadyProcess is loaded in memory, waiting for CPU
RunningCPU is executing the process instructions
Waiting (Blocked)Process is waiting for I/O operation (e.g., reading from disk)
TerminatedProcess has finished execution

Context Switching — When the CPU switches from one process to another, it saves the state of the current process and loads the state of the next one. This happens so fast that it appears as if multiple programs run simultaneously.


Memory Management

ConceptWhat It Does
RAM AllocationOS divides RAM among running programs; each gets a portion
Virtual MemoryUses hard disk space as “extra RAM” when physical RAM is full; slower but extends capacity
PagingDivides memory into fixed-size blocks called pages (logical) and frames (physical)
SegmentationDivides memory into variable-size segments based on logical divisions (code, data, stack)
SwappingMoves entire process from RAM to disk and back when needed
FragmentationWasted memory — Internal (unused space within block) or External (scattered free spaces between blocks)

Virtual Memory makes it possible to run programs larger than your physical RAM. Windows uses a page file; Linux uses a swap partition.

flowchart LR
A["Program<br/>(Large)"] --> B["Virtual Memory<br/>(Pages)"]
B --> C["RAM<br/>(Frames)"]
B --> D["Disk<br/>(Swap/Page File)"]
Virtual Memory — Paging

File Management

The OS manages how data is stored, organized, and accessed on storage devices.

ConceptDescription
File SystemMethod of organizing files on disk — NTFS (Windows), ext4 (Linux), APFS (macOS)
Directory StructureHierarchical tree — Root directory contains subdirectories and files
File AttributesName, type, size, permissions, creation date, modification date
Access ControlRead, Write, Execute permissions (especially important in Linux: rwx)

Device Drivers

A device driver is a specialized program that allows the OS to communicate with a hardware device. Without the correct driver, the OS cannot “talk to” the hardware.

  • Printer driver — tells OS how to send print commands
  • Graphics driver — enables display of images and video (NVIDIA, AMD drivers)
  • Audio driver — enables sound output
  • Network driver — enables Wi-Fi and Ethernet connectivity
  • Plug and Play (PnP) — OS automatically detects and installs drivers for new devices
  • Updated drivers fix bugs and improve performance

When you plug in a new device and Windows says “Installing device driver…” — it is loading the translator between OS and hardware.


Booting Process

Booting is the process of starting a computer and loading the OS into memory.

flowchart LR
A["Power On"] --> B["BIOS/UEFI"]
B --> C["POST<br/>(Self Test)"]
C --> D["Boot Loader"]
D --> E["OS Loads<br/>into RAM"]
E --> F["Login Screen"]
Computer Boot Process
StepWhat Happens
1. Power OnElectricity reaches the motherboard
2. BIOS/UEFIFirmware stored in ROM activates; initializes hardware
3. POST (Power-On Self Test)Checks CPU, RAM, keyboard, display — if error, beep codes
4. Boot LoaderBIOS/UEFI finds and loads the boot loader from disk (GRUB for Linux, Windows Boot Manager)
5. OS LoadingKernel loads into RAM; drivers initialize; login screen appears
  • Cold Boot = starting from power off (full POST runs)
  • Warm Boot = restart without power off (Ctrl+Alt+Del)

BIOS vs UEFI

FeatureBIOSUEFI
Full FormBasic Input Output SystemUnified Extensible Firmware Interface
InterfaceText-only, keyboard navigationGraphical, mouse support
Disk SupportMBR — max 2 TB, 4 partitionsGPT — supports disks > 2 TB, 128 partitions
Boot SpeedSlowerFaster boot
SecurityNo Secure BootSecure Boot (blocks unauthorized OS)
EraLegacy (1975)Modern (2005+)

Deadlock

A deadlock occurs when two or more processes are stuck forever, each waiting for a resource held by the other. Neither can proceed — like two trains on a single track facing each other.

Four Necessary Conditions for Deadlock (all must hold simultaneously)

ConditionMeaning
Mutual ExclusionAt least one resource is non-sharable (only one process can use it)
Hold and WaitA process holds one resource and waits for another
No PreemptionA resource cannot be forcibly taken from a process
Circular WaitA circular chain of processes, each waiting for a resource held by the next

To prevent deadlock, break any one of these four conditions.

flowchart LR
P1["Process A<br/>holds Resource 1"] -->|waits for| R2["Resource 2"]
P2["Process B<br/>holds Resource 2"] -->|waits for| R1["Resource 1"]
Deadlock — Circular Wait

Spooling & Thrashing

Spooling (Simultaneous Peripheral Operations On-Line) is a technique where data is temporarily held in a buffer (usually on disk) so that a slower device like a printer can access it at its own pace. When you print multiple documents, they are placed in a print queue — the OS sends them to the printer one by one while you continue working.

Thrashing occurs when the OS spends more time swapping pages between RAM and disk than actually executing processes. This happens when too many programs are loaded and physical memory is insufficient, causing constant page faults. The system becomes extremely slow despite high CPU activity.

Exam Tip: Spooling = queue management for slow devices. Thrashing = excessive paging that kills performance.


Multiprogramming vs Multitasking vs Multiprocessing vs Multithreading

FeatureMultiprogrammingMultitaskingMultiprocessingMultithreading
DefinitionMultiple programs in memory; CPU switches when one waits for I/OMultiple tasks run with rapid time slicingMultiple CPUs/cores execute processes simultaneouslySingle process divided into multiple threads
CPU CountSingle CPUSingle CPUMultiple CPUs/coresSingle or multiple CPUs
SwitchingOn I/O waitTime slice expiryTrue parallel executionThreads share process resources
GoalMaximize CPU utilizationUser responsivenessSpeed and reliabilityEfficient resource sharing within a process
ExampleEarly mainframesWindows, Linux desktopDual-core/Quad-core systemsChrome browser (tabs as threads)

DOS Commands (Frequently Asked)

MS-DOS (Microsoft Disk Operating System) was a CLI-only OS. These commands are still asked in exams:

CommandFunction
DIRLists files and directories
COPYCopies one or more files to another location
DELDeletes one or more files
RENRenames a file
MD (MKDIR)Creates a new directory
CD (CHDIR)Changes the current directory
RD (RMDIR)Removes an empty directory
TYPEDisplays the contents of a text file
CLSClears the screen
FORMATFormats a disk for use

Exam Tip: MD = Make Directory, RD = Remove Directory, REN = Rename, DEL = Delete.


Linux Distributions

Linux is an open-source kernel; a distribution (distro) bundles the kernel with software, package manager, and desktop environment.

DistributionKnown For
UbuntuMost popular for beginners and desktops (by Canonical)
FedoraCutting-edge features, sponsored by Red Hat
CentOSEnterprise server use (free version of RHEL)
DebianStability and reliability; Ubuntu is based on Debian
Red Hat (RHEL)Enterprise Linux with paid support
Kali LinuxCybersecurity and penetration testing

Android Version History

Android versions were named after desserts alphabetically until Android 10. From Android 10 onwards, Google switched to just numbers.

VersionName / CodeYear
1.5Cupcake2009
1.6Donut2009
4.4KitKat2013
5.0Lollipop2014
8.0Oreo2017
9Pie2018
10(No dessert name publicly)2019
132022
142023
152024

Exam Tip: Android is based on the Linux kernel and is developed by Google. Dessert names were dropped from public branding starting with Android 10.


Windows Version Timeline

VersionYearKey Feature
Windows 1.01985First GUI-based Windows
Windows 3.11992First widely successful version
Windows 951995Introduced Start Menu and Taskbar
Windows 981998USB support, Internet Explorer integration
Windows XP2001Most popular Windows ever; used for over a decade
Windows Vista2007Heavy resource usage; poorly received
Windows 72009Improved performance over Vista; very popular
Windows 82012Tile-based Start Screen; controversial
Windows 102015Cortana, Edge browser, “last version of Windows”
Windows 112021Centered taskbar, Android app support, TPM 2.0 required

File System Management (Quick Reference)

The OS uses a file system to organize data on storage devices. Different OS use different file systems:

File SystemOSMax File SizeKey Feature
FAT32Cross-platform4 GBUniversal compatibility (USB drives)
NTFSWindows16 TBPermissions, encryption, journaling
ext4Linux16 TBDefault Linux file system, journaling
HFS+macOS (older)8 EBMac OS X default before APFS
APFSmacOS (modern)8 EBSSD-optimized, encryption, snapshots

For detailed file system comparison (FAT32 vs NTFS vs ext4), see the Storage, Memory & File Systems lesson.


Key Takeaways

  • OS is the bridge between user and hardware — manages processes, memory, files, devices, and security
  • Types of OS: Batch, Multi-programming, Multi-tasking, Time-sharing, Real-time, Distributed, Embedded, Mobile
  • Multiprogramming = CPU switches on I/O wait; Multitasking = rapid time slicing; Multiprocessing = multiple CPUs; Multithreading = threads within a process
  • Hard RTOS = deadline miss causes failure (missiles, pacemaker); Soft RTOS = degraded performance (video, VoIP)
  • Kernel is the core of OS — Monolithic (Linux), Micro (QNX), Hybrid (Windows/macOS)
  • CLI = text commands (faster, less resources); GUI = graphical icons (easier for beginners)
  • DOS commands: DIR (list), COPY, DEL, REN, MD (mkdir), CD, RD (rmdir), TYPE, CLS, FORMAT
  • Process states: New → Ready → Running → Waiting → Terminated; Context Switching saves/loads state
  • Spooling = queue management for slow devices (print queue); Thrashing = excessive paging kills performance
  • Virtual Memory uses disk as extra RAM; Paging = fixed-size pages/frames; Segmentation = variable-size
  • Booting: Power On → BIOS/UEFI → POST → Boot Loader → OS loads
  • UEFI is modern replacement of BIOS — faster boot, Secure Boot, GPT > 2 TB, 128 partitions
  • Deadlock needs 4 conditions: Mutual Exclusion, Hold & Wait, No Preemption, Circular Wait
  • Linux distros: Ubuntu (beginners), Fedora (cutting-edge), CentOS (enterprise), Debian (stable), Kali (cybersecurity)
  • Windows: XP (2001, most popular), 7 (2009), 10 (2015, Cortana/Edge), 11 (2021, TPM 2.0)
  • Android: based on Linux kernel, by Google; dessert names until Android 10; latest = Android 15 (2024)
  • File systems: FAT32 (4 GB max, universal), NTFS (Windows), ext4 (Linux), APFS (macOS)

Summary Cheat Sheet

ConceptKey Details
Operating SystemSystem software — bridge between user and hardware
Batch OSJobs in batches, no user interaction
Multiprogramming OSMultiple programs in memory; CPU switches on I/O wait
Multitasking OSMultiple tasks, rapid time slicing — Windows, Linux
MultiprocessingMultiple CPUs/cores execute simultaneously — true parallelism
MultithreadingSingle process split into threads — Chrome tabs as threads
Time-sharing OSMultiple users share system — Unix, Multics
Hard RTOSStrict deadline — missile, pacemaker, ABS brakes
Soft RTOSFlexible deadline — video streaming, VoIP, gaming
Distributed OSMultiple computers appear as single system — LOCUS, Amoeba
Embedded OSBuilt into devices — ATM, washing machine, microwave
Mobile OSAndroid (Google), iOS (Apple)
KernelCore of OS — always in memory, talks to hardware
Monolithic KernelAll services in kernel — Linux, Unix
Micro KernelMinimal kernel — QNX, Minix, L4
Hybrid KernelBest of both — Windows NT, macOS
CLICommand Line — MS-DOS, Terminal, CMD, PowerShell
GUIGraphical — Windows Desktop, macOS, Android
DIRDOS: List files and directories
COPYDOS: Copy files to another location
DELDOS: Delete files
RENDOS: Rename a file
MD / MKDIRDOS: Make (create) new directory
CD / CHDIRDOS: Change directory
RD / RMDIRDOS: Remove empty directory
TYPEDOS: Display contents of text file
CLSDOS: Clear screen
FORMATDOS: Format a disk
dir / lsList files (Windows CMD / Linux)
del / rmDelete file (Windows CMD / Linux)
copy / cpCopy file (Windows CMD / Linux)
cls / clearClear screen (Windows CMD / Linux)
ipconfig / ifconfigNetwork config (Windows / Linux)
Process StatesNew → Ready → Running → Waiting → Terminated
Context SwitchingCPU saves state of one process, loads another
SpoolingSimultaneous Peripheral Operations On-Line — queue for slow devices (print queue)
ThrashingExcessive paging — OS swaps more than it executes; system very slow
Virtual MemoryDisk used as extra RAM (page file / swap)
PagingFixed-size memory blocks (pages & frames)
SegmentationVariable-size memory based on logical divisions (code, data, stack)
SwappingMoves entire process RAM ↔ disk
FragmentationInternal (within block) or External (between blocks)
File SystemNTFS (Windows), ext4 (Linux), APFS (macOS)
FAT32Cross-platform, 4 GB max file, USB drives
Device DriverTranslator between OS and hardware
Plug and PlayOS auto-detects and installs drivers
BIOSLegacy firmware — text UI, MBR, max 2 TB, 4 partitions
UEFIModern firmware — GUI, GPT, Secure Boot, > 2 TB, 128 partitions
POSTPower-On Self Test — checks hardware at startup
Cold BootStart from power off (full POST)
Warm BootRestart without power off (Ctrl+Alt+Del)
DeadlockProcesses stuck forever — needs all 4 conditions
Deadlock ConditionsMutual Exclusion, Hold & Wait, No Preemption, Circular Wait
Unix1969, Ken Thompson & Dennis Ritchie, Bell Labs
Linux1991, Linus Torvalds — open source, monolithic kernel
UbuntuMost popular Linux for beginners (by Canonical)
FedoraCutting-edge features (Red Hat sponsored)
CentOSEnterprise server (free RHEL)
DebianStability — Ubuntu is based on Debian
Kali LinuxCybersecurity and penetration testing
MS-DOSMicrosoft (1981) — CLI-only OS
z/OSIBM mainframe OS
Windows XP2001 — most popular Windows ever
Windows 72009 — improved performance over Vista
Windows 102015 — Cortana, Edge, “last version of Windows”
Windows 112021 — centered taskbar, TPM 2.0 required
AndroidGoogle, based on Linux kernel, dessert names until v10
Android 152024 — latest version

Knowledge Check

Take a dynamically generated quiz based on the material you just read to test your understanding and get personalized feedback.

Lesson Doubts

Ask questions, get expert answers

Lesson Doubts is a Pro feature.Upgrade