Vous êtes sur la page 1sur 22

Window GATE

Make a difference OPERATING SYSTEM



Window GATE
SMRITI NAGAR, BHILAI, MO. NO. - 99931 26266 Prepared by RAKESH SAO ( BIT CSE ) Page 1


Window GATE

Window GATE
CSE-IT



Operating System
By Rakesh Sao



Dedicated to my dear Students


Make a difference

Window GATE

Window GATE

Make a difference OPERATING SYSTEM

Window GATE
SMRITI NAGAR, BHILAI, MO. NO. - 99931 26266 Prepared by RAKESH SAO ( BIT CSE ) Page 2


Window GATE






UNIT- I INTRODUCTION


Operating System objective and function
The Evolution of Operating Systems
Batch
Interactive
Time sharing and real time systems
Protection
Operating System Structure
System COMPONENTS
Operating system service
System structure
Distributed Computing
The Key Architecture Trend
Parallel Computation
Input-Output Trends






Window GATE

Make a difference OPERATING SYSTEM

Window GATE
SMRITI NAGAR, BHILAI, MO. NO. - 99931 26266 Prepared by RAKESH SAO ( BIT CSE ) Page 3


Window GATE
OPERATING SYSTEM
(1) "Operating system is system software or program, works between user and hardware of computer so that
application program can interact with h/w easily and efficiently".
(2) We can say also the o/s is s/w which provides an environment for user to interact with H/w.















(3) A computer system can be divided roughly in to 4 components:-
1. Computer H/W 2. Operating system 3. Application Program 4. Users








1. Computer H/W - The Computer H/W resources like CPU , Memory , I/O devices provide the basic
Computing Resources.
2. Operating System - The Os control and coordinates the use of H/W among the various Application
programs for the various users.
3. Application Programs - The application Program such as Word Processor , Spread Sheet , Compiler
etc define the way in which these resources are used to solve the computing problem of users.
4. User - User interacts with Application Programs .





Compiler Assembler Text editor . Database System
System & Application Programs
Operating System
Hardware
User 1 User 2 User 3 User n
Computer System
Operating System Hardware Application Programs User
I/O Devices Memory CPU

Window GATE

Make a difference OPERATING SYSTEM

Window GATE
SMRITI NAGAR, BHILAI, MO. NO. - 99931 26266 Prepared by RAKESH SAO ( BIT CSE ) Page 4


Window GATE
OPERATING SYSTEM OBJECTIVE & FUNCTION
FUNCTIONS OF OPERATING SYSTEM
An Operating System manages four major resources of the computer system : memory , Processor , Input /
Output devices and files. So an Operating System provides four operations :
(1) Memory Management function - Finds free space in memory and allocate it to different processes.
(2) Processor Management function - allocates the processor to execute a chosen process
(3) I/O Device Management function - Allocates a device to a process
(4) File Management function - Keeps track of all information about files that how they are opened or
closed.
OBJECTIVES / GOALS OF OPERATING SYSTEM
The purpose to have an Operating System or OS goals / Objectives are to provide :
(1) Convenience ( to user ) - The primary goal of the OS is to make the computer system convenient to use
by user ( User friendly ).
(2) Efficiency ( of the System ) - The secondary goal of the OS is to make efficient use of the computer
resources (Proper resource management ) .
(3) Ability to Evolve - The OS should be constructed in such a way as to permit the effective development ,
testing and introduction of new system function without affecting the existing ones.

EVOLUTION OF OPERATING SYSTEM
(1) Batch Operating System
(2) Spooling Batch System
(3) Multiprogramming
(4) Multitasking / Time Sharing Operating System
(5) Multiprocessor / Multiprocessing
(6) Distributed Operating System
(7) Real Time Operating System
BATCH OPERATING SYSTEM
(1) Early computer system was physically enormous machine run from console.
(2) The common input devices were card reader and tape drives.
(3) The common output devices were line printers, tape drives and punch card .
(4) The user did not interact directly with computer system. Rather the user prepared a job, which consisted
of program the data and some control information about nature of job and submitted it to computer
operator.
(5) The job was usually in the form of punch card. At the some later time the O/P appeared.
(6) Block Diagram :



Window GATE

Make a difference OPERATING SYSTEM

Window GATE
SMRITI NAGAR, BHILAI, MO. NO. - 99931 26266 Prepared by RAKESH SAO ( BIT CSE ) Page 5


Window GATE
Computer system






Input Device Output Device
(7) To speed up processing the operator batched the jobs with similar needs together and run through the
computer as a group by an operator or automatic job sequencer.

operator or automatic job sequencer



