0% found this document useful (0 votes)
23 views16 pages

OS Q&Ans UNIT 1

This document discusses operating systems and some of their core functions and concepts. It begins by defining an operating system as a program that acts as an intermediary between a computer's user and hardware. It then discusses batch processing systems, which grouped similar jobs together to speed processing. Next, it explains time-sharing operating systems, which allow multiple users to use the same computer simultaneously by quickly switching between them. The document lists some key services provided by operating systems, such as program execution, input/output operations, and file system manipulation. It also discusses system calls, which provide an interface between processes and the operating system, and parallel processing in operating systems.

Uploaded by

Jittina cj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views16 pages

OS Q&Ans UNIT 1

This document discusses operating systems and some of their core functions and concepts. It begins by defining an operating system as a program that acts as an intermediary between a computer's user and hardware. It then discusses batch processing systems, which grouped similar jobs together to speed processing. Next, it explains time-sharing operating systems, which allow multiple users to use the same computer simultaneously by quickly switching between them. The document lists some key services provided by operating systems, such as program execution, input/output operations, and file system manipulation. It also discusses system calls, which provide an interface between processes and the operating system, and parallel processing in operating systems.

Uploaded by

Jittina cj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

atingSysten ems

C-3
Whatis batch operatin system?
The
operating systems
ing systems of
or these
the
times were
INTRODUCTION imilar jobs very slow and
Unit 1 the processing similar

peoperator wo
were
run each batch.
grouped together
The
in the
simple.
form of batches and
To Speed
SECTION A
output of each
batch was then sent back
o programmer

0.6 What i s time sharing operating system?


Q.1 Define operating system. Nov 2016, 2015, Dec 2010 Nov 2016,
Operating System is a program that acts as an intermediary between user a 2012, Dec 2013, 2010
allows a number of
system
of a computer and the computer hardware. It controls all the computer's resourc A time-sharing users to work on the
same computer
ces me time. Since each action or
and provides an environment for execution of programs. command in a
the short, anly a little CPU time is allotted for each time-shared system tends
user. The switching between
Q.2 State function of operating system. be as isIs so fast that ea
so fast each user gets me
impression that he is the only person
Nov 2017, 2016, 2015, Dec
2010 he processes
sing t h e system.

Functions of Operating Systems:


(i) Memory Management Functions .7 Explain any three services provided by the operating system.
0.7 May 2005
(i) Processor Management Functions
Cii) Device Management Functions Services provided by the operating system are:

1) Program Execution
(iv) Information Management functions
2) I/o Operations
Q.3 List the function and services provided by an operating system. File System Manipulation
3)
Dec.2004
Services Provided by an Operating System calls$?
are:
Q.8 What are system
() Program Execution interface between a process and the operating
System Calls provide the
on their usage.
(ii) 1/0 Operations system. System calls can be classified depending
(ii) File System Manipulation
(iv) CommunicationsS 9.9 What is parallel receiving as parallel in operating system
The data will be sending and
(v) Error detection
(vi) Resume Allocation program? the
Q.10 What is system
system programs
are found
between

(vii) Accounting hierarchy, the


n computer system
(vii) Protection perating system and application programs.

Q.4 Explain in brief real time


operating system. Feb 2002 R1 What is real time system? environments where a large
no. of events,
Real time used in and processed in short
operating systems are used in situations where there is a ver Real time erating system
opera must be accepted
nigh need to get the systems,medical monitoring equipments.
computation done immediately. They are used in
environments nostly, External to the
computer

where there are a large number of events, mostly external to the times Ex: Guided hissile systems
and
De
responded and system ana system?
processed in a short time or within certain dead lines. These operating Dec 2010, 2009
ofsystems are used only in dedicated
control, telephone switching
type
applications. Such applications include indust
equipment, flight control and real time
12 12 What is m u l t i p r o g r a m m i n g

Nov 2016,
2012,

simulations
Neera)'s THH Bemester CA
g ByAlamy

Btann Athea Herefe.rarn

yslem ier, a
egister set
Ihem shae tn ar& star
data, the , ees

net, In wil hay aeal al. Terentiate POCASS Ond program,


Multliammiy eases '1lllzatn hy hetl veen Nov 2017
the aate uba pes and
hal the P avaya haa vme to exe ule pgra are

Program
P r o r e s a

9.13 List differences between bateh processing and


08 multiprogrammin
Nov 201 Aprogram is s set finstructigns
take he ylven nalutions
he tiffeene between batl ptu dsnillu An that are
ogranmnu O aldpe fofin tlhe manlpulations tperterm a
designated
task
Batrh proceasliny Multlprocasalnu a per lhe cod, called 'eyecution
of Inalrullona,
at puessiny isa fom
Muultlprocenliu la the
managemant . A pr0rs 1module that
t i r y i a n n . that of
procenes I Program perform the tasks directly
aiyhtiy od fashned) way system, that s, a
mulklprochor Hxeules modulas concurrently
relating to an operation of a user
saythal i e mputer an
conmputer that like word processing,. executing9
un
Independent mograma
a he whether trns them
slmultaneously Decallse It han more
presentation software etc
than one processlng core,
iRanesiy hot
Q.10 What Is PCB?
a peAPEsng can be used Each procens, whlclh has been created. It Is identified with the heip of a number
singie proaesmr or
3. Multiprocesslng can be done wlth
batch drven of linformation. The linformatilon ldentiles the current state of the process. The required
e s s r systems
or interactlve work
schedules Information s stored In a deta structure called as Process Control Block
9.14 Define process management Q.20 What is aging? Explain, Nov 2016, 2012, Dec 2009
Aask or event being in evecutin
Nov 2012 The aglng Issues wlth an aging operating system such as system performance
is called process. Say a lags that negatlvely employee productlivity. The aging workload to applied to multiple
Ndavtion alsd callea as a
pvcess.
pmgram
WOrk lssues of the system and deslgn and Implementatlon of the operating system.
Q5 What is process schedulingt
Sharaing is a
funaamental funntion of
9.21 What is Convoy effect? Nov 2017
an
operating system Convoy effect Is slowing down of the whole operating system because of few
9.16 Define interprocess SlOw processes. In a multiprogrammlng environment, if multiple processes are waiting

