Introduction to Operating Systems
1. What is an Operating System?
An Operating System (OS) is a software layer that sits between the hardware and the
user applications. It manages hardware resources, provides a user interface, and ensures
that different programs and users running on the computer do not interfere with each
other.
At its core, an operating system is responsible for managing the system’s resources
such as the CPU, memory, disk space, and I/O devices.
1.1. Primary Functions of an OS
• Process Management: Handles the creation, scheduling, and termination of pro-
cesses.
• Memory Management: Keeps track of each byte in a computer’s memory and
manages allocation and deallocation.
• File System Management: Organizes and stores files on storage devices.
• Device Management: Coordinates and controls input/output devices using de-
vice drivers.
• Security and Access Control: Prevents unauthorized access to system resources.
• User Interface: Provides interfaces such as command-line (CLI) or graphical
(GUI).
2. Process Management
A process is an instance of a program in execution. The operating system is responsible
for creating and managing these processes.
1
Operating Systems Computer Science Chapter
2.1. Process States
A process typically exists in one of several states:
1. New: The process is being created.
2. Ready: The process is waiting to be assigned to a processor.
3. Running: Instructions are being executed.
4. Waiting: The process is waiting for some event to occur.
5. Terminated: The process has finished execution.
2.2. Scheduling Algorithms
Operating systems use CPU scheduling algorithms to determine which process to run.
Common algorithms include:
• First-Come, First-Served (FCFS)
• Shortest Job Next (SJN)
• Round Robin (RR)
• Priority Scheduling
Each algorithm has its own advantages and trade-offs regarding efficiency and fairness.
3. Memory Management
Memory management is crucial to ensure the efficient use of the available physical and
virtual memory.
3.1. Virtual Memory
Virtual memory allows a system to use more memory than physically available by swap-
ping data to a disk.
3.2. Paging and Segmentation
Paging divides memory into fixed-size blocks called pages. It eliminates the need for
contiguous allocation of memory.
Segmentation divides memory into variable-size segments based on logical divisions
in a program such as code, data, and stack.
2
Operating Systems Computer Science Chapter
4. File Systems
A file system organizes data and metadata on storage devices.
4.1. File Types and Access Methods
Files can be:
• Text or Binary
• Sequential or Random access
The file system also maintains directories and file permissions.
4.2. Common File Systems
Examples include:
• FAT32
• NTFS
• ext4
Each has different features regarding journaling, size limits, and speed.
5. Input/Output Management
The OS provides an abstraction layer between hardware devices and the user. Devices
are accessed using device drivers and I/O scheduling.
5.1. Interrupts and Buffers
Devices use interrupts to notify the CPU. The OS handles these through interrupt han-
dlers. Buffers are temporary memory locations used to handle data transfer speed mis-
matches.
3
Operating Systems Computer Science Chapter
6. Security and Protection
Modern operating systems must protect data and system resources from unauthorized
access and failures.
6.1. Authentication and Authorization
• Authentication: Verifies user identity (e.g., password, biometrics).
• Authorization: Determines if a user has permission to perform an action.
6.2. Access Control Mechanisms
These include:
• Access Control Lists (ACLs)
• Role-Based Access Control (RBAC)
7. User Interfaces
User interfaces are the bridge between the user and the OS functionality.
7.1. Command-Line Interface (CLI)
A text-based interface where users type commands. Example: Bash, PowerShell.
7.2. Graphical User Interface (GUI)
A visual interface using windows, icons, and menus. Example: Windows Explorer,
GNOME.
8. Types of Operating Systems
• Batch Operating Systems
• Time-Sharing Systems
• Real-Time Operating Systems
• Distributed Operating Systems
• Mobile Operating Systems
Each is designed to meet specific types of computing needs.
4
Operating Systems Computer Science Chapter
9. Conclusion
Operating Systems are the backbone of any computing system. They manage hardware,
provide a stable environment for applications, and ensure security and efficiency. As
computing environments become more complex with cloud computing, IoT, and mobile
platforms, the role of the OS continues to evolve.