CPU Output Device
( Slower Device ) Job Pool ( Batch ) ( Much Faster Device ) ( Slower Device )
Hard Disk CPU executes at a time one PROCESS
(8) Scheduling is also simple in batch system. Jobs are processed in the order of submission i.e. first come
first served fashion.
(9) In this execution environment the CPU often idle, because the speed of mechanical I/O devices are slower
than electronics devices. Batch is good for executing large jobs that need little interaction; it can be
submitted and picked up later.
(10) Performance is increased by attempting to keep CPU and i/o devices busy at all times through, off- line
operation, and multiprogramming.

Advantages of batch systems
(1) Move much of work of the operator to the computer
(2) Increase the performance ( i.e. as soon as possible to execute the process )

Disadvantages of batch systems
(1) Turn-around time can be large from user standpoint
(2) More difficult to debug program
(3) Due to lack of protection scheme, one batch job can affect pending jobs ( read too many cards, etc )
(4) A job could corrupt the monitor, thus affecting pending jobs
(5) A job could enter an infinite loop
Card
Reader
Tap Drive Line
Printer
Punch
Card
Tap Drive
Console

Job 1 Job 1




Job 1
Job 2
Job 3

Input Device

Window GATE

Make a difference OPERATING SYSTEM

Window GATE
SMRITI NAGAR, BHILAI, MO. NO. - 99931 26266 Prepared by RAKESH SAO ( BIT CSE ) Page 6


Window GATE
SPOOLING OPERATING SYSTEM
(1) Acronym for simultaneous peripheral operations on line. Spooling refers to putting jobs in a buffer, a
special area in memory or on a disk where a device can access them when it is ready.
(2) Spooling is useful because device access data at different rates. The buffer provides a waiting station
where data can rest while the slower device catches up.
(3) Figure shows the spooling :






(4) Computer can perform I/O in parallel with computation; it becomes possible to have the computer read a
deck of cards to a taps, drum or disk and to write out to a taps printer while it was computing. This
process is called spooling.
(5) The most common spooling application is print spooling. In print spooling documents are loaded into a
buffer and then the printer pulls them off the buffer at its own rate.
(6) Spooling is also used for processing data at remote sites. The CPU sends the data via communications
path to a remote printer. Spooling overlaps the I/O of one job with the computation of other jobs.
(7) Spooling batch systems were the first and are the simplest of the multiprogramming systems.
(8) The output from the jobs would be written to another tape which would then be removed and loaded in a
less powerful computer to produce any hardcopy or other desired output.

Magnetic Tapes Output Devices




CPU
( Slower Device ) Job Pool ( Batch ) ( Much Faster Device ) ( Faster Device ) ( Slower Device )
Hard Disk CPU executes at a time one PROCESS
Advantages of Spooling
(1) The spooling operation uses a disk as a very large buffer.
(2) Spooling is however capable of overlapping I/O operation for one job with processor operations for
another job.


CPU
Card reader
Printer
DISK
Job 2




Job 1
Job 2
Job 3

Input Device

Job 1

Job 2 Job 2

Job 1

Window GATE

Make a difference OPERATING SYSTEM

Window GATE
SMRITI NAGAR, BHILAI, MO. NO. - 99931 26266 Prepared by RAKESH SAO ( BIT CSE ) Page 7


Window GATE
MULTIPROGRAMMING
(1) When two or more programs are in memory at the same time, sharing the processor is referred to the
multiprogramming operating system. Multiprogramming operating system. Multiprogramming assumes a
single processor that is being shared. It increases CPU utilization by organizing jobs so that the CPU always
has one to execute.
(2) Figure shows the memory layout for a multiprogramming system :

512 K Job 5
Job 4
Job 3
Job 2
Job 1
000 OS

(3) The operating system keeps several jobs in memory at a time. This set of jobs is a subset of the jobs kept
in the job pool. The operating system picks and begins to execute one of the job in the memory.
(4) Multiprogrammed systems provide an environment in which the various system resources are utilized
effectively, but they do not provide for user interaction with the computer system.
(5) Jobs entering into the system are kept into the memory. Operating system picks the job and begins to
execute one of the jobs in the memory. Having several programs in memory at the same time requires
some form of memory management.
(6) Multiprogramming operating system monitors the state of all active programs and system resources. This
ensures that the CPU is never idle unless there are no jobs.









Key points
(1) In Multiprogramming system the O/S simply switches to and executes another job. When that job need to
wait the CPU is switched another job and so on.
(2) Since several job are ready in job pool to enter in the memory ( MM ) and memory has not enough space
to keep all the jobs ,then its necessary to choose some job out of all job of job pool.
( Virtual Memory Concept Swapping )

Job 1
Output Device
Job Pool ( Batch )
Hard Disk
Job Queue
Jn . . . J2 J1
Job Scheduling
( Long term scheduler )



