You are on page 1of 6

Operating Systems

- it is an interface between a computer user and computer hardware.


- it is a software which performs all the basic tasks like file management, memory management,
process management, handling input and output and controlling peripheral devices such as disk
drives and printers.

Classifications of Operating Systems

 Single User-Single Task


allow one user to do one thing at a time.

 Single User-Multiple Task


allow a single user to simultaneously run multiple applications on their computer.

 Multiple User-Multiple Task


allow multiple users to simultaneously use the resources on a single computer.

 Real-time
responds to input instantly.

Types of Operating Systems

 Batch Processing Operating System


This type of operating system does not interact with the computer directly. There is an operator
which takes similar jobs having same requirement and group them into batches.

 Time Sharing Operating System


Each task is given some time to execute, so that all the tasks work smoothly. Each user gets time
of CPU as they use single system.

 Distributed
Distributed systems use multiple central processors to serve multiple real-time applications and
multiple users.

 Real-time
The time interval required to process and respond to inputs is very small. This time interval is
called response time.

Important Functions of Operating Systems

 Memory Management
An Operating System does the following activities for memory management –
- Keeps tracks of primary memory, i.e., what part of it are in use by whom, what part are
not in use.
- In multiprogramming, the OS decides which process will get memory when and how
much.
- Allocates the memory when a process requests it to do so.
- De-allocates the memory when a process no longer needs it or has been terminated.

 Processor Management
An Operating System does the following activities for processor management −

- Keeps tracks of processor and status of process. The program responsible for this task is
known as traffic controller.
- Allocates the processor (CPU) to a process.
- De-allocates processor when a process is no longer required.

 Device Management
An Operating System manages device communication via their respective drivers. It does the
following activities for device management −
- Keeps tracks of all devices. Program responsible for this task is known as the I/O
controller.
- Decides which process gets the device when and for how much time.
- Allocates the device in the efficient way.
- De-allocates devices.

 File Management
An Operating System does the following activities for file management −
- Keeps track of information, location, uses, status etc. The collective facilities are often
known as file system.
- Decides who gets the resources.
- Allocates the resources.
- De-allocates the resources.

 Security Management
By means of password and similar other techniques, it prevents unauthorized access to
programs and data.

 Control System Performance


Recording delays between request for a service and response from the system.

 Job Accounting
Keeping track of time and resources used by various jobs and users.
 Error Detecting Aids
Production of dumps, traces, error messages, and other debugging and error detecting aids.

 Coordination Between Other Software and Users


Coordination and assignment of compilers, interpreters, assemblers and other software to the
various users of the computer systems.

Process in Operating Systems

Process – is an entity which represents the basic unit of work to be implemented in a system.

Process Life Cycle

When a process executes, it passes through different states. These stages may differ in different
operating systems, and the names of these states are also not standardized. In general, a process
can have one of the following five states at a time.

 Start - This is the initial state when a process is first started/created.

 Ready - The process is waiting to be assigned to a processor.

 Running - Once the process has been assigned to a processor by the OS scheduler, the
process state is set to running and the processor executes its instructions.

 Waiting - Process moves into the waiting state if it needs to wait for a resource, such as
waiting for user input, or waiting for a file to become available.

 Terminated or Exit - Once the process finishes its execution, or it is terminated by the
operating system, it is moved to the terminated state where it waits to be removed from
main memory.
Process Control Block (PCB)

A Process Control Block is a data structure maintained by the Operating System for every
process. The PCB is identified by an integer process ID (PID). A PCB keeps all the information
needed to keep track of a process as listed below:

 Process State - The current state of the process i.e., whether it is ready, running, waiting,
or whatever.

 Process privileges - This is required to allow/disallow access to system resources.

 Process ID - Unique identification for each of the process in the operating system.

 Pointer - A pointer to parent process.

 Program Counter - Program Counter is a pointer to the address of the next instruction to
be executed for this process.

 CPU registers - Various CPU registers where process need to be stored for execution for
running state.

 CPU Scheduling Information - Process priority and other scheduling information which is
required to schedule the process.

 Memory management information - This includes the information of page table, memory
limits, Segment table depending on memory used by the operating system.

 Accounting information - This includes the amount of CPU used for process execution,
time limits, execution ID etc.

 IO status information - This includes a list of I/O devices allocated to the process.

The architecture of a PCB is completely dependent on Operating System and may contain
different information in different operating systems. The PCB is maintained for a process
throughout its lifetime, and is deleted once the process terminates.

Scheduling Criteria

 CPU Utilization
Computer usage of memory and processing resources or amount of work handle by a CPU.
 Throughput
It is the total number of process completed per unit time.
 Turn Around Time
It is the total amount of time the process executed itself on the CPU.
 Waiting Time
It is the amount of time a process waits to load itself on the CPU.
 Response Time
Amount time it taken from when a request was submitted until first response is produced is
called response time.

Types of Algorithm

 Preemptive
 Non-Preemptive

Scheduling Algorithm

 First Come, First Serve


- Jobs are executed on first come, first serve basis.
- It is a non-preemptive

 Shortest Job First


- This is also known as shortest job next, or SJN
- This is a non-preemptive

 Priority (non-preemptive)
- Priority scheduling is a non-preemptive algorithm and one of the most common
scheduling algorithms in batch systems.
- Each process is assigned a priority. Process with highest priority is to be executed first
and so on.
- Processes with same priority are executed on first come first served basis.

 Shortest Remaining Time First


- Shortest remaining time (SRT) is the preemptive version of the SJN algorithm.
- The processor is allocated to the job closest to completion but it can be preempted by a
newer ready job with shorter time to completion.

 Priority (preemptive)
- A preemptive type of priority algorithm.

 Round Robin
- Round Robin is the preemptive process scheduling algorithm.
- Each process is provided a fix time to execute, it is called a quantum.
Starvation
Starvation or indefinite blocking is phenomenon associated with the Priority scheduling
algorithms, in which a process ready to run for CPU can wait indefinitely because of low priority.
In heavily loaded computer system, a steady stream of higher-priority processes can prevent a
low-priority process from ever getting the CPU.

Aging
Aging is a technique of gradually increasing the priority of processes that wait in the system for a
long time. For example, if priority range from 127(low) to 0(high), we could increase the priority
of a waiting process by 1 Every 15 minutes. Eventually even a process with an initial priority of
127 would take no more than 32 hours for priority 127 process to age to a priority-0 process.

You might also like