nD communication
S Ommucaton
involves sending information
Nov 2015, 2011 or the CPU time for executlon In first come first serve" method.
h . hs from one proc
on Deaeievad usng many
w h enaves e a methods such as
maildox >y* Q22 What is FCFS scheduling?
vtua
ommunications network, or use
First-come-first-serve (FCFS) Is a simplest scheduling algorithm.
Here the
througn is allocated the CPU first processes are dispatched
Ocess that request the CPU First,
7 Waat is thread? Wite any acc to thelr arrival time on the ready queue
i.e. requests are scheduled in
one rding
advantage.Nov 2011, De 2010 the order in which they arrive the system.
a t i n gS Y s t e m s

Neeraj's Third Semester BCA


anner
Advatanges:

C-6
C-7
Increased perfornma
dispatcher. ance, since
0.23 Define the terms scheduler and Nov 2015 (a)
P rprevious
e job job finished it was
A scheduler is a software product that allows an enterprise to schedule 3sl0le for
and scheduling is very simple
job to start as scan as
work include running
computer batch tasks. These units of a securitu
(b)
track
trd program
or updating software.
(c)
Provides
simple forms of
A dispatcher is a person who handles the tlow of information, people, and pisadvantages: file-management
from a centralized headquarters. Turn round
equipment time can be
(a) large from users
Nov 2012, May-2005 difficult to debug point
Q.24 What is context switching?
(b) More
the of view
program
in a multi programming environment it is necessary to move from one procece job could be enter in
to another. Switching the CPU to another process requires the saving state ofthe
(c) A a
infinite LOOP
Beacuse of slov I/0 devices, the CPU
d)
old process and loading the saved state for the new process. This process is known is often idle.
as context switching.
plainmulti-programming system. Mention its
Context switch time is pure over head, because the system does no useful advantages.
work while sitching context switching is highly dependent on the hardware
support aoal of multiprogramming is to improve the
The
Nov 2016

provided to the operating system. system utilization by exploiting


LrrenCy between the CPU and the 1/0 subsystem. If 1/0
t h ec o n c u r r e n

ation for subsystem is busy


with an 1/0
Operati one user job, the CPU can execute another user job.
Q.25 Differentiate between policy and mechanism. Dec 2010 This requires
uires the presence of multiple user jobs simultaneously in the
The policies what is to be done while the mechanism specifies how it is to computer
be done. For instance, the timer construct for ensuring CPU protection is mechanism. memory.

On the other hand, the decision of how long the timer is set for a particular user It usually support multiple users, in which case they are also called multi
is a policy decision. Systems. Multiprogramming increases CPU utilization by organising jobs
1&F such

that the CPU always has one to execute.


SECTION B & C Advantages of multiprogramming are:
CPU utilization
Q.1 State various types of 1. Increased CPU Utilization: Multiprogramming improves
operating system. Nov 2012, 2011
it organizes a number of jobs where CPU always has one to execute.
8
The various type sof operating system are:
means total number of programs
2. Increased Throughput: Throughput
() Batch processing system CPU does not wait for
In multiprogramming,
EXecuted over a fixed period of time.
(i) Multiprogramming system thus resulting in an increased throughput.
O for the program it is executing,
is improved
(ii) Time sharing system time for short jobs
Time: Turnaround
S. Shorter Turn around
(iv) Parallel system
greatly in multiprogramming.
(v) Distrubuted system multiprogramming, more than one

Utilization: In utilized.
I m p r o v e d Memory is optimally
(vi) Real time system ogram resides in main memory.
Thus memory

disadvantages.
Q.2 What is batch processing system? Give its advantages and Give its
advantages and
Nov 2017, 2015

disadvatages.
9.4 Wh
i s time sharing
system?
tne s a m e
computer
worK On
to
ne of users system tends
operating systems of these times very slow and simple. To speed
were allowsa
number
in a
t i m e - s h a r e d

ne processing similar jobs were grouped together in the form of batches Atime-sharing system command
Ine SWitching
between

ne
operator would run each batch. The anu the same time. Since each
action or
allotted
for each
user.

to programmer. output of each batch was then sent Das be Only a little CPU time
is
e r a l i n gS Y s t e tems

Neeraj's Third Semester BCA Scane


C-8 anner Require memory and resource management C-9
me impression that he is thhe
the processes
is so fast that
each user gets
only person is real time
ent and protectior
using the system.
vhat system? Give its
advantages and
Advantages:
users to share computer simultaneously Real
timene Operating svsystem
operating
used in disadvatage
Nov 20155
(a) Allow many
External the computer
to the
to
computer environments where a large no. of
with the job when it is executina systems,
issile systems and must be accepted and processed event
can interact
(b) Users a s t l y

pmes Ex: Guided

monitoring equipments. shor


in
Disadvantages:
medical
Advantages:

More complex than


multiprogrammed 0.S.
(a)
(b)Tt requires some form of memory management and protection (a) M Miultitasking operation is
accomplished by
of each other, sheduling processes fro execution
42Dendently
0.5 What is parallel systems? Give its advantages and disadvatagee nd Memory management in
es. b M real-time systems is comparitively less demanding
(iv) Parallel systems: As the meaning itself suggests, syste,ms have in other opearating system.
more
than one processor sharing the computer Bus, the clock, memory and peripher
than

tc) File management increases the


speed of access.
decrices. Disadvantages:
Advantages:
a(a) It cannot manage thousands of inturrupts per second without missing a
(8) Save money because the processors can share peripherals, cabinets and single e v e n t .

power supplier
(b) There is a limit allocated for each even.
(b) Increase reliability.
(c) Implementation is too costily.
Disadvantages:
(a) Implementation is complex 0.8 Discuss the various functions of the Operating System.
Dec 2013, 2009, Feb-2002
(b) Require resource management and protection
Functions of Operating Systems are:
Q.6 What is distributed system? Give its advantages and disadvatages. Functions:
(i) Memory Management
The processors do not share memory or a clock. Each
processor has its own Keep track of the memory.
local memory. The processors communicate with one another
through various memory, when is gets
Communication line such as buses or telephone lines. These
-

Of multiprogramming, decide which process gets


