Computer ยท Chapter 03

๐Ÿ–ฅ๏ธ Operating System

OS functions, types, process management, Linux and Windows.

๐Ÿ–ฅ๏ธ The Master Software

An Operating System (OS) is system software that manages hardware resources and provides an interface between user and hardware. Without OS, a computer cannot function.

Functions of OS:
โ€ข Process Management โ€” creates, schedules, terminates processes. CPU scheduling algorithms: FCFS, Round Robin, Priority, SJF.
โ€ข Memory Management โ€” allocates/deallocates RAM. Virtual memory extends RAM using disk. Paging and segmentation.
โ€ข File Management โ€” organizes files in directories/folders. Handles read/write/delete operations.
โ€ข Device Management โ€” manages I/O devices via drivers.
โ€ข Security โ€” user authentication, access control, firewall.

Types of OS: Batch OS, Time-Sharing OS, Real-Time OS (RTOS โ€” for critical systems like aircraft), Network OS, Distributed OS, Mobile OS.

๐Ÿ’ป Popular operating systems

Windows (Microsoft) โ€” most popular desktop. Windows 11 latest. GUI-based. NTFS file system.
macOS (Apple) โ€” Unix-based. HFS+/APFS file system. Only for Apple hardware.
Linux โ€” open source. Distributions: Ubuntu, Fedora, Debian, Kali. Ext4 file system. Powers 96% of web servers, Android is Linux-based.
Android (Google) โ€” Linux-based mobile OS. Most popular mobile OS. 72% market share.
iOS (Apple) โ€” Unix-based mobile OS. Only for iPhones/iPads.
Chrome OS โ€” Google. Cloud-centric. Used in Chromebooks.

๐Ÿ“‹ Key OS concepts โ€” SSC/CCC exam

GUI (Graphical User Interface) โ€” icons, windows, menus. Easy to use. Windows, macOS.
CLI (Command Line Interface) โ€” text commands. Linux terminal, Windows CMD. Powerful but technical.
Kernel โ€” core of OS. Types: Monolithic (Linux), Microkernel (Windows NT), Hybrid.
BIOS/UEFI โ€” firmware that starts computer before OS loads. POST (Power-On Self Test).
Booting โ€” starting the computer. Cold boot = full start. Warm boot = restart.
Multitasking โ€” multiple tasks running simultaneously (appears so). Multiprocessing โ€” multiple CPUs.
Deadlock โ€” two processes waiting for each other indefinitely.

๐ŸŽฌ

OS Functions โ€” Click to Explore

Animation
OPERATING SYSTEM LAYERS โ€” CLICK EACH LAYER HARDWARE CPU ยท RAM ยท Hard Disk ยท Input/Output Devices ยท Network Cards KERNEL (Core of OS) Process Management ยท Memory Management ยท Device Drivers ยท System Calls Directly interacts with hardware SYSTEM PROGRAMS File Manager ยท Task Manager ยท Compiler ยท Assembler ยท Linker ยท Loader Shell (CLI) and Window Manager (GUI) APPLICATION PROGRAMS MS Word ยท Chrome ยท VLC ยท Photoshop ยท Games ยท WhatsApp User interacts here โ€” these use OS services via APIs USER You โ€” interacting via GUI (icons, menus) or CLI (commands) User sees only the application layer โ€” OS works behind the scenes CLICK A LAYER TO UNDERSTAND ITS ROLE OS acts as intermediary between hardware and applications โ€” users never interact with hardware directly.

OS is the invisible foundation โ€” every click, file save, or print goes through OS before reaching hardware.

๐Ÿ’ป

OS Concepts Explorer

Interactive
ProcessA program in execution โ€” has its own memory space
ThreadLightweight process โ€” shares memory with parent process
Process statesNew โ†’ Ready โ†’ Running โ†’ Waiting โ†’ Terminated
PCBProcess Control Block โ€” stores process info (PID, state, registers)
Task ManagerCtrl+Shift+Esc โ€” see all running processes in Windows
Practice (SSC/CCC): What is virtual memory? How does it help?
Virtual Memory โ€” a technique where OS uses part of the hard disk as an extension of RAM.

How it works:
โ€ข When RAM is full, OS moves some inactive data from RAM to a special area on disk called Swap space (Windows: page file = pagefile.sys)
โ€ข This frees up RAM for active programs
โ€ข When needed, data is swapped back from disk to RAM

Benefits:
โ€ข Programs can run even when total memory needed exceeds physical RAM
โ€ข Allows multitasking with many applications
โ€ข Each process gets its own virtual address space โ€” security and isolation

Drawback:
โ€ข Disk is much slower than RAM โ€” heavy swapping = system slowdown (called "thrashing")

Paging vs Segmentation:
โ€ข Paging: divide memory into fixed-size pages (e.g., 4KB). Internal fragmentation can occur.
โ€ข Segmentation: divide by logical sections (code, data, stack). External fragmentation can occur.
โ€ข Most modern OS use paging with segmentation combined.
Practice (CCC): What are the differences between GUI and CLI? Give examples.
GUI (Graphical User Interface):
โ€ข Uses visual elements: icons, windows, menus, buttons
โ€ข Operated by mouse clicks and touch
โ€ข User-friendly โ€” no need to memorize commands
โ€ข Examples: Windows 11, macOS, Android, iOS
โ€ข More system resources required (graphics)
โ€ข Slower for repetitive tasks

CLI (Command Line Interface):
โ€ข Text-based โ€” user types commands
โ€ข Requires memorizing commands
โ€ข Faster for experts โ€” powerful scripting/automation
โ€ข Less system resources
โ€ข Examples: Windows Command Prompt (cmd.exe), PowerShell, Linux Terminal (bash)

Common CLI commands:
Windows CMD: dir (list files), cd (change directory), cls (clear screen), del (delete)
Linux/Mac: ls (list), cd (change dir), clear, rm (remove), pwd (print working directory)

System administrators prefer CLI โ€” can manage thousands of servers with scripts. Regular users prefer GUI โ€” intuitive and visual.
โ†
Previous
Number Systems