# Chap 1

## What is an operating system?

* It is **THE boss** of a **computing system**.&#x20;
* An operating system (OS) is the **executive manager** of a **computing system** that manages all **hardware and software**.&#x20;
* It controls every **file, device, section of main memory and nano-second of processing**.

## OS Software

There are 4 managers of an OS:&#x20;

* **Memory manager**&#x20;
* **Processor manager**&#x20;
  * Job scheduler&#x20;
  * Process scheduler&#x20;
* **Device manager**&#x20;
* **File manager**&#x20;

Each manager must work harmoniously with other managers.

### Memory manager

* Is in charge of the **RAM** (main memory).
* **Checks validity of each request**.  If request is **valid**, it **allocates a portion of memory that is not in use**.
* **De-allocates memory** when **program finishes execution**.
* **Preserves space in main memory occupied by the OS itself** – **cannot allow any part of it to be altered accidentally/intentionally**.

### Processor manager

* **Determines how to allocate** the central processing unit (**CPU**).
* **Keeps track of the status of each process**.  *A **process** is an **instance** of **execution** of a **program***.
* **Monitors whether the CPU is executing a process** or **waiting for READ/WRITE command to finish execution**.
* **Handles a process’s transition** from one state of execution to another – comparable to a traffic controller.
* Reclaims the processor when the job is finished.
* **Job scheduler**:
  * Handles jobs as they enter the system.
  * High-level portion.
  * Accepts/rejects incoming jobs.
* **Processor scheduler**:&#x20;
  * Manages each process within those jobs.
  * Decides which process gets the CPU and for how long.

## Sub-system managers

![](https://2445796487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FV3hIvRGy40sVxJRzVvyy%2Fuploads%2FpsX1XYRvycBnaix29ZPM%2Fimage.png?alt=media\&token=c85a641d-ab96-4fac-9328-7b092771e04e)

### Device manager

* Monitors each device, channel and control unit.
* Chooses the most efficient way to allocate all of the system’s devices, printers, terminals, disk drives etc.
* Makes the allocation, starts the operation and later deallocates the device.

### File manager

* Keeps track of all files – data file, assemblers, compilers, application programs.
* Enforces access policy – system-only, user-only, group-only or general access.
* Controls the types of operation a user may perform on a file – read only, read/write.
* Allocates resources when file is opened and deallocates resources when file is closed.

## Main Memory Management

* The Processor Manager decides how to allocate the CPU.&#x20;
* Keep track of the status of each job, process, threads etc.&#x20;
* Monitor the CPU while handling each process’s transition. Like traffic controller.&#x20;
* Multiple CPU?

## Device Management

* Responsible for connecting with every device that’s available on the system.&#x20;
* Choosing the most efficient way to allocate each of these printers, ports, disk drives, and more based on device scheduling policies.&#x20;
* Example?

## File Management

* Keeps track of every file in the system including data files, program files, utilities, compilers, applications etc.&#x20;
* Enforces restrictions on file access control.

## Network Management

* Only for OS with networking capability.&#x20;
* Provides convenient way for authorized users to share resources.&#x20;
* This manager must take overall responsibility for every aspect of network connectivity, including the requirements of the available devices as well as files, memory space, CPU capacity, transmission connections & types of encryption (if necessary).

## User Interface

* Graphical User Interface (GUI)&#x20;
* Command line interface