systems are referred and how much.
to as distributed system. The
processes in a distributed system may vary in size request it.
and function. Allocate the memory when the processes
no longer needs it
or has been
when the process
There are some -Deallocate the memory
advantages and disadvantages:
terminated.
Advantages: Functions:
(i) Processor Management
and the status of
- Resource sharing process.
Keep track of the processors
the processor.
a chance to,
use
Computation speed
-

up Decide who will have hardware


by setting up necessary
- Reliablity
to a process
Allocate the processor
- Communication
reglster. processes
terminates.

when any
Deal cate the processor
Disadvantages:
- Implementation complex
(n)Device Management Function:
control units.
channels,
the devices,
Keep track of
e r a t i n gs Y s t eMS
m
Neeraj's Third Semester CA
C-10 Scann
Allocate the device
and initiate the I/0 Operation.
(8) Main Memory
Aanagement: Ma C-11
-

bytes. Each word


byte has its own
meme is a
large
Deallocate the device
address. The array of words
emory during the
instruction fetch CPU fetches
(iv) Information Management
Functions:
ain
cycle instructiontrom
information such as its location, use, status (i) File Management: Computers can
Keep track of the store
-

etc of
physical media.
information on severa d fferent
Keep track of the information in allocating and deallocatino p e s

urces 4) 1/0 System


Management.
Q.9 Explain structure of operating system structure. Secondary Storage
-

The operating systems have evolved gradually over the years, in recent
5) Management
6) Networking.
a number of design new design elements have be introduced into them years, 7) Protection System.
multi processor machines, increased machine speeds, high speed networe as
orks and a 8) Command Interpreter System.
variety of memory storage devices. Ihe evoution or modern
operating systems .

are:
Personal
Explain the service provided by the operating
system.
Network
Computing OS Nov 2015, Dec 2010
An operating system provides an environment for the execution of programs
System software
Time Human computer arovides certain services to the programs and to
the of those
Shaning interface
users
programs.
The services are as follows:
Model

scheduln Clier Embedded 1) Program execution: The system must be able to load a program
into

an g,pemrmoatenecntgtioemnent
OS
memory and to run that program. The program must be able to end its execution,
scheduling
Real
time
either normally or abnormally (indicating error).

2) 1/0 operations: A running program may require 1/o. This 1/0 may involve
a fle or an I/0 device. For specific devices, special functions may be desired For
Memory efficlency and protection; users usually cannot control I/0 devices directly. Therefore,
Batch management the operating system must provide a means to do I/0.
Modern Network storage Small
protection files OS Resource Computer 3) File system manipulation: The file system is of particular interest.
scheduling9 management
Obviously, programs need to read and write files. Programs also need to create and

delete files by name.


The design of an
operating system therefore depends the 4) Communications: In many circumstances, one process needs to exchange
Service provided on following:
normation with another process. Such communication can occur in two major ways.
Interface available to users and ne first take place between processes that are executing on the same computer;
program
Components and their
inter-connections
E Second takes place between processes that are executing on different computer

that together by a computer network. Communications may be


Q.10 What are the
Operating System Components.
ems are tied
by the technique of message passing,
in which
piemented via shared memory, or
Nov 2017, 2011, NES of information are moved between processes by the operating system
Operating System Feb-2002 needs to be of possible errors.
(0 Process Components are as follows: ) Error detection: The 0.S constantly
aware

error or a

Cime, Management: A process needs certain


memory files and
Errors may occur in the CPU and memory hardware(such as memory
on tape, a connection failure
when it 1/0 devices. These resources Inclu pow as a parity
error
is created resources are either ess rallure), in the I/0 devices(such printer),and in the user program (such as
or
allocated while it is given to i c on
lack of paper in the
running. an
etwork, or
to access an llegal
memory location, or a too-
arithm
metic overflow, an attempt
o r a t i n gs y s t e m s

Neeraj's Third Semester BCA C-13


ner
C-12 3) File S y s t e m stem Manipulation: It
should be
the O.S should take the ite files. They also need to erase obvious that programs need
great
use of CPU me).For each type
correct and
of
consistent
error,

computing.
appropriate read and write

and delete files by


name
t

ensure
action to users are logged on to sv Dlain system program.
allocation: When multiple system or o.1
E 3x p l a i n

6) Resource resources must be allocated


are running
at the same time, to each the
Eue to the system programs development and execution of
multiple jobs of resources are managed by the operating svek application programs,
cution of application programs becomes easier.
execu
Many different types
and
them, ana rie storage) may have special alloca . ment
evelopn Syster
programs
as CPU cycles,
main memoY, divided into the following categories:
Some (such have general r e a u e s t atlon be
whereas others (such as I/0 devices) may an (0) File management
code, how best to use the CPU, operating system
determining have
code. For instance
in
(i) Status information
that take into account the speed of the CPU, the jobs th:
CPU-scheduling routines that
executed, the number of registers available, and other factors, There (ii) File modification
must be
allocate a tape drive for use by a job. such routine One l might
also be routines to ocates Programming language support
internal table to record the drive's new (iv)
an unused tape drive and marks an user. (v)Program loading and execution
Another routine is used to clear that table. These
routines may also allocate plotters
devices. (vi) Communications
modems, and other peripheral
7) Accounting: We want to keep track of which users use how many and (vii) Application programs
which kinds of computer resources. This record keeping may be used for accountina (viii) Command interpreter
(so that users can be billed) or simply for accumulating usage statistics. Usage
statistics may be a valuable tool for researchers who wish to reconfigure the system Q.14 Explain briefly system call for the process management.
to improve computing services. between a process and the operating9
System Calls provide the interface
8) Protection: The of information stored in a multi-user computer
owner calls can be classified depending on their usage.
system. System
system may want to control use of that information. When several disjointed processes in five types:
System calls can be roughly grouped
execute concurrently, it should not be possible for one process to interfere with
the others, or with the operating system itself. Protection involves -System calls for the Process Management
that all ensuring
access tosystem is controlled. Security of the system from outsiders is
resources System calls for the File Management
also important. Such security starts with each - System calls for the Device Management
user having to authenticate-himself
to the system, usually
by means of a password, to be allowed to access the resources. Communication Management
If a system is to be System calls for the
protected and secure, precautions
must be instituted throughout Maintenance
It. System calls for the Information
Process Management
System calls for the
Q.12 Explain any three execution either normally (end)
services, provided by the operating to halt its
system A process needs to be able
)
Nov 2012, May - 2005 Or abnormally (abort)
Services provided by the operating system want to load and
e x e c u t e anotheer
are: 4).A process executing one
program may
1) Program Execution: The system must be
memory and to run it. able to load a
program program.
2) 3) Create and terminate a process
I/o Operations: A running program may require 1/o. This I/o may olve
a rie or an I/o device. For 4)Get or Set process attributes
directly. efficiency and protection users
cannot control /o of these.
different categories
Q.15 What are a r e s y s t e m calls?
Briefly explain 2012, Dec 2009
Nov 2017,
t on System
calls.
the Operating
short note and
te interface
between a process

