Os101 Reviewer
Os101 Reviewer
PROCESSOR MANAGEMENT
- In multiprogramming environment, the OS
decides which process gets the processor
when and for how much time. This function
called Process scheduling
2. Control over system performance −
An Operating System does the following activities for
processor management: Recording delays between request for a
- Keeps tracks of processor and status of service and response from the system.
process. The program responsible for this
task is known as traffic controller.
- Allocates the processor (CPU) to a process. 3. Job accounting − Keeping track of time and
- De-allocates processor when a process is no resources used by various jobs and users.
longer required.
FILE MANAGEMENT
- normally organized into directories for easy
navigation and usage.
Disadvantages of Time-sharing operating systems The advantages of network operating systems are as
are as follows: follows:
- Problem of reliability. - Security is server managed.
- Security and integrity of user program and
data. The disadvantages of network operating systems are
- Data communication as follows:
- High cost of buying and running a server.
DISTRIBUTED OPERATING SYSTEM
- use multiple central processors to serve REAL TIME OPERATING SYSTEM
multiple real-time applications and multiple - a data processing system in which the time
users. interval required to process and respond to
inputs is so small that it controls the
LOOSELY COUPLED SYSTEMS environment.
RESPONSE TIME
- time taken by the system to respond to an An Operating System manages the communication
input and display of required updated between user and device drivers:
information. - I/O operation means read or write operation
There are two types of real-time operating with any file or any specific I/O device.
systems: - Operating system provides the access to the
1. HARD REAL-TIME SYSTEMS required I/O device when required.
- guarantee that critical tasks complete on
time. FILE SYSTEM MANIPULATION
- a collection of related information.
2. SOFT REAL-TIME SYSTEMS - normally organized into directories for easy
- less restrictive. A critical real-time task gets navigation and usage.
priority over other tasks and retains the
priority until it completes.
An Operating System provides services to both the Following are the major activities of an operating
users and to the programs: system with respect to file management:
- It provides programs an environment to - Program needs to read a file or write a file.
execute.
COMMUNICATION
Following are a few common services provided by an - In case of distributed systems which are a
operating system: collection of processors that do not share
- Program execution memory, peripheral devices, or a clock, the
- I/O operations operating system manages communications
- File System manipulation between all the processes. Multiple
- Communication processes communicate with one another
- Error Detection through communication lines in the network.
- Resource Allocation
- Protection Following are the major activities of an operating
system with respect to communication:
PROGRAM EXECUTION - Two processes often require data to be
- Operating systems handle many kinds of transferred between them.
activities from user programs to system
programs like printer spooler, name servers, ERROR HANDLING
file server, etc. Each of these activities is - Errors can occur anytime and anywhere. An
encapsulated as a process. error may occur in CPU, in I/O devices or in
the memory hardware.
Major activities of an operating system with respect
to program management: Following are the major activities of an operating
- Loads a program into memory. system with respect to error handling:
- Executes the program. - The OS constantly checks for possible errors.
- Handles program's execution.
RESOURCE MANAGEMENT
I/O OPERATION - resources such as main memory, CPU cycles
- an I/O subsystem comprises of I/O devices and files storage are to be allocated to each
and their corresponding driver software. user or job.
MULTITASKING / TIME SHARING
Following are the major activities of an operating - multiple jobs are executed by the CPU
system with respect to resource management: simultaneously by switching between them.
- The OS manages all kinds of resources using - Multitasking Operating Systems are also
schedulers. known as Time-sharing systems.
BATCH PROCESSING
- collects the programs and data together in a
MULTIPROGRAMMING
batch before processing starts.
- when two or more programs reside in
memory at the same time
An operating system does the following activities
related to batch processing:
An OS does the following activities related to
- Jobs are processed in the order of
multiprogramming:
submission, i.e., first come first served
- The operating system keeps several jobs in
fashion.
memory at a time.
Advantages
- Batch processing takes much of the work of
the operator to the computer.
Disadvantages
- Difficult to debug program.
- putting data of various I/O jobs in a buffer.
- this buffer is a special area in memory or hard
disk which is accessible to I/O devices.
ADVANTAGES
- High and efficient CPU utilization.
DISADVANTAGES
- CPU scheduling is required.
INTERACTIVITY
- ability of users to interact with a computer
system.
DISTRIBUTED ENVIRONMENT
- multiple independent CPUs or processors in
a computer system.
SPOOLING
- acronym for Simultaneous Peripheral
Operations on Line.
Component & Description
PROCESS
PROCESS LIFE CYCLE
- basically a program in execution.
- When a process executes, it passes through
- The execution of a process must progress in
different states.
a sequential fashion.
- In general, a process can have one of the
- an entity which represents the basic unit of
following five states at a time;
work to be implemented in the system.
1. Start - the initial state when a process is first - The PCB is identified by an integer Process
started/created. ID (PID).
2. Ready - waiting to be assigned to a
processor. A PCB keeps all the information needed to keep
3. Running - set to running and the processor track of a process as listed below in the table:
executes its instructions.
4. Waiting - moves into the waiting state if it 1. Process State - The current state of the
needs to wait for a resource, such as waiting process i.e., whether it is ready, running,
for user input. waiting, or whatever.
5. Terminated or Exit - Once the process 2. Process privileges - This is required to
finishes its execution, it is moved to the allow/disallow access to system resources.
terminated state where it waits to be removed 3. Process ID - Unique identification for each of
from main memory. the process in the operating system.
4. Pointer - A pointer to parent process.
5. Program Counter - Program Counter is a
pointer to the address of the next instruction
to be executed for this process.
6. CPU registers - Various CPU registers
where process need to be stored for
execution for running state.
7. CPU Scheduling Information - Process
priority and other scheduling information
which is required to schedule the process.
PROCESS SCHEDULING
- activity of the process manager that handles
PROGRAM
the removal of the running process from the
- a piece of code which may be a single line or
CPU.
million of lines.
- essential part of a Multiprogramming
operating systems.
COMPUTER PROGRAM
- collection of instructions that performs a
Process Scheduling Queues:
specific task when executed by a computer.
Job queue − This queue keeps all the
ALGORITHM processes in the system.
- part of a computer program that performs a
well-defined task. Ready queue − This queue keeps a set of all
processes residing in main memory, ready
and waiting to execute.
SOFTWARE Device queues − The processes which are
- collection of computer programs, libraries and
related data. blocked due to unavailability of an I/O device
constitute this queue.
Process Control Block (PCB)
- a data structure maintained by the Operating
System for every process.
When the process is switched, the following
information is stored for later use;
- Program Counter
- Scheduling information
- Base and limit register value
Process Scheduler
- schedules different processes to be assigned
Two-State Process Model to the CPU based on particular scheduling
- running and non-running states which are algorithms.
described below;
1. Running - When a new process is created, it Popular process scheduling algorithms;
enters into the system as in the running state. - First-Come, First-Served (FCFS) Scheduling
2. Not Running - Processes that are not running - Shortest-Job-Next (SJN) Scheduling
are kept in queue, waiting for their turn to execute. - Priority Scheduling
- Shortest Remaining Time
Schedulers - Round Robin(RR) Scheduling
- special system software which handles - Multiple-Level Queues Scheduling
process scheduling in various ways;
- Long-Term Scheduler Algorithms
- Short-Term Scheduler - either non-preemptive or preemptive.
- Medium-Term Scheduler
Non-preemptive algorithms
Long Term Scheduler - designed so that once a process enters the
- also called a job scheduler. running state, it cannot be preempted until it
- determines which programs are admitted to completes its allotted time,
the system for processing.
Preemptive
Short Term Scheduler - based on priority where a scheduler may
- also called as CPU scheduler. preempt a low priority running process
- main objective is to increase system anytime when a high priority process enters
performance in accordance with the chosen into a ready state.
set of criteria.
Process Scheduler
- schedules different processes to be assigned to the CPU based on particular scheduling algorithms;
- First-Come, First-Served (FCFS) Scheduling
- Shortest-Job-Next (SJN) Scheduling
- Priority Scheduling
- Shortest Remaining Time
- Round Robin(RR) Scheduling
= 28 / 4
= 7 milliseconds
= 16 milliseconds
= 16 / 4
= 4 milliseconds