1. Operating System Basics
An Operating System (OS) is system software that acts as an interface between the user and the
hardware. It manages resources like CPU, memory, files, and I/O devices.
Functions of OS:
1. Process Management
2. Memory Management
3. File System Management
4. Device Management
5. Security
2. Process and Threads
A process is a program in execution. Each process has its own memory and CPU state. Threads
are smaller units within a process that share memory.
Feature Process Thread
Definition Independent program in execution Smaller unit of a process
Memory Separate memory Shared memory
Communication Uses Inter-Process Communication (slow)
Faster (shared memory)
3. Deadlock
A deadlock occurs when two or more processes wait indefinitely for each other to release
resources.
Necessary Conditions: Mutual Exclusion, Hold & Wait, No Preemption, Circular Wait.
4. Memory Management
Paging divides memory into fixed-size blocks (pages/frames). Segmentation divides memory into
variable-size logical blocks. Virtual memory allows execution of large programs using secondary
storage.
5. CPU Scheduling
Scheduling decides which process executes next. Common algorithms include FCFS, SJF, Round
Robin, and Priority Scheduling.
6. Process Synchronization
Semaphores are used to control access to shared resources. There are Binary (0/1) and Counting
semaphores.