Sri Manakula Vinayagar Engineering College
Sri Manakula Vinayagar Engineering College
UNIT I
1.What is an Operating system?
An operating system is a program that manages the computer hardware. It also provides a basis
for application programs and act as an intermediary between a user of a computer and the
computer hardware. It controls and coordinates the use of the hardware among the various
application programs for the various users.
2.Why is the Operating System viewed as a resource allocator & control program?
A computer system has many resources - hardware & software that may be required to solve a
problem, like CPU time, memory space, file-storage space, I/O devices & so on. The OS acts as
a manager for these resources so it is viewed as a resource allocator.The OS is viewed as a
control program because it manages the execution of user programs to prevent errors & improper
use of the computer.
16.What is a process?
A process is a program in execution. It is the unit of work in a modern operating system. A
process is an active entity with a program counter specifying the next instructions to execute and
a set of associated resources. It also includes the process stack, containing temporary data and a
data section containing global variables.
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.
UNIT II
21.What is a thread?
A thread otherwise called a lightweight process (LWP) is a basic unit of CPU utilization, it
comprises of a thread id, a program counter, a register set and a stack. It shares with other
threads belonging to the same process its code section, data section, and operating system
resources such as open files and signals.
29.What is a Dispatcher?
The dispatcher is the module that gives control of the CPU to the process selected by the short-
term scheduler. This function involves:
• Switching context
• Switching to user mode
• Jumping to the proper location in the user program to restart that program.
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.
36.What are the requirements that a solution to the critical section problem must satisfy?
The three requirements are
• Mutual exclusion
• Progress
• Bounded waiting
38.Give two hardware instructions and their definitions which can be used for
implementing mutual exclusion.
• TestAndSet
boolean TestAndSet (boolean &target)
{
boolean rv = target;
target = true;
return rv;
}
• Swap
void Swap (boolean &a, boolean &b)
{
boolean temp = a;
a = b;
b = temp;
}
39.What is semaphores?
A semaphore 'S' is a synchronization tool which is an integer value that, apart from initialization,
is accessed only through two standard atomic operations; wait and signal. Semaphores can be
used to deal with the n-process critical section problem. It can be also used to solve various
synchronization problems. The classic definition of 'wait'
wait (S)
{
while (S<=0)
;
S--;
}
The classic definition of 'signal'
signal (S)
{
S++;
}
UNIT III
41.Define deadlock.
A process requests resources; if the resources are not available at that time, the process enters a
wait state. Waiting processes may never again change state, because the resources they have
requested are held by other waiting processes. This situation is called a deadlock.
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.
57.Define swapping.
A process needs to be in memory to be executed. However a process can be swapped temporarily
out of memory to a backing tore and then brought back into memory for continued execution.
This process is called swapping.
58.What are the common strategies to select a free hole from a set of available holes?
The most common strategies are
a. First fit
b. Best fit
c. Worst fit
68.What are the various page replacement algorithms used for page replacement?
• FIFO page replacement
• Optimal page replacement
• LRU page replacement
• LRU approximation page replacement
• Counting based page replacement
• Page buffering algorithm.
69.What are the major problems to implement demand paging?
The two major problems to implement demand paging is developing
a. Frame allocation algorithm
b. Page replacement algorithm
71.What is a file?
A file is a named collection of related information that isrecorded on secondary storage. A file
contains either programs ordata. A file has certain "structure" based on its type.
• File attributes: Name, identifier, type, size, location,protection, time, date
•File operations: creation, reading, writing, repositioning, deleting, truncating, appending,
renaming
• File types: executable, object, library, source code etc.
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
UNIT V
81.What are the various layers of a file system?
The file system is composed of many different levels. Each level in the design uses the feature of
the lower levels to create new features for use by higher levels.
• Application programs
• Logical file system
• File-organization module
• Basic file system
• I/O control
• Devices
91.How can the index blocks be implemented in the indexed allocation scheme?
The index block can be implemented as follows
a. Linked scheme
b. Multilevel scheme
c. Combined scheme
94.Define buffering.
A buffer is a memory area that stores data while they are transferred between two devices or
between a device and an application. Buffering is done for three reasons
a. To cope with a speed mismatch between the producer and consumer of a data stream
b. To adapt between devices that have different data transfer sizes
c. To support copy semantics for application I/O
95.Define caching.
A cache is a region of fast memory that holds copies of data. Access to the cached copy is more
efficient than access to the original. Caching and buffering are distinct functions, but sometimes
a region of memory can be used for both purposes.
96.Define spooling.
A spool is a buffer that holds output for a device, such as printer, that cannot accept interleaved
data streams. When an application finishes printing, the spooling system queues the
corresponding spool file for output to the printer. The spooling system copies the queued spool
files to the printer one at a time.
UNIT IV
61.What is virtual memory?
Virtual memory is a technique that allows the execution of processes that may not be completely
in memory. It is the separation of user logical memory from physical memory. This separation
provides an extremely large virtual memory, when only a smaller physical memory is available.
68.What are the various page replacement algorithms used for page replacement?
• FIFO page replacement
• Optimal page replacement
• LRU page replacement
• LRU approximation page replacement
• Counting based page replacement
• Page buffering algorithm.
71.What is a file?
A file is a named collection of related information that is recorded on secondary storage. A file
contains either programs or data. A file has certain "structure" based on its type.
• File attributes: Name, identifier, type, size, location, protection, time, date • File operations:
creation, reading, writing, repositioning, deleting, truncating, appending, renaming
• File types: executable, object, library, source code etc.
72.List the various file attributes.
A file has certain other attributes, which vary from one operating system to another, but typically
consist of these: Name, identifier, type, location, size, protection, time, date and user
identification
76.What is Directory?
The device directory or simply known as directory records information-such as name, location,
size, and type for all files on that particular partition. The directory can be viewed as a symbol
table that translates file names into their directory entries.
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
UNIT V
81.What are the various layers of a file system?
The file system is composed of many different levels. Each level in the design uses the feature of
the lower levels to create new features for use by higher levels.
• Application programs
• Logical file system
• File-organization module
• Basic file system
• I/O control
• Devices
91.How can the index blocks be implemented in the indexed allocation scheme?
The index block can be implemented as follows
a. Linked scheme
b. Multilevel scheme
c. Combined scheme
94.Define buffering.
A buffer is a memory area that stores data while they are transferred between two devices or
between a device and an application. Buffering is done for three reasons a. To cope with a speed
mismatch between the producer and consumer of a data stream b. To adapt between devices that
have different data transfer sizes
95.Define caching.
A cache is a region of fast memory that holds copies of data. Access to the cached copy is more
efficient than access to the original. Caching and buffering are distinct functions, but sometimes
a region of memory can be used for both purposes.
96.Define spooling.
A spool is a buffer that holds output for a device, such as printer, that cannot accept interleaved
data streams. When an application finishes printing, the spooling system queues the
corresponding spool file for output to the printer. The spooling system copies the queued spool
files to the printer one at a time.