em Calls provide the


nperatingSystems
Neeraj's Third Semester BCA S
C-14

These are
generally
vailable
avai as assembly language instruc
ctions,
Scanner and
Communicati

sing model and


There
are two
common models of
C-15

System. manuals used by assembly-lanais


assembly-language essage pas
shared memory communicaio
tion:

programmertheys.
in the various model.
are usually listed
can be grouped
in five different categoriec .
tion is
intormatior exchanged thru an In
interprocess communication message passing
mode
System Calls
need to be able to
ectem
operating system before before communication can take facility provided by the
1. Process
Control:- A running program
halt its network has a host connection must be opened.
in a place, a
execution
ch computer

abnormally (abort). If a System Call


is made to name, such as an IP
kach

either normally
(end) or
known. Similarly each process has a name by which it

a program
abnormally or a
problem and causee
program runs into a n terrorermintrap,ate
dentifier
an equivalent ider by which an
s common

Operating
process name, which is translated
a dump of
memory is
sometimes taken and an error message
generated. The dump into cessed System Calls do this translation.System can
refer to it. The gethostid
Most process that will be receiving
is written to a
disk and may be examined by a
debugger to determine the cause ions is special purpose ademons
abnormal circumstances, the Operati system programs provided
c o n n e c t i o

of a problem
under either normal or
The clos connection
call terminates the for that purpose.
must transfer control to the command interpreter
command interpreter. The command inte System communication.
tn shared memory model, processes use
reads the next
command. then map memory system calls to gain
to regions of memory used
by other processes. Shared
A process or job executing one program may want to load and execute memory requires that
acces

allows the command interpreter to


execute another several p r o c e s s e s agree to remove the
restriction of OS to prevent one
process from
program. This feature execute a
ressing another process's memory. They may then exchange information
am as by reading
directed by. If control returns to the existing program when the newe data in these shared areas.
terminates, we must save the memory image of the existing program. If hoth program and writing
is useful when smaller number of data is need to be
Method passing
programs both programs continue concurrently, we have created a new job or n exchanged,
hecause no conflict is need to be avoided. It is also easier to implement than s
to be Multiprogrammed. If we create a new jod or process, we should be able t shared memory for interceptor communication. Shared memory allows maximum
control its execution.
to
speed and convenience for communication, as it can be done at memory speeds
2. File
Management:- We first need to
be able to create and
delete files when within a computer.
Either system call requires name of the file or perhaps file attributes. Once a
fie
is created, we need to open it and use it. We may also read, write or 2015,
Finally we need to close file.
reposition, Q.16 Explain spooling. Nov Dec 2013, June 2003
Spooling (Simultaneous Peripheral Operation Online)
We may need these same set of
operations on directories. In addition, in Before the introduction of disk technology, the cards being read directly into
file and directories, we need to be able to determine the
value of different attributes the memory and then the job being processed. Now, the cards are read with the
and perhaps to reset them if
necessary. File attributes include file name, file type, help of a card reader to the disk. When the job is to be excused the operating
protection codes, accounting information and so on.
system gets its program and the data from the disk. Similarly when the job requests
3. Device
Management:- A program when running
may require more resources me printer to output a line, that line is copied into a system buffer and is written
Iike more This form
memory, tape drives, access to files,
and so on. If the resources are O the disk. When the
job is completed the output is actually printed.
avallable, they can be granted and control can be Or processing is called spooling. The process of spooling is shown in below fig.
After we are finished with
returned to the user program.
a device, we must
release it. These functions are
to open and close
system calls for files.
simi
Disk
4.Information Maintenance:- Many System Calls exists simpiy the
purpose of transferring
information between the user ting
System. Most
systems have a System Calls to program and tne a
may
also return info return current time and date
about the system, such as verslon
number of the the number of current users,
operating system, the amount of free u and
S0 0n. In
addition, the operating memory or disk space,
SP*
there
are
system calls to access this system keeps info about all its processes, a Card
Printer
information. Reader
Neeraj S InirdsEnester BCA peratng2.
C16

are itS advantages


Scanner process state: As a
process execut es, It
C-17
er
buffering
What
is spooling?
o17 What the procesS state at
Dec. given instance. anges he tates.
t h eone of

Following are

