OPERATING SYSTEM (OS) NOTES
1. INTRODUCTION An Operating System (OS) is system software that manages computer
hardware and software resources and provides common services for computer programs. It acts as
an interface between the user and the computer hardware.
2. FUNCTIONS OF OPERATING SYSTEM - Process Management: Handles creation, scheduling,
and termination of processes. - Memory Management: Allocates and tracks memory usage. - File
Management: Manages files and directories. - Device Management: Controls input/output devices. -
Security and Access Control: Ensures authorized access. - User Interface: Provides command-line
or graphical interface.
3. TYPES OF OPERATING SYSTEMS - Batch OS: Executes batches of jobs without manual
intervention. - Time-Sharing OS: Multiple users share system resources simultaneously. -
Distributed OS: Manages a group of distinct computers as a single system. - Real-Time OS:
Provides immediate response to inputs. - Embedded OS: Used in embedded systems like routers,
sensors, etc.
4. PROCESS MANAGEMENT A process is a program in execution. The OS is responsible for
managing processes and ensuring efficient CPU utilization. Process States: - New → Ready →
Running → Waiting → Terminated Scheduling Algorithms: - FCFS (First Come First Serve) - SJF
(Shortest Job First) - Round Robin - Priority Scheduling
5. THREADS AND MULTITHREADING A thread is a lightweight process sharing resources with
other threads. Benefits: - Improved performance - Faster context switching - Better resource
utilization
6. MEMORY MANAGEMENT Memory management ensures efficient allocation of main memory to
processes. Concepts: - Contiguous and Non-contiguous allocation - Paging: Divides memory into
fixed-size blocks (pages). - Segmentation: Divides memory into variable-sized segments. - Virtual
Memory: Allows execution of programs larger than physical memory using paging/swapping.
7. FILE MANAGEMENT The OS handles file creation, deletion, reading, writing, and organization.
File Attributes: Name, Type, Location, Size, Protection. Directory Structures: - Single-level -
Two-level - Tree-structured - Acyclic Graph - General Graph
8. DEADLOCK A deadlock occurs when processes are waiting indefinitely for resources held by
each other. Conditions for Deadlock: - Mutual Exclusion - Hold and Wait - No Preemption - Circular
Wait Prevention Techniques: - Avoid one of the above conditions. Detection and Recovery:
Periodically check and terminate or preempt processes.
9. DEVICE MANAGEMENT Manages device communication through device drivers and
controllers. Techniques: - Spooling - Buffering - Caching
10. SECURITY AND PROTECTION Ensures data confidentiality, integrity, and access control.
Mechanisms: - Authentication - Authorization - Encryption - Firewalls and Antivirus
11. SYSTEM CALLS System calls provide the interface between a process and the operating
system. Types: - Process Control (fork, exec, exit) - File Management (open, read, write) - Device
Management (ioctl) - Information Maintenance (getpid) - Communication (pipe, socket)
12. EXAMPLES OF OPERATING SYSTEMS - Windows - Linux - macOS - UNIX - Android - iOS
13. ADVANTAGES - Efficient resource utilization - Multitasking - Security management - Ease of
use with GUI
14. SUMMARY Operating systems are essential for managing hardware, software, and users
efficiently. Understanding process scheduling, memory management, and file systems is vital for
system-level computing.