.
Job 1
Job 2
Job n
CPU
Job 1
CPU executes at a time
one process
CPU Scheduling
( Short term scheduler )
Ready Queue
J3 . . . J2 J1
Main Memory




Job 1
Job 2
Job 3

Window GATE

Make a difference OPERATING SYSTEM

Window GATE
SMRITI NAGAR, BHILAI, MO. NO. - 99931 26266 Prepared by RAKESH SAO ( BIT CSE ) Page 8


Window GATE
(3) The process of selecting job for main memory from job pool is called Job scheduling.
(4) If several job are ready in Main Memory to run at the same time, then the process of selecting job for
execution out of all ready to run job in memory, is called CPU scheduling.
(5) It uses first come first served Scheduling.
Advantages
(1) High CPU utilization
(2) It appears that many programs are allotted CPU almost simultaneously.

Disadvantages
(1) User cannot interact with the program during execution.
(2) CPU scheduling is required.
(3) To accommodate many jobs in memory, memory management is required.

MULTITASKING ( TIME SHARING OPERATING SYSTEM )
(1) Time sharing system supports interactive users. Time sharing is also called multitasking.
(2) It is logical extension of multiprogramming.
(3) Time sharing system uses CPU scheduling and multiprogramming to provide an economical interactive
system of two or more users.
(4) In time sharing, each user is given a time-slice for executing his job in round-robin fashion. Job continues
until the time-slice ends.
(5) Time sharing systems are more complex than multiprogramming operating system. Memory management
in time sharing system provides for isolation and protection of co-resident programs.
(6) Time sharing uses medium-term scheduling such as round-robin for the foreground. Background can use
a different scheduling technique.
(7) Time sharing system can run several programs at the same time, so it is also a multiprogramming system.
But multiprogramming system a context switch occurs only when the currently executing process stalls
for some reason.










Advantages
(1) Allow user to interact with System during execution.
(2) Uses CPU time efficiently.

( Virtual Memory Concept Swapping )
Job Pool ( Batch )
Hard Disk
Job Queue
Jn . . . J2 J1
Job Scheduling
( Middle term scheduler )



.
Job 1
Job 2
Job n
Main Memory
Ready Queue
Jn . . . J2 J1
CPU Scheduling
( Short term scheduler )



.
Job 1
Job 2
Job n
CPU
Job 1
CPU executes at a time
one process

Job 1
Output Device 1
Device Scheduling
( Device scheduler )
Device Queue
J5 . . . J3 J1


Job 2
Output Device 2
Device Scheduling
( Device scheduler )
Device Queue
J8 . . . J4 J2

Window GATE

Make a difference OPERATING SYSTEM

Window GATE
SMRITI NAGAR, BHILAI, MO. NO. - 99931 26266 Prepared by RAKESH SAO ( BIT CSE ) Page 9


Window GATE
Disadvantages
(1) More complex
(2) Protection and Security is necessary.
(3) Require Disk Management
(4) Require virtual memory Management concept.

MULTIPROCESSING
(1) Multiprocessor system have more than one processor in close communication.
(2) They share the computer bus, system clock and input-output devices and sometimes memory.
(3) In multiprocessing system, it is possible for two processes to run in parallel.
(4) Multiprocessor systems are of two types :
1. Symmetric Multiprocessing and
2. Asymmetric Multiprocessing

Symmetric Multiprocessing

(1) In symmetric multiprocessing, each processor runs an identical copy of the operating system and they
communicate one another as needed. All the CPU shared the common memory.
(2) Figure shows the symmetric multiprocessing system :
























P
1



P
3


P
2


CPU
CPU
CPU
Memory
( Virtual Memory Concept Swapping )
Job Pool ( Batch )
Hard Disk
Job Queue
Jn . . . J2 J1
Job Scheduling
( Middle term scheduler )



.
Job 1
Job 2
Job n
Main Memory
Ready Queue
Jn . . . J2 J1
CPU Scheduling
( Short term scheduler )



.
Job 1
Job 2
Job n

Job 1
Output Device 1
Device Scheduling
( Device scheduler )
Device Queue
J5 . . . J3 J1


Job 2
Output Device 2
Device Scheduling
( Device scheduler )
Device Queue
J8 . . . J4 J2
Processor 2
Job 2
Processor 1
Job 1

Window GATE

Make a difference OPERATING SYSTEM

Window GATE
SMRITI NAGAR, BHILAI, MO. NO. - 99931 26266 Prepared by RAKESH SAO ( BIT CSE ) Page 10


Window GATE
Asymmetric Multiprocessing

(1) In asymmetric multiprocessing, each processor is assigned a specific task. It uses master-slave
relationship. A master processor controls the system. The master processor schedules and allocates work
to the slave processors.
(2) Figure shows the asymmetric multiprocessor (no shared memory) :

