Spooling: It is
an acronym
for Simultaneous peripheral
operation 2005 jew: The process is
being created.
shown in fig.
-line. The Instructions
spooling
of is ci) Running: are
process being executed
(ii) Waiting: The process is
nletion or reception of signals. waiting for some event to occur,
Disk ur, such as an
Ready: The process
is watng to be
Terminated: The process assigned to a
processor
( has finished execution task.
Q,20 W h a t is PCB? Explain briefly. Nov
Fach process, which has been 2016,2015, Dec 13,
13 Feb 02
Card created. It is identified with the
o fi n f o r m a t i o n . The information identifies the current state help of a number
Reader CPU of the process. The required
Printer informatio red in a
is storeddata structure called
as Process Control
Block.
Fig: Spooling process The operating system uses PCB to keep track of
the status of the process.
The advantages over buffering are: Some of the information included in the PCB are:
Scheduling of process and memory is very simple. 1. Current state of the process
(Ready/Run/wait)
.It do not require any critical device management. 2. Process identification number.
It provides simple forms of file management 3. Process priority
.Little protection and no conCurrency control 4. Pointers to allocated resources
of file access is required,
5. Input-output status information
Q.18 Explain virtual machines. Nov
The basic idea behind a virtual machine
2011, Dec 2010 6. Program counter
is to obstract the
single computer containing the
hardware of a 7. Other fields
CPU, memory, harddisk, network interface
so on into many different environments. This words an cards and
illusion of each Process
executing environment running its own seperate Pointer
does not provide the additional
private computer. Further a virtual machine 6tate
features of a process such as
file system. system calls and a Process Number

Process Counter
Q.19 Define Process. OR Job and
process as related to O.S. Registers
Nov 2016, 2015, Dec
A task or
job or event being in execution
2009, June-07 Memory Limits
being in is called process. Say a
execution also called as a progrdi List of open files
process.
process is more than
as
represented by the value of theprogram code, it also includes the current actV
sers. A process generally alsoprogram counter and the contents of the
includes the process. Stack pr
rs
Process Control Block (PCB)
dla (Such as subroutine parameters containing tempo Fig:
global variables. temp varsables) and a data section Con
rangS
Neeraj's Third Semester BCA C-19
C-18 canner
Jobs waiting
Nov 2015, 2011, Dec 10,
scheduling?
Q.21 What is
preemptive
is aranting acceptable respon
guara
o09
secheduling is important
Preemptive
ctive,. The
premption effective,,
make The times. Jobs waiting
Preemption is
without cost. To
not processes must
that the next process Is ready for the CPU i for initiation
ho
be keot in main storage so

running programs in main


utilizatior
en it becomes available,
keeping non
storage alsoi nvolves
High Level scheduling
overhead.
effect on the design or the operating system
Preemption is also has an kernel
The decision may takes place under any or the following two conditions Suspended process
waiting for activation
When a process switches from running state to ready state( eg. intrrunte

Occurs) Intermediate scheduling


() When a process switches from waiting state to ready state (eg. Completion
Active processes
of I/0)

Q.22 Give the meaning non preemptive scheduling. Nov 2015, 2011. Low level scheduling
In a non preemptive scheduling, a selected job runs to completion. It means
that the running process retains ownership of the allocated resources including the Running Processes
processor, until it voluntarily surrenders control to the operating system. However
when the running process becomes suspended as a result of its own action, say
by waiting for an 1/0 completion, another ready process may be scheduled.
The decision may takesplace under the of the
Completed
one following conditions.
() When a process switches from the running state to waiting state (eg.
I/0 request)
Non-Preemptive
between preemptive and
(i) When a process terminates Describe the difference Nov 2012, Dec-2004
Q.24
Under the non-preemptive scheduling, once the CPU has been allocated scheduling algorithm.
to
a process, the process keeps the CPU until it releases the CPU either Differences are:
by terminating
or by
switching to the waiting state. Non-preemptive

Ex: This
Preemptive
scheduling method is used by Microsoft Windows Environment.
be taken away
1. The CPU can

If one process has been given tne


Q.23 Explain three levels of scheduling.
There are three
CPU, the CPU cannot be taken
important levels of scheduling: They are: from the process to wait by
() High level scheduling 2. Shortest jobs are made
.Shortest jobs are no need to wait by longer jobs
i) Intermediate level
scheduling longer jobss 3. Low cost
(ii) Low level scheduling 3. High cost overhead process
a
4. It is not
Keeping non running progralis
main storage involves overhead idle because of 1/0
CPU is often
5. The
S.Maximum utilization of CPU request.
a t i n gS y s t e m s

Neeraj's Third Semester


BCA C-21
C-20
Scanner
Rescheduling is necessary
6. Scheduling is done one time New
Ad mitted
6.

7. If interrupt
occurs, process is 7. If interrupt occurs,
process is Interrupt Terminated
temporarily suspended terminated.
Eit
for real time, and 8. It is suitable for batch Peady
8. Its in suitable processing Punning
interactive time sharing systems
Shed ular dispatch
or event
completion
VO Wa iting VO or event wait
Q.25 Explain FCFS scheduling. Dec
2013, 2010, 2005
First-come-first-serve (FCFS) is a simplest scheduling algorithm. Here.
the CPU First, allocated the CPU first processes are the Fg: Satesof a process
process that request
according to their arrival time on the ready queue 1.e. requests are dispatched
scheduled n
the order in which they arrive the system.
The New State indicates that a passive program has just been converted
The FCFS is a nonpreemptive:Once the CPU has been allocated
to a proceee to a
dunamic activity called a process. In the RUNNING state the process possess
that process keeps the CPU until it releases the CPU, either resources required for its execution including the CPU. The running process
by terminating or
requesting 1/0. by
eCutes a sequence or instructions and may go to the WAIT state when it calls
Advantages: n the Operating System to perform on I/0 - Operation. In a normal sequence

(a) Because of non-premption,


and every processes.
no inturrupts during the execution of
each
d 0perations only one process may be
the resources and the CPU, however
using
number of processes, which are ready for execution, they are
there may be any
state. Once the execution of the process in completed is goes to
(b) Suitable for batch system. in the READY

Disadvantages: th11
() It takes long average waiting time. 0.27 Explain co-operative process. Dec 2013
(i) One CPU and many 1/0
requests at thís situation both CPU if it does affect or gets affected by
in idle state. and 1/0 are A process is said to be co-operating
shares
co-operating process, definitely
other processes executing in the system. A
(ii) Not suitable timesharing systems. contains the some of the benefits.
data with other processes. The co-operating process
(iv) Cannot guaranteed good of information
Concurrent access to some piece
response time. () Information sharing:
to server users.
be provided
shared file
Q.26 Describe the process state
help of process
Un as a can

speedup computation
of a task, the task
transation diagram. ( ) Computational speedup:
To
will be executing in parallel
Process State: As a Nov 2017
divided into subtasks so
that each them of
S defined
in part
process executes, it changes state. The
state of a process De
by the current activity of that with others.
one of the process. Each process may be in construct a modular system by dividingg
to
following states. (n) Modularity: It may
be required
threads.
or
the Ystem functions into separate processes
mechanism is required for co-operating
nter process
communication (IPC)
information.
processes to exchange data and

process schedulers. 2013,2009, May 05


