Introduction
An operating system (OS) is software that manages computer hardware and software resources. It provides services for programs and acts as a bridge between users and hardware. Understanding the basics of operating systems is important for both students and professionals. This cheatsheet covers the most essential concepts in simple language, accompanied by concise examples.
1. Types of Operating Systems
Batch OS: Executes jobs in batches without user interaction.
Time-Sharing OS: Multiple users share the system simultaneously.
Distributed OS: Multiple computers connected and act as one system.
Real-Time OS (RTOS): Gives quick response to inputs, used in embedded systems.
2. Functions of OS
Process Management: Creates, schedules, and terminates processes.
Memory Management: Allocates and tracks memory use.
File System Management: Manages files, directories, and permissions.
Device Management: Controls input/output devices.
Security and Protection: Protects data and user access.
3. Process and Threads
Process: A program in execution.
Example: Running notepad.exe is a process.
Thread: A smaller unit inside a process that executes tasks.
Key Point: Threads share memory of the process, but processes do not share memory by default.
4. Process States
New: Process is created.
Ready: Waiting for CPU.
Running: Executing instructions.
Waiting: Waiting for I/O.
Terminated: Finished execution.
5. Scheduling Algorithms
Decides which process runs on the CPU.
FCFS (First Come First Serve): Runs in order of arrival.
SJF (Shortest Job First): Picks the smallest job first.
Round Robin: Each process gets an equal time slice.
Priority Scheduling: Runs based on priority.
Example (Round Robin with 2 sec time quantum)
P1 (5s), P2 (3s), P3 (1s)
Order: P1→P2→P3→P1→P2→P1
6. Inter-Process Communication (IPC)
Processes exchange data using:
Pipes: One-way communication.
Message Queues: Stores messages for processes.
Shared Memory: Multiple processes access the same memory.

Join the conversation! Your thoughts help the community grow.