Features of multi-processor systems

(1) If one processor fails, then another processors should retrieve the interrupted process state so that
exestuation of the process can continue.
(2) The processors should support efficient context switching operation.
(3) Multiprocessor system supports large physical address space and large virtual address space.
(4) The IPC mechanism should be provided and implemented in hardware as it becomes efficient and easy.

DISTRIBUTED OPERATING SYSTEM
(1) Distributed operating systems depend on networking for their operation. Distributed OS runs on and
controls the resources of multiple machines. It provides resource sharing across the boundaries of a single
P
1

CPU
P
2

CPU
P
3

CPU
c
o
m
m
u
n
i
c
a
t
i
o
n

n
e
t
w
o
r
k

( Virtual Memory Concept Swapping )
Job Pool ( Batch )
Hard Disk
Job Queue
Jn . . . J2 J1
Job Scheduling
( Middle term scheduler )



.
Job 1
Job 2
Job n
Main Memory
Ready Queue
Jn . . . J2 J1
CPU Scheduling
( Short term scheduler )



.
Job 1
Job 2
Job n

Job 1
Output Device 1
Device Scheduling
( Device scheduler )
Device Queue
J5 . . . J3 J1


Job 2
Output Device 2
Device Scheduling
( Device scheduler )
Device Queue
J8 . . . J4 J2
Processor 2
Job 2
Processor 1
Job 1
Memory 2
Job 2
Memory 1
Job 1

Window GATE

Make a difference OPERATING SYSTEM

Window GATE
SMRITI NAGAR, BHILAI, MO. NO. - 99931 26266 Prepared by RAKESH SAO ( BIT CSE ) Page 11


Window GATE
computer system. It look to users like a single machine OS. Distributed OS owns the whole network and
makes it look like a virtual uniprocessor or may be a virtual multiprocessor.
(2) Definition : A distributed operating system is one that looks to its users like an ordinary operating system
but runs on multiple, independent CPU.
(3) Distributes computation among several physical processors.
(4) The processors do not share memory or a clock.
(5) Instead, each processor has its own local Memory.
(6) They communicate with each other through various communication lines, Such as a high-speed bus or
telephone line.
(7) Distributed OS provides illusion to its users that it has single uniprocessor system although it is actually
consisted of multiprocessors.
(8) Distributed systems are more complex than uniprocessor System. Examples of that type of OS are - UNIX,
Windows 2000, Linux etc
(9) Figure shows the distributed system.








Advantages of Distributed OS