2016, Dec
different
EXplain the
Nov 2017, the part
queue is
done by
corresponding
process
and is
ne selection of the
of the called as scheduler
operating system
a t i n gSystem. ms
Neeraj's Third Semester BCA Scan
C-22 anner Explain sJF CPI
C-23

Short-term-scheduler. The
scheduler selects from amono
the heduling algori with an example.
0)
that are ready to
execute and allocates the CPU to
one of them. processes Dec 2010, 2005
In memory
scheduler. All the processes are spooled to a suitahia SHORTES JOB FIRST ($JF)
c) Long-term
storage Scheduling:
where they are kept
for execution at a later stage. The long-term The main conside
deration of this algorithm is
device,
the jobs from the job p00l and loads is into memory for evecexecution. scheduler ch process. wWhen the CPU is available. It
the time required for the execution
selects is assigned to the
smaller next
each
vt CPU CPU execution time. If two or more process that has
criteria. R What are processes have the
Q.29 Explain CPU scheduling scheduling same next
Dec 2013, 2005, riteria, then the CFS is used to break the tie.
explain briefly? burst

2005 p ortage -Job First


-

Scheduling
is Provably
The following CPU Scheduling criterla are:
Optimal, in that it gives the
average waiting time for a given set of processes.
1, CPU utilization: We want to Keep the CPu as busy as
CP
i m u m

possible. Consider the following processes arriving for execution at time 0 with the
100 percent.
utilization may range form 0 to
burst given in microseconds.
2. Through put: The number of process that are completed per time unit ength
thof the CPU
caled throughput. Process Execution Time
3. Turnaround time:The interval from me time of submission
of a procese P 5
to the time of completion is the turn around time. Turn-around time is the sum
P
of the periods spent waiting to get into memory, waiting in the ready queue.
4. Waiting time: It is the sum of periods spent
waiting in the ready P
queue. 3
5.Response time: The time from the submission of P
a request until the then the result of their
first response is produced. If the process arrived in the order P Pay Pa P,
shown in the Cantt Chart below.
execution with SJF would be
Q.30 Explain the operation of multilevel scheduling.Nov 2017,Dec-06
This scheduling has been created for situations in which processes are P3 P4 P1 P2
classified into different groups. For example, a common division easily
is made between 10 17
interactive processes and batch processes. These two
types of processes have different
response time requirements, and so might have different
scheduling needs. In Banker's algorithms. Nov 2017,2016,2012, Dec 10,09,05
addition, interactive processes
may have priority over batch processes. Q.32 Explain avoidance policy. Hence no validity constraint
uses an
Banker's algorithm: It request. The
make any kind of
resource

are free to
Highest priority 5 Specified, and processes,
test and safety
test.
feasibility
System process ystem uses 2 tests, called
feasible request if, after granting

e a s i b l e request: A request
Req,x is a
exceed the total
number
Interactive Processes total allocated
resources of class K do not
request, the
Interactive editing processes of resources of class K system.
a safe request
at time t, after

feasible request
Req J, K is of allocations
request: A one sequence
Batch processes are at least
t. There exists
he at time
request complete.
n can
is kept
Lower priority Student processees released by which all processes

at any
time. An unsafe request
safe requests
e system only grants
Multilevel Queue scheduling Pending even if it is feasible.
described,
scheduling. systems are
Q.33 Explainreal time
real time
operating
two categories.
required by divide into
Cheduling
facilities comptueris
general-purpose

Real-time computing within a


S y s t e m 1 5

C-25
Neeraj's Third Semester BCA Scan gets
a smallnall lim
limit of CPU time
p rrOcess
o c time has ela psed, the (time quantum),
C-24
nds. After t h i s
process is
usually -100

real-time
systems the ready queue. preempted (halted) and added
Hard
(i) e

(i) Soft
real-time
systems t h e

the
Consider t he following set of
processes that arríve at time 0, with the
are normally required to evee...
-Burst time given in milliseconds. lengtn
systems: Systems and t h e CPU-Burst
Hard real-time of time. If the cchad
guaranteed period
within a
ete a given task Within the specified time , can Process Burst time
be completed
arantee that the process
will admits 24
P1
the process

are not so restricted. Ihey require critical proc 3


Systems ocess P2
ci) Soft real-time:
top priority over other processes.
P3 3
to receive
se quantum time of four milli seconds. then process P1 gets the first
Q.34 Explain scheduling algorithm. Dec 2013 It we

nds. Since it requires another 20 milliseconds, it is preempted (halted)


The CPU scheduling algorithms are broadly divided into two categories nds milliseconds.

whether they support pre-emptive or non-pre-emptive scheduling discipline the


first time quantum, and the CPU is given to the next process the queue
first time in
on
if the CPU can be taken awav r a m
ter o9 Since P2 does not need 4 milliseconds. It quits before its quantum time
scheduling algorithm is pre-emptive
P2.
)A eThe CPU is then given to the next process, process
r o c e s s

P3. Once each process


the running process Pre-emptive scheduling is very useful in high priority process
rur an additionai
one time quantum,
the CPU is returned to process P1, for
which requires immediate process. received
Refer the following block diagram:
(u) A scheduling aigorithm is non-preemptive if once Cpu is alloted to a process, ne quantum.
it cannot be taken away from that process until completion.

Q.35 Explain any two methods of algorithm evaluation.


P1 P2 P3 P1 P1 P
P
Dec 2013, Nov 2011 14 18 22 266 30
4i 10
1. Simulation- To get a more accurate evaluation of scheduling algorithms, = 6+4+7/3 = 5.66 mi.s
The average waiting time
we can use simulations. Simulations involve programming a model of the computer
((6+24)+(4+3)+(7+3)/3
around time
system. Software data structures represent the major components of the system. The average turn
= 15.66 mi.s
The simulator must have variable that represents a clock. As the value of the variable
increases, the simulator modifies the system state to show the activities of the devices,
and the scheduler. Advantages:
processes During the execution of the simulation, statistics of multiuser systems
the algorithm performance are collected and printed. The data for simulation can (i) Suitable for timesharing
be generated by using random-number
generator. This can be" programmed to generate (i) Good response time time
processes, CPU burst times, arrivals departures etc. according to other process waiting for long
The distributions can be
probability distributions. n) Because of premptive,
no

