18/12/2025
This is a comprehensive set of study notes based on the provided Lecture No. 1 reading material.
Operating Systems
This is a comprehensive set of study notes based on the provided Lecture No. 1 reading material.
# Operating Systems - Lecture 1 Study Notes
**Course context:** Introduction to Operating Systems concepts and principles, with a particular emphasis later in the course on UNIX and Linux.
**Reading Material:**
* Operating Systems Concepts, Chapter 1
* Lecture PowerPoint Slides
---
# # 1. The High-Level Organization of a Computer System
A computer system is composed of four major high-level components that interact with each other (as depicted in Figure 1.1 of the source text).
1. **Hardware:**
* Provides the basic computing resources.
* Examples: Central Processing Unit (CPU), Memory, Input/Output (I/O) devices.
2. **Operating System (OS):**
* Manages the hardware resources among various application programs and users.
* Provides the user with a relatively simple abstract machine to use, hiding hardware complexity.
3. **Application Programs:**
* Define how system resources are used to solve specific user computing problems.
* Examples: Compilers, database systems, video games, business software.
4. **Users:**
* The entities that utilize the system.
* Includes: People, machines, and other computers.
---
# # 2. The Purpose of a Computer System
Computer systems combine software and hardware to provide a tool for solving specific problems efficiently.
**Primary Purpose:** To generate executable programs and execute them.
To achieve this primary purpose, several underlying complex tasks must occur:
1. **Storing** executables on secondary storage devices (e.g., Hard Disk).
2. **Loading** executables from the disk into main memory (RAM).
3. **Setting the CPU state** appropriately so program ex*****on can begin.
4. **Managing Processes:** Creating multiple cooperating processes, synchronizing their access to shared data, and enabling communication between them.
---
# # 3. Essential Operating System Services
The complex tasks required to execute programs create the need for an Operating System to provide specific services. These services act as the functional requirements for an OS.
# # # A. Manage Secondary Storage Devices (e.g., Hard Disks)
* Allocating appropriate disk space upon file creation.
* Deallocating space when files are removed.
* Ensuring new files do not accidentally overwrite existing files.
* Scheduling disk requests for efficiency.
# # # B. Manage Primary Storage (Main Memory/RAM)
* Allocating memory space when programs execute.
* Deallocating space upon process termination.
* Preventing new processes from overwriting existing ones.
* **Memory Protection:** Ensuring a process does not access memory space belonging to others.
* Minimizing unused memory space.
* Allowing the ex*****on of programs larger than available physical main memory (Virtual Memory).
# # # C. Manage Processes (CPU Scheduling)
* Allowing simultaneous ex*****on of processes by scheduling the CPU(s).
* Preventing deadlocks between processes.
* Ensuring the integrity of shared data.
* Synchronizing the ex*****on of cooperating processes.
# # # D. File and Directory Management
* Providing a user view of directory structures.
* Mechanisms for users to protect/secure their files and directories.
---
# # 4. Defining an Operating System: Three Views
There is no single definition of an OS. It is best understood through different viewpoints regarding its role.
# # # # View 1: The Top-Down View (Intermediary/Convenience)
* **Role:** An intermediary between the user and the computer hardware.
* **Goal:** Make the computer system convenient to use.
* **Explanation:** Users don't have to deal with low-level hardware details.
* *Example:* A user types a simple command like `copy file1 file2`. The user doesn't need to know how the disk controller works; the OS handles the complex communication with the hardware to perform the copy.
# # # # View 2: The Bottom-Up View (Resource Manager/Efficiency)
* **Role:** A manager of hardware and software resources (CPU time, memory space, file storage, I/O devices).
* **Goal:** Operate the computer system efficiently, fairly, and securely.
* **Explanation:** The OS faces numerous, conflicting requests for resources from different programs and users. It must decide how and when to allocate and deallocate these resources.
# # # # View 3: The Control Program View
* **Role:** A control program.
* **Goal:** Prevent errors and improper use of the computer.
* **Explanation:** Emphasizes the need to control various I/O devices and manage the ex*****on of user programs to ensure system stability.