CS Fundamentals
Detailed exploration of OS functions — process scheduling, memory allocation, file management, I/O handling, and security. With practical examples.
Introduction
The operating system is like an extremely efficient manager running a complex organization with thousands of simultaneous tasks. Let's explore each of its functions in detail, with practical examples of what's actually happening behind the scenes when you use your computer.
Process Management
A process is a program in execution. When you open Chrome, that's a process. When you play music in Spotify, that's another process. Your computer typically has 100–300 processes running simultaneously.
What the OS does:
- Process creation — Launches new processes when you open applications
- Process scheduling — Decides which process gets CPU time and for how long
- Process termination — Cleans up when processes finish or crash
- Inter-process communication — Allows processes to share data safely
CPU Scheduling
Since most computers have 4–16 cores but 100+ processes, the OS must share CPU time:
- Each process gets a small time slice (typically 10–100 milliseconds)
- The scheduler rapidly switches between processes
- This happens so fast (thousands of times per second) that it appears everything runs simultaneously
Real example:
You're writing a document while music plays and a file downloads. The OS gives each task CPU time in rotation — switching so quickly you perceive all three happening at the same time.
Memory Management
The OS controls all RAM allocation:
What the OS does:
- Allocation — Assigns memory blocks to processes that request them
- Protection — Prevents one process from accessing another's memory (isolation)
- Virtual memory — Creates the illusion of more RAM by using disk space as overflow
- Deallocation — Reclaims memory when processes finish
Virtual Memory
When RAM is full, the OS moves less-active data to a special area on the hard drive/SSD (called swap space or page file):
- This allows running more programs than physically fit in RAM
- Much slower than real RAM — that's why your computer slows down when memory is overcommitted
- The OS intelligently decides what to swap out (least recently used data)
Real example:
You have 8 GB RAM but try to run programs needing 10 GB. The OS uses 2 GB of disk space as virtual memory. Everything works but the system feels sluggish because disk access is 1000x slower than RAM.
File System Management
The OS organizes billions of bytes on your storage into a logical structure:
What the OS does:
- File creation/deletion — Creates and removes files and folders
- File organization — Hierarchical directory structure (folders within folders)
- Space allocation — Decides where on disk to store file data
- File access control — Permissions (read, write, execute) for different users
- File naming — Rules for valid filenames and extensions
File Systems:
- NTFS — Windows default (supports permissions, large files, encryption)
- APFS — macOS default (optimized for SSDs, snapshots)
- ext4 — Linux default (reliable, performant)
- FAT32 — Universal compatibility (USB drives), but limited to 4 GB files
Device (I/O) Management
The OS mediates between software and hardware devices:
What the OS does:
- Device detection — Recognizes new hardware when connected
- Driver management — Loads appropriate device drivers
- I/O scheduling — Manages multiple programs trying to use the same device
- Buffering — Temporarily stores data during transfer between devices of different speeds
- Spooling — Queues print jobs so you don't have to wait for the printer
Real example:
Three users send documents to one printer. The OS queues them (spooling), prints them in order, and notifies each user when their job completes — without any user needing to wait for others.
Security and Protection
What the OS does:
- Authentication — Verifies user identity (passwords, fingerprints, face recognition)
- Authorization — Controls what authenticated users can access
- Encryption — Protects sensitive data (BitLocker, FileVault)
- Firewall — Controls network traffic in and out
- Auditing — Logs security-relevant events for review
Networking
Modern operating systems include built-in networking:
- Network protocol implementation (TCP/IP)
- Wi-Fi and Ethernet management
- File sharing between computers
- Internet connection management
- VPN support
Key Takeaways
- The OS manages processes (multitasking), memory (allocation and protection), files (organization and access), devices (drivers and scheduling), and security
- Process scheduling creates the illusion of simultaneous execution on limited cores
- Virtual memory extends RAM capacity using disk space (with performance trade-offs)
- File systems organize raw storage into logical structures (files and folders)
- I/O management uses buffering and spooling to handle devices of different speeds
- All these functions work together seamlessly — that's the genius of a well-designed OS
Exam Focus
Revise definitions, diagrams, examples, and short-answer points for Functions of Operating System.
Interview Use
Prepare one clear explanation, one practical example, and one common mistake for this Computer Fundamentals topic.
Search Terms
computer-fundamentals, computer fundamentals, computer, fundamentals, operating, systems, functions, system
Related Computer Fundamentals Topics