defined mathematically or empirically.


2. Disadvantages:
Implementation- This method puts the algorithm in the real system under
operating conditions. However most users are not 0) Implimentation is difficult
interested in building a new time.
Operating system. They only want to execute their processes and use the (i) Long average waiting
Gantt
AConstantly changing operating resuit with an example
and a
does system not help
the users to get their work algorithm 2016, 2011
An
or
algorithm is said to be
flexible, if it can be altered by the system managers Q.37 EXplain FCFS scheduling Nov 2017,
Here the
by the users to suit a chart. algorithm.
specific application or a set of applications. simplest
scheduling
dispatched
(FCFS) is
a are

Q.36 Explain Round Robin


First- Come-first-serve

is allocated
the CPU first
processes

are scheduled in

ouna Robin Scheduling.


(R-R) scheduling alogorithm is
Nov 2017, Dec 2010, 2009
according to their
uest the CPU First,
ss that reque
time on
the ready
arrival
queue
1.e. requests

their
ysems. It is
very much similar to FCFS designed especially for time-sha the ord the system.
scheduling. But premition Is addu Here in which they arrive
CA SCann
-26
Scanneer we discuSS Scheduling C-27
some fixed no's, terms
H e r e

nonpreemptive: Once the CPU has been allocated to rally such of


high priority
The FCFS is a a process, ties
are
and low
the CPU until it releases the CPU, either by eement on ether 0 (zero) is the highest
whether
priority and
process keeps
requesting I/0.
minating or
by Een
the following exa mple:
Owever there
lowest priority.
is no
gener
consider
) In this scheme the process, which requests the CPU first is allo Burttime
CPU first.
allocated the P r o c e s s

10 Priority
P1 3
n) The implementation requires us to consider a natural data structira 1
P2
called 2
a queue. P3
(it) When the process enters the ready queue, its PCB is linked on 1
p4 4
tail of the queue.
the P5
5
2
(iv) When the CPU is free, it is allocated to the process at the head priority scheduling, we would
ready queue.
af
the
s
Gantt c h a r t :
schedule these processes according following
(v) It is very simple to understand and implement
Consider the following set of processes that arrive at time 0, with the P2 P5 P1
lenath P3 P4
of the CPU-burst time given in ms
0 1 16 18 19
Process Burst Time
The average waiting time
P1 (6+0+16+18+1)/5
P2 8.2 mi.s
P3 The average turn around time =((6+10)+(0+1)+(16+2)+(18+1)
+ (1+5))/5 = 12 mi.s
If the processes arrive in the order P1, P2, P3 and served in
a.
FCFS order Advantages:
we execute the process as given in the following Gantt Chart.
(i) Good response time
P1 P2 | P3 Cii) Support multitasking systems
12 13
(ii) Supports both preemptive and non-premptive
The waiting time is 0 ms for the process P1, 8 ms for process P2 and 13
ms for process P3.Thus,
Disadvantages:
i) Implimentation is difficult
The average waiting time is (0 + 8+ 12) / 3 6.66ms
(ii) It results in starvation
Theaverage Turnaround time is (0 + 8) + (8 4) + (12 +1) / 3= 11 a simple
ms algorithms available, usingNov 2012
9.39 Compare all the scheduling
. If the processes were
sent in the order P3, P2 and P1 then, waiting time example problem.
for process P3 is
0, P2 is 1 and for, process P1 is 5 ms. For the FCFS:
Thus, the average waiting time is Process Burst Time
(0 + 1 + 5) /3 =
2ms.
P1
Q.38 Discuss priority 24
A
priority is
scheduling.
associated
Nov 2012 P2 3
with each process and the CPU is allocated
LES the to P3 P2, P3 The Gantt
WIh
server (FCFS)
highest
order.
priority and equal priority are scheduled in first come arrive in the
order: P1,
,

Suppose that the processes

nart for the is


schedule
Neeraj's
a n gSy

Third Semester
C-28 BCAISc
Scanner P3 2
= 0; P2 = 24; P3 = 27
C-29
for P1
Waiting time
pP4 1
4
Average waiting time: (024 t+ 27)/3 =17 P5 4
2
For the SJF
The orocesses are.
assumed to have
Associate with each process the length of its next CPU burst.

schedule the process with the shortest time,


