Operating System
Operating System
Compiled By: K. Thirupathi Rao, Professor & Head, Dept. of CSE, K L University
17. What is a process state and mention the various states of a process?
As a process executes, it changes state. The state of a process is defined in part by the
current activity of that process. Each process may be in one of the following states:
New
Running
Waiting
Ready
Terminated
18. What is process control block?
Each process is represented in the operating system by a process control block
also called a task control block. It contains many pieces of information associated
with a specific process. It simply acts as a repository for any information that may
vary from process to process. It contains the following information:
Process state
Program counter
CPU registers
CPU-scheduling information
Memory-management information
Accounting information
I/O status information
Compiled By: K. Thirupathi Rao, Professor & Head, Dept. of CSE, K L University
19. What are the use of job queues, ready queues & device queues?
As a process enters a system, they are put into a job queue. This queue consists
of all jobs in the system. The processes that are residing in main memory and are
ready & waiting to execute are kept on a list called ready queue. The list of
processes waiting for a particular I/O device is kept in the device queue.
CPU scheduling is the process of switching the CPU among various processes. CPU
scheduling is the basis of multiprogrammed operating systems. By switching the CPU
among processes, the operating system can make the computer more productive.
Throughput
Turnaround time
Waiting time
Response time
32. Define throughput?
Throughput in CPU scheduling is the number of processes that are completed
per unit time. For long processes, this rate may be one process per hour; for
short transactions, throughput might be 10 processes per second.
33. What is turnaround time?
Turnaround time is the interval from the time of submission to the time of
completion of a process. It is the sum of the periods spent waiting to get into
memory, waiting in the ready queue, executing on the CPU, and doing I/O.
34. Define race condition.
When several process access and manipulate same data concurrently, then
the outcome of the execution depends on particular order in which the access
takes place is called race condition. To avoid race condition, only one process
at a time can manipulate the shared variable.
35. What is critical section problem?
Consider a system consists of 'n' processes. Each process has segment of
code called a critical section, in which the process may be changing common
variables, updating a table, writing a file. When one process is executing in its
critical section, no other process can allowed to execute in its critical section.
36. What are the requirements that a solution to the critical section problem
must satisfy?
The three requirements are
Mutual exclusion
Progress
Bounded waiting
Compiled By: K. Thirupathi Rao, Professor & Head, Dept. of CSE, K L University
38. Give two hardware instructions and their definitions which can be used for
implementing mutual exclusion.
TestAndSet
Compiled By: K. Thirupathi Rao, Professor & Head, Dept. of CSE, K L University
43. What are conditions under which a deadlock situation may arise?
A deadlock situation can arise if the following four conditions hold simultaneously in
a system:
a. Mutual exclusion
b. Hold and wait
c. No pre-emption
44. What is a resource-allocation graph?
Deadlocks can be described more precisely in terms of a directed graph
called a system resource allocation graph. This graph consists of a set of
vertices V and a set of edges E. The set of vertices V is partitioned into two
different types of nodes; P the set consisting of all active processes in the
system and R the set consisting of all resource types in the system.
45. Define request edge and assignment edge.
A directed edge from process Pi to resource type Rj is denoted by PiRj; it
signifies that process Pi requested an instance of resource type Rj and is
currently waiting for that resource. A directed edge from resource type Rj to
process Pi is denoted by RjPi, it signifies that an instance of resource type
has been allocated to a process Pi. A directed edge PiRj is called a request
edge. A directed edge RjPi is called an assignment edge.
46. What are the methods for handling deadlocks?
The deadlock problem can be dealt with in one of the three ways:
Use a protocol to prevent or avoid deadlocks, ensuring that the system
will never enter a deadlock state.
Allow the system to enter the deadlock state, detect it and then recover.
Ignore the problem all together, and pretend that deadlocks never
occur in the system.
Compiled By: K. Thirupathi Rao, Professor & Head, Dept. of CSE, K L University
Safety algorithm: The algorithm for finding out whether or not a system
is in a safe state.
Resource-request algorithm: If the resulting resource allocationis safe, the
transaction is completed and process Pi is allocated its resources. If the new
state is unsafe Pi must wait and the old resource-allocation state is restored.
Compiled By: K. Thirupathi Rao, Professor & Head, Dept. of CSE, K L University
10
11
to indicate that the page is no longer in memory. Now the freed frame can be
used to hold the page for which the process faulted.
68. What are the various page replacement algorithms used for page replacement?
Creating a file
Writing a file
Reading a file
Repositioning within a file
Deleting a file
Truncating a file
Compiled By: K. Thirupathi Rao, Professor & Head, Dept. of CSE, K L University
12
Delete a file
Rename a file
List directory
78. What are the most common schemes for defining the logical structure of a
directory?
The most common schemes for defining the logical structure of a directory
Single-Level Directory
Two-level Directory
Tree-Structured Directories
Acyclic-Graph Directories
General Graph Directory
13
starts the system's master file directory (MFD) is searched. The MFD is indexed by
the user name or account number, and each entry points to the UFD for that user.
Application programs
Logical file system
File-organization module
Basic file system
I/O control
Devices
14
15
system copies the queued spool files to the printer one at a time.
97. What are the various disk-scheduling algorithms?
The various disk-scheduling algorithms are
a. First Come First Served Scheduling
b. Shortest Seek Time First Scheduling
c. SCAN Scheduling
d. C-SCAN Scheduling
f. LOOK scheduling
98. What is low-level formatting?
Before a disk can store data, it must be divided into sectors that the disk controller
can read and write. This process is called low-level formatting or physical formatting.
Low -level formatting fills the disk with a special data structure for each sector. The
data structure for a sector consists of a header, a data area, and a trailer.
Compiled By: K. Thirupathi Rao, Professor & Head, Dept. of CSE, K L University
16
17
103.
Mutual Exclusion: Only one process may use a critical resource at a time.
Hold & Wait: A process may be allocated some resources while waiting for
others.
No Pre-emption: No resource can be forcible removed from a process holding it.
Circular Wait: A closed chain of processes exist such that each process
holds at least one resource needed by another process in the chain.
Turnaround time is the interval between the submission of a job and its
completion. Response time is the interval between submission of a request,
and the first response to that request.
106. What are the typical elements of a process image?
User data: Modifiable part of user space. May include program data, user
stack area, and programs that may be modified.
User program: The instructions to be executed.
System Stack: Each process has one or more LIFO stacks associated with it.
Used to store parameters and calling addresses for procedure and system calls.
Compiled By: K. Thirupathi Rao, Professor & Head, Dept. of CSE, K L University
18
108.
Resident set is that portion of the process image that is actually in real-memory at a
particular instant. Working set is that subset of resident set that is actually needed for
execution. (Relate this to the variable-window size method for swapping techniques.)
109.
The set of dispatchable processes is in a safe state if there exists at least one temporal
order in which all processes can be run to completion without resulting in a deadlock.
110.
If one or a few processes have a high access rate to data on one track of a
storage disk, then they may monopolize the device by repeated requests to
that track. This generally happens with most common device scheduling
algorithms (LIFO, SSTF, C-SCAN, etc). High-density multisurface disks are
more likely to be affected by this than low density ones.
112.
Auditing
Resource reuse
Compiled By: K. Thirupathi Rao, Professor & Head, Dept. of CSE, K L University
19
115.
In message passing, it is the condition in which, both, the sender and receiver
are blocked until the message is delivered.
116.
Local replacement means that an incoming page is brought in only to the relevant
process' address space. Global replacement policy allows any page frame from any
process to be replaced. The latter is applicable to variable partitions model only.
118.
Define latency, transfer and seek time with respect to disk I/O.
Seek time is the time required to move the disk arm to the required track.
Rotational delay or latency is the time it takes for the beginning of the required
sector to reach the head. Sum of seek time (if any) and latency is the access
time. Time taken to actually transfer a span of data is transfer time.
119. Describe the Buddy system of memory allocation.
Free memory is maintained in linked lists, each of equal sized blocks. Any
such block is of size 2^k. When some memory is required by a process, the
block size of next higher order is chosen, and broken into two. Note that the
two such pieces differ in address only in their kth bit. Such pieces are called
buddies. When any used block is freed, the OS checks to see if its buddy is
also free. If so, it is rejoined, and put into the original free-block linked-list.
120.
What is time-stamping?
20
With demand paging, a page is brought into memory only when a location on that
page is actually referenced during execution. With pre-paging, pages other than the
one demanded by a page fault are brought in. The selection of such pages is done
based on common access patterns, especially for secondary memory devices.
Compiled By: K. Thirupathi Rao, Professor & Head, Dept. of CSE, K L University
21
128. What are the four layers that Windows NT have in order to achieve
independence?
129.
What is SMP?
What are the key object oriented concepts used by Windows NT?
Encapsulation
Object class and instance
131.
133.
135.
Normal completion
Memory unavailable
Bounds violation
Protection error
Arithmetic error
Time overrun
I/O failure
Compiled By: K. Thirupathi Rao, Professor & Head, Dept. of CSE, K L University
22
136.
137.
Invalid instruction
Privileged instruction
Data misuse
Operator or OS intervention
Parent termination.
swapping
interactive user request
timing
parent process request
It is the transfer of sufficient amount of the state of process from one machine
to the target machine
138.
What is mutant?
The special thread a dispatcher will execute when no ready thread is found.
140.
What is FtDisk?
142.
Ready
Standby
Running
Waiting
Transition
Terminated.
In Windows NT, executive refers to the operating system code that runs in
kernel mode.
Compiled By: K. Thirupathi Rao, Professor & Head, Dept. of CSE, K L University
23
144.
145.
What are DDks? Name an operating system that includes this feature.
DDks are device driver kits, which are equivalent to SDKs for writing device
drivers. Windows NT includes DDks.
146.
147.
After the command line is terminated by the key, the shel goes ahead with
processing the command line in one or more passes. The sequence is well
defined and assumes the following order.
Parsing: The shell first breaks up the command line into words, using spaces
and the delimiters, unless quoted. All consecutive occurrences of a space or
tab are replaced here with a single space.
Variable evaluation: All words preceded by a $ are avaluated as variables,
unless quoted or escaped.
Command substitution: Any command surrounded by backquotes is executed
by the shell which then replaces the standard output of the command into the
command line. Wild-card interpretation: The shell finally scans the command
line for wild-cards (the characters *, ?, [, ]). Any word containing a wild-card is
replaced by a sorted list of filenames that match the pattern. The list of these
filenames then forms the arguments to the command. PATH evaluation: It finally
looks for the PATH variable to determine the sequence of directories it has to
search in order to hunt for the command.
148 What is a sector? Track? Cylinder?
Compiled By: K. Thirupathi Rao, Professor & Head, Dept. of CSE, K L University
24
149.
Describe how multiplatter disks are organized into tracks and sectors.
The disks have from three to twenty platters rotating concentrically together. Each platter
has two surfaces (except outer platters sometimes do not have outer surfaces), giving us
N surfaces. These platters are divided up into C concentric cylinders, all rotating together
around the same axis. The intersection of a cylinder with a surface is called a track, a
circle on a single surface. Each track is divided up into K circular segments called
sectors. So, the number of sectors on a disk = N _ C _ K.
150.
Mahatma Gandhi :
Happiness is when what you think, what you say, and what you do
are in harmony.
When I despair, I remember that all through history the ways of truth
and love have always won. There have been tyrants, and murderers,
and for a time they can seem invincible, but in the end they always
fall.
Compiled By: K. Thirupathi Rao, Professor & Head, Dept. of CSE, K L University
25