Sei sulla pagina 1di 7

Provided by www.YuvaJobs.

com
Operating Systems
Following are a few basic questions that cover the essentials of OS:
1. Explain the concept of Reentrancy.
It is a useful, memory-saving technique for multiprogrammed timesharing
systems. Reentrant Procedure is one in which multiple users can share a single
copy of a program during the same period. !eentrancy has " #ey aspects: $he
program code cannot modify itself, and the local data for each user process must be
stored separately. $hus, the permanent part is the code, and the temporary part is the
pointer bac# to the calling program and local variables used by that program. %ach
e&ecution instance is called activation. It e&ecutes the code in the permanent part, but
has its own copy of local variables'parameters. $he temporary part associated with
each activation is the activation record. (enerally, the activation record is #ept on the
stac#.
Note: reentrant procedure can be interrupted and called by an interrupting
program, and still e&ecute correctly on returning to the procedure.
2. Explain Belady's Anomaly.
lso called FIFO anomaly. )sually, on increasing the number of frames
allocated to a process* virtual memory, the process e&ecution is faster, because fewer
page faults occur. Sometimes, the reverse happens, i.e., the e&ecution time increases
even when more frames are allocated to the process. $his is +elady*s nomaly. $his is
true for certain page reference patterns.
3. What is a inary semaphore! What is its use!
binary semaphore is one, which ta#es only , and - as values. $hey are used
to implement mutual e&clusion and synchroni.e concurrent processes.
". What is thrashin#!
It is a phenomenon in virtual memory schemes when the processor spends
most of its time swapping pages, rather than e&ecuting instructions. $his is due to an
inordinate number of page faults.
$. %ist the &offman's conditions that lead to a deadloc'.
/utual %&clusion: Only one process may use a critical resource at a time.
0old 1 2ait: process may be allocated some resources while waiting for others.
3o 4re-emption: 3o resource can be forcible removed from a process holding it.
5ircular 2ait: closed chain of processes e&ist such that each process holds at
least one resource needed by another process in the chain.
(. What are short)* lon#) and medium)term schedulin#!
-
Provided by www.YuvaJobs.com
6ong term scheduler determines which programs are admitted to the system
for processing. It controls the de#ree of multipro#rammin#. Once admitted, a 7ob
becomes a process.
/edium term scheduling is part of the swapping function. $his relates to
processes that are in a bloc#ed or suspended state. $hey are swapped out of real-
memory until they are ready to e&ecute. $he swapping-in decision is based on
memory-management criteria.
Short term scheduler, also #now as a dispatcher e&ecutes most frequently, and
ma#es the finest-grained decision of which process should e&ecute ne&t. $his
scheduler is invo#ed whenever an event occurs. It may lead to interruption of one
process by preemption.
+. What are turnaround time and response time!
$urnaround time is the interval between the submission of a 7ob and its
completion. !esponse time is the interval between submission of a request, and the
first response to that request.
,. What are the typical elements of a process ima#e!
)ser data: /odifiable part of user space. /ay include program data, user stac#
area, and programs that may be modified.
)ser program: $he instructions to be e&ecuted.
System Stac#: %ach process has one or more 6IFO stac#s associated with it. )sed
to store parameters and calling addresses for procedure and system calls.
4rocess control +loc# 845+9: Info needed by the OS to control processes.
-. What is the .ranslation %oo'aside Buffer /.%B0!
In a cached system, the base addresses of the last few referenced pages is
maintained in registers called the $6+ that aids in faster loo#up. $6+ contains those
page-table entries that have been most recently used. 3ormally, each virtual memory
reference causes " physical memory accesses-- one to fetch appropriate page-table
entry, and one to fetch the desired data. )sing $6+ in-between, this is reduced to 7ust
one physical memory access in cases of $6+-hit.
11. What is the resident set and 2or'in# set of a process!
!esident set is that portion of the process image that is actually in real-
memory at a particular instant. 2or#ing set is that subset of resident set that is
actually needed for e&ecution. 8!elate this to the variable-window si.e method for
swapping techniques.9
11. When is a system in safe state!
$he set of dispatchable processes is in a safe state if there e&ists at least one
temporal order in which all processes can be run to completion without resulting in a
deadloc#.
12. What is cycle stealin#!
"
Provided by www.YuvaJobs.com
2e encounter cycle stealing in the conte&t of :irect /emory ccess 8:/9.
%ither the :/ controller can use the data bus when the 54) does not need it, or it
may force the 54) to temporarily suspend operation. $he latter technique is called
cycle stealing. 3ote that cycle stealing can be done only at specific brea# points in an
instruction cycle.
13. What is meant y arm)stic'iness!
If one or a few processes have a high access rate to data on one trac# of a
storage dis#, then they may monopoli.e the device by repeated requests to that trac#.
$his generally happens with most common device scheduling algorithms 86IFO,
SS$F, 5-S53, etc9. 0igh-density multisurface dis#s are more li#ely to be affected
by this than low density ones.
1". What are the stipulations of &2 level security!
5" level security provides for:
:iscretionary ccess 5ontrol
Identification and uthentication
uditing
!esource reuse
1$. What is usy 2aitin#!
$he repeated e&ecution of a loop of code while waiting for an event to occur is
called busy-waiting. $he 54) is not engaged in any real productive activity during
this period, and the process does not progress toward completion.
1(. Explain the popular multiprocessor thread)schedulin# strate#ies.
%oad 3harin#4 4rocesses are not assigned to a particular processor. global queue
of threads is maintained. %ach processor, when idle, selects a thread from this
queue. 3ote that load alancin# refers to a scheme where wor# is allocated to
processors on a more permanent basis.
5an# 3chedulin#4 set of related threads is scheduled to run on a set of
processors at the same time, on a --to-- basis. 5losely related threads ' processes
may be scheduled this way to reduce synchroni.ation bloc#ing, and minimi.e
process switching. (roup scheduling predated this strategy.
6edicated processor assi#nment4 4rovides implicit scheduling defined by
assignment of threads to processors. For the duration of program e&ecution, each
program is allocated a set of processors equal in number to the number of threads
in the program. 4rocessors are chosen from the available pool.
6ynamic schedulin#4 $he number of thread in a program can be altered during the
course of e&ecution.
1+. When does the condition 'rende7vous' arise!
In message passing, it is the condition in which, both, the sender and receiver
are bloc#ed until the message is delivered.
1,. What is a trap and trapdoor!
;
Provided by www.YuvaJobs.com
$rapdoor is a secret undocumented entry point into a program used to grant
access without normal methods of access authentication. trap is a software
interrupt, usually the result of an error condition.
1-. What are local and #loal pa#e replacements!
6ocal replacement means that an incoming page is brought in only to the
relevant process* address space. (lobal replacement policy allows any page frame
from any process to be replaced. $he latter is applicable to variable partitions model
only.
21. 6efine latency* transfer and see' time 2ith respect to dis' 89:.
See# time is the time required to move the dis# arm to the required trac#.
!otational delay or latency is the time it ta#es for the beginning of the required sector
to reach the head. Sum of see# time 8if any9 and latency is the access time. $ime ta#en
to actually transfer a span of data is transfer time.
21. 6escrie the Buddy system of memory allocation.
Free memory is maintained in lin#ed lists, each of equal si.ed bloc#s. ny
such bloc# is of si.e "<#. 2hen some memory is required by a process, the bloc# si.e
of ne&t higher order is chosen, and bro#en into two. 3ote that the two such pieces
differ in address only in their #th bit. Such pieces are called buddies. 2hen any used
bloc# is freed, the OS chec#s to see if its buddy is also free. If so, it is re7oined, and
put into the original free-bloc# lin#ed-list.
22. What is time)stampin#!
It is a technique proposed by 6amport, used to order events in a distributed
system without the use of cloc#s. $his scheme is intended to order events consisting
of the transmission of messages. %ach system *i* in the networ# maintains a counter
5i. %very time a system transmits a message, it increments its counter by - and
attaches the time-stamp $i to the message. 2hen a message is received, the receiving
system *7* sets its counter 57 to - more than the ma&imum of its current value and the
incoming time-stamp $i. t each site, the ordering of messages is determined by the
following rules: For messages & from site i and y from site 7, & precedes y if one of
the following conditions holds....8a9 if $i=$7 or 8b9 if $i>$7 and i=7.
23. ;o2 are the 2ait9si#nal operations for monitor different from those for
semaphores!
If a process in a monitor signal and no tas# is waiting on the condition
variable, the signal is lost. So this allows easier program design. 2hereas in
semaphores, every operation affects the value of the semaphore, so the wait and
signal operations should be perfectly balanced in the program.
2". 8n the context of memory mana#ement* 2hat are placement and replacement
al#orithms!
?
Provided by www.YuvaJobs.com
4lacement algorithms determine where in available real-memory to load a
program. 5ommon methods are first-fit, ne&t-fit, best-fit. !eplacement algorithms are
used when memory is full, and one process 8or part of a process9 needs to be swapped
out to accommodate a new program. $he replacement algorithm determines which are
the partitions to be swapped out.
2$. 8n loadin# pro#rams into memory* 2hat is the difference et2een load)time
dynamic lin'in# and run)time dynamic lin'in#!
For load-time dynamic lin#ing: 6oad module to be loaded is read into
memory. ny reference to a target e&ternal module causes that module to be loaded
and the references are updated to a relative address from the start base address of the
application module.
2ith run-time dynamic loading: Some of the lin#ing is postponed until actual
reference during e&ecution. $hen the correct module is loaded and lin#ed.
2(. What are demand) and pre)pa#in#!
2ith demand paging, a page is brought into memory only when a location on
that page is actually referenced during e&ecution. 2ith pre-paging, pages other than
the one demanded by a page fault are brought in. $he selection of such pages is done
based on common access patterns, especially for secondary memory devices.
2+. Pa#in# a memory mana#ement function* 2hile multipro#rammin# a processor
mana#ement function* are the t2o interdependent!
@es.
2,. What is pa#e canniali7in#!
4age swapping or page replacements are called page cannibali.ing.
2-. What has tri##ered the need for multitas'in# in P&s!
Increased speed and memory capacity of microprocessors together with the
support fir virtual memory and
(rowth of client server computing
31. What are the four layers that Windo2s <. have in order to achieve
independence!
0ardware abstraction layer
Aernel
Subsystems
System Services.
31. What is 3=P!
$o achieve ma&imum efficiency and reliability a mode of operation #nown as
symmetric multiprocessing is used. In essence, with S/4 any process or threads can
be assigned to any processor.
32. What are the 'ey o>ect oriented concepts used y Windo2s <.!
B
Provided by www.YuvaJobs.com
%ncapsulation
Ob7ect class and instance
33. 8s Windo2s <. a full lo2n o>ect oriented operatin# system! 5ive reasons.
3o 2indows 3$ is not so, because its not implemented in ob7ect oriented
language and the data structures reside within one e&ecutive component and are not
represented as ob7ects and it does not support ob7ect oriented capabilities .
3". What is a dra2ac' of =?.!
It does not have the features li#e
ability to support multiple processors
virtual storage
source level debugging
3$. What is process spa2nin#!
2hen the OS at the e&plicit request of another process creates a process, this
action is called process spawning.
3(. ;o2 many >os can e run concurrently on =?.!
-B 7obs
3+. %ist out some reasons for process termination.
3ormal completion
$ime limit e&ceeded
/emory unavailable
+ounds violation
4rotection error
rithmetic error
$ime overrun
I'O failure
Invalid instruction
4rivileged instruction
:ata misuse
Operator or OS intervention
4arent termination.
3,. What are the reasons for process suspension!
swapping
interactive user request
timing
parent process request
3-. What is process mi#ration!
It is the transfer of sufficient amount of the state of process from one machine
to the target machine
C
Provided by www.YuvaJobs.com
"1. What is mutant!
In 2indows 3$ a mutant provides #ernel mode or user mode mutual
e&clusion with the notion of ownership.
"1. What is an idle thread!
$he special thread a dispatcher will e&ecute when no ready thread is found.
"2. What is @t6is'!
It is a fault tolerance dis# driver for 2indows 3$.
"3. 2hat are the possible threads a thread can haveD
!eady
Standby
!unning
2aiting
$ransition
$erminated.
"". What are rin#s in Windo2s <.!
2indows 3$ uses protection mechanism called rings provides by the process
to implement separation between the user mode and #ernel mode.
"$. What is Executive in Windo2s <.!
In 2indows 3$, e&ecutive refers to the operating system code that runs in
#ernel mode.
"(. What are the su)components of 89: mana#er in Windo2s <.!
3etwor# redirector' Server
5ache manager.
File systems
3etwor# driver
:evice driver
"+. What are 66's! <ame an operatin# system that includes this feature.
::#s are device driver #its, which are equivalent to S:As for writing device
drivers. 2indows 3$ includes ::#s.
",. What level of security does Windo2s <. meets!
5" level security.
E

Potrebbero piacerti anche