Use these
P5
all a t
time 0. arrived in the order P1, P2, P3, P4,
lengths to
antt charts
Two schemes
D r a wf o u r
illustrating the execution of these
Nanoreemptive - once CPU given to the process it cannot be preempted
FCFS,
S. preemptive
pre a non
priority (a smaller
and round robin processes using
priority) and ( priority number implies a
completes its CPU burst. until higher
scheduling. quantum =
2)
Preemptive if a ne process arrives witn CPU burst length less than
What is the waiting
time of each
process for each of the
remainie in part (i)7 scheduling
tume of current executing process, preempt. his Scheme is know
as the
maining algorithm
Remaining Time-First (SRTF). ortest What isie the turn around time of
each process for
each of the scheduling
SJF optimal gives minimum average waiting time for
is a given:set of algorithm
in part (i?
Process Arrival Time Burst Time processes.
FCFS:
0.0
P2 2.0 P1 P2 P3 P4 P5
P3 4.0
p4 5.0 11 12 16
SJF (non-preemptive)
SJF
Average waiting time =
(0 + 6 3 + 7)/4 4
For round robin: P2 P4 P3 P5 P1
Process Burst Time
1 2 8 16
P1 53
P2 7 Non preemptive priority:
P3 68 P3 P4
P2 P5 Pl
P4 24
13 15 16
The Gantt chart is: 5
Round Robin ( quantum 2 ):

PPP P.PPP PPP


0
PIP2P3 P4 PI PSPLPI
10 12 14 16
20 37 57 77 97 0 2 5 6 8
117 121 134 154 162 3
i) FCFS:
ypically, higher average turnaround than time of P1 = 0 milliseconds
SJF, but better response. Waiting
time of P2 = 8 miliseconds
9.40 Consider the Walting
CPU-burst following set of processés, with the length of the Waiting time of P3
=9 milliseconds
time given in milliseconds
Process Burst time milliseconds. Waiting time of P4
= 11
milliseconds
P1
Priority Walting time of P5
12 + 12)/5 =8 milliseconds
8 =
(0 +8 +9+11
P2 waiting time
1 dge
1 SJF: milliseconds
8
waiting time of P1
=
C-30
Neeraj's Third Semester BCA
CA Sca
Scanner rating.S y s t e m s

Waiting time of P2
=
0 milliseconds Nonpreemptive priority: C-31
time of P1
Waiting time of P3
2 = milliseconds
Turn
aroun
=
t +5
alind time of 8+t2=
Waiting time of P4= 1 milliseconds

Waiting time of P5 4 milliseconds


urn arou

ind time of
P2
P3
=ti +0+1+2= (M+t2+13)milisecon
(N+2-
conds
miliseconds
= Turn around =
tl +13+2 2
Averagewaiting time = ( 8 +0+2+ 1 + 4 ) / 5 3 milliseconde
nds Ound time
Turn arouno of P4 =
ti +15+ 1 2
=

(Mt215) milliseconds
Non preemptive priority: -Ound time
Turn a r o u n d of P5 =
ti
+1+4 2
=

(ti-2+16) miliseconds
2-5 miliseconds
=

Waiting time of P1 = 5 milliseconds ROund R o b i n :

Waiting time of P2 = 0 milliseconds


n around time of P1 =
tl +8 8 t2
Waiting time of P3 = 13 milliseconds
around time of P2= tl
t216) millseconds
=

Turn +
2+1+t2
Waiting time of P4 15 milliseconds
around time of P3 tl +3
2-3milliseconds
=

Waiting time of P5 1 milliseconds


Turn =
2 2 -2-5 miliseconds
=

around time of P4 =ti +5 +1 2=


Average waiting time =
(5 + 0 + 13+ 15 +
Turn +12-5milseconds
1)/5 6.8 milliseconds Turn around time of Ps = tl +8 -4 t2= ti2-mllseonds
Round Robin:
Waiting time of P1 = 12 4 8 milliseconds
0.41 Write Peterson's algorithm for mutual exclusion problem.
Waiting time of P2 2 milliseconds Dec 2013, Nov 2012

algorithm was formulated by GaryPeterson in 98


Waiting time of P3 = 3 milliseconds It is a
Peterson's
processes
exclusion that ailiows two
Waiting time of P4 = 5 milliseconds concurrent programming algorithm for mutual memory for
oniy shared
resource without conflict, using
Waiting time share a single-use
of P5 10 2 =
8
milliseconds to tie-breaker aigornthm.
While Peterson's original
communication. It is also called the generalized for
Average waiting time =(8 2+3+5+ 8)/5 =
5.2 milliseconds ormulation worked with only two processes, the aigonithm
can de

i) FCFS:
more than two.
Turn around time of P1 =
t1 + 0 + 8 + t2
Turn around time of
=(ti +t2 +8) milliseconds Algorithm: integer
P2 =
ti + 8 1 + t2 boolean array; and
turn is an
Turn around time of
=
(t1 +t2 +9) milliseconds aglis
P3 =
t1 + 9+ 2+ t2
Turn around time
=
(t1+ t2 + 11)millisecondS flag[0] = false;
of P4 =
t1 +11 + 1+ t2
Turn around time of P5
=
(t1+ t2 + 12)milliseconas flagi1] = false;
=
t1 + 12 + 4 +
SJF: t2 ( t1+ t2 + 16)millseconaa
=
turn;
PO: flag[O] =
true
urn around time of P1 =
t1 + 8+ 8+ t2
urn around time of P2
=(t1 t t2 + 16) millsecong turn 1; tun
zs 1)

Turn
=t1 + 0 + 1+ t2 =
(t1+ t2 +1)milliseconaa While (flag[1) == true &
around time of P3=
t1 + 2 + 2+ t2
urn around time of P4
=
( t1 t t2 + 4) milise
=t1 +1 +1 + t2 =
(t1+ t2 t2) millseco /busy wait
Turnaround time of P5 =
t1 + 4+ 4 + t2 =
(ti t t2 +8) mills
I/ critical section

section
end of critical
Neeraj's Third Semester
BCA
Scanner
SYNCHORONIZATION
C-32

R O C E S S

flag[0] false;

PI: flag[1]
=
true;
NDDEADLOCKS
turn= 0; Unit 2
while (flag[0]
== true && turn
==
0)

{
/busy wait
SECTIONA
hat is process synchronization?
//critical section ten
People ofter rely on
synchronization to fix a
meeting with others. They need
D agr
atime for the meeting, the
date and the venue. By reaching an agreement
end of critical section
eing to
explicitly agreein synchronization is called as process of
// they
are
synchronization.
flag[1] = false;
semaphores? Nov 2015, 2012, Dec 2009
0.2 What is
ASemaphore is a process synchronization tool, that represents data-structures
kernel to synchronize the processes. They are particularly
IGed by operating system
the access of different accesses different to shared resources
sefull in synchoronizing
semaphore enforces mutual exclusion and
mutually exclusive manner. i.e. a
in a
controls access to the process critical section.

Nov 2017, Dec 2013

Q.3 What is, meant by mutual exclusion?


in which the process
called a critical section
Each process has a segment code, When
a file and so on.
common variables, updating
a table, writing
may be changing no other process is to be allowed

one process is executing


in its critical section,

to execute in the critical section


Nov 2016, Dec 2010
is deadlock? blocked
Q.4 What a
a group of
process are permanently
for
situation where resources
needed
A dead lock is a
a subset of the
of each process having acquired resources
held by r process
other

esuit release of the


remaining
Its completion and waiting for
in the same deadlock
group. circular wait
condition in a
Dec 2013
of
Q.5 Give pictorial repres
resentation

such that
Po is waiting
state. waiting
processes

that is held by P2.


PO) of resource

there exists a set {PO, P1,.., waiting


fora for a resource
P1 is PO is waiting
"e

fora resource that is held


by P1, held by
Pn, and

Ge that is
Po 1 is waiting forr a r e s o u r c e

that is held PO. by more


procedures, on
one
or
of
Q.6 What monitors? module
consisting

software

A monl
Ontor ls a
data.
Cizatlon code and loca

You might also like