(1) Resource Sharing : Sharing of software resources such as software libraries, database and hardware
resources such as hard disks, printers and CDROM can also be done in a very effective way among all the
computers and the users.
(2) Higher Reliability : Reliability refers to the degree of tolerance against errors and component failures.
Availability is one of the important aspect of reliability. Availability refers to the fraction of time for which
a system is multiple for use. Availability of a hard disk can be increased by having multiple hard disks
located at different sites. If o[ne hard disk fails or is unavailable, the program can use some other hard
disk.
(3) Batter price performance ratio
Reduction in the price of microprocessor and increasing computing power gives good price-performance
ratio.
(4) Shorter responses times and higher throughput.
(5) Incremental growth : To extend power and functionality of a system by simple adding additional
resources to the system.

REAL TIME OPERATING SYSTEM
(1) In these types of OS time is key factor; processing must be done in defined time limit. A real time OS
function correctly, only if it is returning within time limit. Such type of OS use in Rocket launching, flight
control etc.
(2) Real time operating system uses priority scheduling algorithm to meet the response requirement of a

internet
gateway
LAN
LAN

Window GATE

Make a difference OPERATING SYSTEM

Window GATE
SMRITI NAGAR, BHILAI, MO. NO. - 99931 26266 Prepared by RAKESH SAO ( BIT CSE ) Page 12


Window GATE
real time application.
(3) General real time applications with some example are listed below.
S.No. Real time applications Examples
1. Detection Radar system, Burglar alarm.
2. Process monitoring and control Petroleum, Paper mill.
3. Communication Telephone switching system.
4. Flight simulation and control Auto pilot shuttle mission simulator.
5. Transportation Traffic light system, Air traffic control

(4) Real time OS are classified in two :
1. Hard real time OS : These type of OS guarantee that critical task be completed within a certain range
of time, if any deadline is missed the system will fail. This type of OS used as a control device for
example a robot is hired to weld a car body if robot welds to early or too late the car cannot be sold
so that type of OS require to complete car welding by robot hardly on the time.
2. Soft Real time OS : In this OS if certain deadlines are missed nothing will occur but performance will
be degraded. For example video conferencing, digital audio system etc

DIFFERENCE BETWEEN MULTIPROGRAMMING, MULTITASKING AND
MULTIPROCESSING

Properties

Multiprogramming Multitasking Multiprocessing
Definition Multiprogramming increases
CPU utilization by organizing
jobs so that CPU always busy.
OS keep several jobs in memory
simultaneously.

System there are no. of user
using the system the CPU time
is divided into different time
slot depending upon the no. of
user each user allowed to use
the system for one time slot.
Multiple Physical
Processors
User
interaction
It doesn't provide user
interaction during execution of
program
It provides user interaction
during execution of program
It provides user interaction
during execution of
program
Long term
scheduler
Used Not used Not used
Middle term
scheduler
Not used Used Used
Number of CPU
used
One One Multiple
CPU CPU executes at a time one
PROCESS
CPU Divides in Time Slots Every Processor Divides in
Time Slots Multitasking
CPU utilization More than Spooling Operating
System
More than Multiprogramming More than Multitasking
Efficient More than Spooling Operating
System
More than Multiprogramming More than Multitasking
Costly More than Spooling Operating
System
More than Multiprogramming More than Multitasking




Window GATE

Make a difference OPERATING SYSTEM

Window GATE
SMRITI NAGAR, BHILAI, MO. NO. - 99931 26266 Prepared by RAKESH SAO ( BIT CSE ) Page 13


Window GATE
SYSTEM COMPONENT
(1) Even though, not all systems have the same structure many modern operation systems share the same
goal of supporting the following types of system components.
(2) The operating system manages many kinds of activities ranging from user programs to system programs
like printer spooler, name servers, file server etc. Each of these activities is encapsulated in a process.
(3) A process includes the complete execution context ( code, data , PC, registers, OS resources in use etc.)
(4) It is important to note that a process is not a program. A process is only ONE instant of a programming
execution. There are many processes can be running the same program.




User Space

Kernel Space





The five major activities of an operating system in regard to process management :

(a) Creation and deletion of user and system processes.
(b) Suspension and resumption of processes.
(c) A mechanism for process synchronization.
(d) A mechanism for process communication.
(e) A mechanism for deadlock handling.


MAIN-MEMORY MANAGEMENT (MM)

Primary - Memory or Main- Memory is a large array of words or bytes. Each word or byte has its own address.
Main-Memory provides storage that can be access directly by the CPU. That is to say for a program to be executed,
it must in the main memory. Main Memory is repository of quickly accessible data shared by the CPU and I/O
devices. CPU read the instruction from MM during the Instruction fetch cycle and it both read and writes the data
from main memory during the data fetch cycle. The I/O operation implemented by DMA. Example - The CPU to
process the data from H/D those data must be transferred to MM by CPU generated I/O calls. Equivalently,
instruction must be in memory for executing them.
To improve the utilization of CPU and speed of the Computer response to its user we must keep several
programs in memory. Many memory management scheme are available for manage.

The major activities of an operation in regard to memory - management are :

(a) Keep track of which part of memory are currently being used and by whom.
Applications
System Call Interface


..
MM PM
I/O Mgt SS Mgt N/W
FM

Window GATE

Make a difference OPERATING SYSTEM

Window GATE
SMRITI NAGAR, BHILAI, MO. NO. - 99931 26266 Prepared by RAKESH SAO ( BIT CSE ) Page 14


Window GATE
(b) Decide which processes are loaded into memory when memory space becomes available.
(c) Allocate and deallocate memory space as needed.

PROCESS MANAGEMENT ( PM )

An OS manages many kinds of activities ranging from user programs to system programs like printer spooler ,
name servers , file servers etc. each of these activities is encapsulated in a process. A process includes the
complete execution context ( code , data , PC , Registers , OS resources in use etc ).

The OS is responsible for following five activities in connection with process management :
(1) Creation and deletion of system process.
(2) Suspension and Resumption of Process.
(3) A mechanism for process synchronization.
(4) A mechanism for process communication.
(5) A mechanism for process deadlock handling.


FILE MANAGEMENT ( FM )

A file is a collected of related information defined by its creator. Computer can store files on the disk ( secondary
storage ), which provide long - term storage. Some examples of storage media are magnetic tape, magnetic disk
and optical disk, Each of these media has its own properties own physical organization. Each medium is control by
devices such as disk drive or tape drive that also has characteristic. These property include speed, capacity data
transfer rate and access methods.
File systems normally organized into directories to case their use. These directories may contain files
and other directions.

The major activities of an operating system in regard to file management are :


(a) The creation and deletion of files.
(b) The creation and deletion of directories
(c) Backing up files on nonvolatile memory
(d) Mapping file onto secondary storage

I/O SYSTEM MANAGEMENT ( I/O MGT )
This component cover following activities :

(a) General devices driver interface
(b) Driver for specific H/W devices
(c) Memory management component that include buffering, caching and spooling.

SECONDARY STORAGE MANAGEMENT ( SS MGT )
The main purpose of computer system is to execute program. This program, with data they access must be in
memory or primary storage during execution, because main memory is too small to accommodate all data and
program and because the data that it holds are lost when power off the computer system use disk for storing.
most program like compiler, editor formally etc are stored on disk until loaded into memory and then disk as both
source and destination of their processing


Window GATE

Make a difference OPERATING SYSTEM

Window GATE
SMRITI NAGAR, BHILAI, MO. NO. - 99931 26266 Prepared by RAKESH SAO ( BIT CSE ) Page 15


Window GATE
The major activities of an operation in regard Disk management are :

(a) Free space management
(b) Storage allocation
(c) Disk scheduling

NETWORKING
A distributed system is a collection of processors that do not share memory , peripheral devices , or clock. Instead ,
each processor has its own local memory and clock. The processors communicate with each other through a
communication line called a network. The network may be fully or partially connected.
OPERATING SYSTEM SERVICES

An Operating System provides an environment for the execution of program. Following are the five services
provided by operating systems to the convenience of the users.

(1) Program Execution
(2) I/O Operations
(3) File System Manipulation
(4) Communications
(5) Error Detection
(6) Resource allocation
(7) Protection
(8) Accounting
(9) Security

PROGRAM EXECUTION

The System must be able to load a program into memory and run that program. The program must be able to end
its execution either normally or abnormally. The purpose of computer systems is to allow the user to execute
programs. So the operating systems provides an environment where the user can conveniently run programs. The
user does not have to worry about the memory allocation or multitasking or anything. These things are taken care
of by the operating systems. Running a program involves the allocating and deallocating memory ,CPU scheduling
in case of multiprocess.These functions cannot be given to the user-level programs. So user-level programs cannot
help the user to run programs independently without the help from operating systems.


I/O OPERATIONS

Each program requires an input and produces output. This involves the use of I/O. The operating systems hide the
user details of underlying hardware for the I/O. All the user sees is that the I/O has been performed without any
details. So the operating system by providing I/O makes it convenient for the users to run programs. For efficiently
and protection users cannot control I/O so this service cannot be provided by user-level programs.

FILE SYSTEM MANIPULATION

The output of a program may need to be written into new files or input taken from some files. The operating
systems provide this service. The user does not have to worry about secondary storage management. User gives a
command for reading or writing to a file and sees his her task accomplished. Thus operating systems make it

Window GATE

Make a difference OPERATING SYSTEM

Window GATE
SMRITI NAGAR, BHILAI, MO. NO. - 99931 26266 Prepared by RAKESH SAO ( BIT CSE ) Page 16


Window GATE
easier for user programs to accomplished their task. This service involves secondary storage management. The
speed of I/O that depends on secondary storage inanagement is critical to the speed of many programs and hence
I think it is best relegated to the operating systems to manage it than giving individual users the control of it. It is
not difficult for the user- level programs to provide these services but for above-mentioned reasons it is best if this
services left with operating system.

COMMUNICATIONS

There are instances where processes need to communicate with each other to exchange information. It may be
between processes running on the same computer or running on the different computers. By providing this service
the operating system relieves the user of the worry of passing messages between processes. In case where the
messages need to be passed to processes on the other computers through a network it can be done by the user
programs. The user program may be customized to the specifics of the hardware through which the message
transits and provides the service interface to the operating system.

ERROR DETECTION

An error is one part of the system may cause malfunctioning of the complete system. To avoid such a situation the
operating system constantly monitors the system for detecting the errors. This relieves the user of the worry of
errors propagating to various part of the system and causing malfunctioning. Error may occur in CPU and memory
H/w (such as printer) and in the user program ( arithmetic overflow , attempt to illegal memory )

This service cannot allow to be handled by user programs because it involves monitoring and in cases altering are
of memory or deallocation of memory for a faulty process. Or may be relinquishing the CPU of a process that goes
into an infinite loop. These tasks are too critical to be handed over to the user programs. A user program if given
these privileges can interfere with the correct ( normal ) operation of the operating systems.

Another set of O/S function exists not for helping the user but for ensuring the efficient operation of system itself.

RESOURCE ALLOCATION

When multiple user are login the system or multiple jobs are running at same time, resource must be allocated to
each of them, many different types of resources are managed by the O/S. there are mainly 4 resources of
computer system manage by O/S

1. CPU
2. Memory
3. File and directory
4 I/O devices

So there are 4 function of O/S when it work as resource allocator as follows-

1. CPU scheduling
2. Memory management
3. File Directory Management
4. I/O device management

PROTECTION

When several disjoint processes execute concurrently in a system, it should not be possible for one process to
interfere with the others , or with the operating system itself. So protection is required to ensure the controlled

Window GATE

Make a difference OPERATING SYSTEM

Window GATE
SMRITI NAGAR, BHILAI, MO. NO. - 99931 26266 Prepared by RAKESH SAO ( BIT CSE ) Page 17


Window GATE
access to computer resources.

ACCOUNTING
Accounting is required by the operating system to keep track of which users use how many and which kinds of
computer resources. It is a valuable tool for researchable who wish to reconfigure the system to improve
computing services.

SECURITY
OS provides security from unauthorized users.
DISTRIBUTED COMPUTING
(1) Distributed computing refers to the means by which a single computer program runs in more than one
computer at the same time.
(2) In particular, the different elements and objects of a program are being run or processed using different
computer processors.
(3) Distributed computing is similar to parallel computing and grid computing.
(4) Parallel computing, though, refers to running a single program using a minimum of two processors that
belong to one computer. Grid computing, on the other hand, refers to a more dedicated distributed
computing setup-one whose computer 'members' are especially dedicated to the program being
processed.
(5) One single program is executed in multiple systems and sharing data of modules to each other.
Program 1




Computer 1 Computer 2




Computer 3




Module 1
Module 2
Module 3
Program 1
Module 1
Program 1
Module 2
Program 1
Module 3

Window GATE

Make a difference OPERATING SYSTEM

Window GATE
SMRITI NAGAR, BHILAI, MO. NO. - 99931 26266 Prepared by RAKESH SAO ( BIT CSE ) Page 18


Window GATE
PARALLEL COMPUTING
(1) Parallel computing refers to the means by which a single program runs in more than one processor at the
same time.
(2) In particular, the different elements and objects of a program are being run or processed using different
processors in a computer.
(3) Parallel computing is similar to Distributed computing and grid computing.
(4) Parallel computing, though, refers to running a single program using a minimum of two processors that
belong to one computer. Grid computing, on the other hand, refers to a more dedicated distributed
computing setup-one whose computer 'members' are especially dedicated to the program being
processed.

( Virtual Memory Concept Swapping ) Processor 1


Job scheduling CPU scheduling Processor 2 I/O scheduling

Job Queue Ready Queue .. Device Queue
( Long term scheduler ) ( Short term scheduler ) ( Middle term scheduler )

Output Device
Job Pool ( Batch ) Main Memory Processor m
Hard Disk ( one single process divides in multiple modules ) ( Every Processor Divides in Time Slots
Multitasking )










Job 1





Job 1
Mn .. M2 M 1 Mn .. M2 M 1




Module 1
Module 2
Module n

Module 1

Module 2

Module n
Mn .. M2 M 1

Window GATE

Make a difference OPERATING SYSTEM

Window GATE
SMRITI NAGAR, BHILAI, MO. NO. - 99931 26266 Prepared by RAKESH SAO ( BIT CSE ) Page 19


Window GATE
QUESTIONS SET
(1) Windows 95 is
(a) Multi tasking, multiuser
(b) Multitasking
(c) Multiprocessing, multiuser
(d) None of the above

(2) Where does the dispatcher reside ?
(a) In RAM or main memory
(b) In cache memory
(c) In HDD
(d) In external/ auxiliary device

(3) Heuristic scheduling is more efficient then
multilevel priority scheduling
(a) Only for I/O jobs
(b) Only for CPU jobs
(c) None of the above statement is true
(d) Both (a)&(b) statement are true

(4) For a particular code to be shareable, it
should be
(a) serially refusable
(b) Re-entrant
(c) Reducible
(d) None of these

(5) What do understand by busy waiting?
(a) A process periodically checking on a
variable
(b) A process continuously checking on a
variable
(c) A process issuing an interrupt

(6) An event counter
(a) Is an integer counter that does not
decrease
(b) Keeps track of the number of
occurrences of event of a particular
class of related event.
(c) Orders event
(d) Both (a) & (b)

(7) Pick out a wrong statement
(a) Semaphores are used to deal with n
process critical section problem
(b) Semaphores are used to solve
synchronization problems
(c) Semaphores are used to solve
Asynchronization problems
(d) All are correct statements.

(8) In message passing system, how many points
of synchronization are possible?
(a) 1
(b) 2
(c) 4
(d) 6

(9) Why mailboxes are used in message passing
system? Choose most appropriate option.
(a) All process can communicate
independently
(b) One sender can talk to more than one
receiver
(c) To store fixed length messages
(d) To interface with both sender and
receiver

(10) What is true about starvation and deadlock?
(a) starvation only leads to deadlock
(b) starvation is an extreme case of
deadlock
(c) deadlock is an extreme case of
starvation
(d) deadlock an starvation are two
unrelated concepts

(11) pick out false statement :
(a) possibly low utilization
(b) reduced system throughput
(c) increased waiting time
(d) all are true

(12) CPU scheduling may take place under
(a) When a process switches from the
running state to the waiting state, I/O

Window GATE

Make a difference OPERATING SYSTEM

Window GATE
SMRITI NAGAR, BHILAI, MO. NO. - 99931 26266 Prepared by RAKESH SAO ( BIT CSE ) Page 20


Window GATE
request or invocation of wait for the
termination of one the child processes
(b) When a process switches from the
running state to the ready state, when
an interrupt occurs
(c) When a process switches from the
waiting state to the ready state
(d) All of the above

(13) _____ is the module that gives control of the
CPU to the process selected by the short term
scheduler.
(a) Dispatcher
(b) Loader
(c) Linker
(d) Scheduler

(14) Every time scheduling is done, all jobs present
at that time are considered for scheduling. A
job may get scheduled again and again. This is
nothing but ______
(a) Static scheduling
(b) Dynamic scheduling
(c) Preemptive static scheduling
(d) Preemptive dynamic scheduling

(15) One kernel when process p
i
requests an I/O
operation on same device d, and the I/O
operations completed successfully, then
process p
i
changes its state
(a) First to blocked and remain as it is.
(b) First to blocked and finally change to
ready.
(c) First to ready remain as it is.
(d) First to ready and finally change to
blocked.

(16) Which of the following statement (s) is/are
true regarding the process management?
(a) The OS allocates the CPU time to
various users based on certain policy.
(b) The PCB block is maintained by the
CPU.
(c) The list of blocked processes is
maintain in the priority order by the OS
(d) The process switch occurs only if a
process requests an I/O before the time
slice is over or it consumes the full time
slice.
(1) 4 is false
(2) 1,2,4 are true
(3) 1,4 are true
(4) All the above are true

(17) In a batch environment, a process is
created_____
(a) When a new user attempts to log on.
(b) In response on dispatcher
(c) In response to the submission of a job
(d) None of these

(18) In time sharing system, the process for a
particular user is to be terminated______
(a) When memory is unavailable
(b) When user uses invalid instructions
(c) When new user attempts to log on
(d) When the user logs off or turns off his
or her terminal.

(19) In UNIX,
(a) A CPU-bound process is given higher
priority than an I/O bound process.
(b) An I/O - bound process is given higher
priority than CPU bound process.
(c) Both CPU-bound and I/O- bound
processes are of equal priority.
(d) It depends on the scheduling algorithm.

(20) If one solves the problem of producer
consumer using semaphore will have initial
value as
(a) 1
(b) 0
(c) Number of slots in the buffer
(d) Any non-zero value

(21) Which of the following is/are the reasons for
process creation?
(a) (i) new batch job
(ii) new user attempts to log on

Window GATE

Make a difference OPERATING SYSTEM

Window GATE
SMRITI NAGAR, BHILAI, MO. NO. - 99931 26266 Prepared by RAKESH SAO ( BIT CSE ) Page 21


Window GATE
(b) (i) privileged instruction
(ii) if a user request the particular file to
be printed.
(c) (i) for purpose of modularity or to
exploit parallelism.
(ii) the process attempts to use a
resource or file that is not allowed to
use.
(d) None of the above.

(22) The shortest-remaining-time first is same
as______
(a) Non-preemptive SJF scheduling
(b) Preemptive SJF scheduling
(c) Non-preemptive FCFS scheduling
(d) None of these

(23) Dijkstras banking algorithm in an operating
system solve the problems of
(a) deadlock avoidance
(b) deadlock recovery
(c) mutual exclusion
(d) context switching

(24) which of the following are true?
(a) A re-entrant procedure can be called
any no. of times.
(b) A re-entrant procedure can be called
even before the procedure has not
returned from its previous call
(c) Re-entrant procedure cannot be called
recursively.
(d) Re-entrant procedure can be called
recursively.

(25) Cascading termination refers to termination
of all child processes before the parent
terments
(a) Normally
(b) Abnormally
(c) Normally or abnormally
(d) None of the above

ANSWERS
1 b 2 a 3 d 4 b 5 c 6 d 7 b 8 c 9 a 10 c
11 c 12 d 13 a 14 b 15 b 16 c 17 c 18 d 19 b 20 c
21 a 22 b 23 a 24 b , d 25 c











Window GATE

Make a difference OPERATING SYSTEM

Window GATE
SMRITI NAGAR, BHILAI, MO. NO. - 99931 26266 Prepared by RAKESH SAO ( BIT CSE ) Page 22


Window GATE





All the Best my dear Students

Vous aimerez peut-être aussi