1.What is a file? - vi institute of technology

advertisement
Vi Institute of Technology
Department of Computer Science
Question Bank
Unit- I : Processes and Threads
PART-A
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.
3. What is the Kernel?
A more common definition is that the OS is the one program running at all times on the computer, usually
called the kernel, with all else being application programs.
4. What are Batch systems?
Batch systems are quite appropriate for executing large jobs that need little interaction. The user can submit
jobs and return later for the results. It is not necessary to wait while the job is processed. Operators batched
together jobs with similar needs and ran them through the computer as group.
5.. What is meant by Mainframe Systems?
Mainframe systems are the first computers developed to tackle many commercial and scientific
applications. These systems are developed from the batch systems and then multiprogramming system and
finally time sharing systems.
6. What is meant by Batch Systems?
In this, operators batched together jobs with similar needs and ran through the computer as a group
.The operators would sort programs into batches with similar requirements and as system become
available, it would run each batch.
7.What is the advantage of Multiprogramming?
Multiprogramming increases CPU utilization by organizing jobs so that the CPU always has one to
execute. Several jobs are placed in the main memory and the processor is switched from job to job as
needed to keep several jobs advancing while keeping the peripheral devices in use. Multiprogramming is
the first instance where the Operating system must make decisions for the users. Therefore they are fairly
sophisticated.
CS2254-OPERATING SYSTEMS
Vi Institute of Technology
Department of Computer Science
Question Bank
8. What are multiprocessor systems & give their advantages?
Multiprocessor systems also known as parallel systems or tightly coupled systems are systems that
have more than one processor in close communication, sharing the computer bus, the clock and sometimes
memory & peripheral devices. Their main advantages are:
• Increased throughput
• Economy of scale
• Increased reliability
9.What are the different types of multiprocessing?
Symmetric multiprocessing (SMP): In SMP each processor runs an identical copy of the Os &
these copies communicate with one another as needed. All processors are peers. Examples are Windows
NT, Solaris, Digital UNIX, OS/2 & Linux.
Asymmetric multiprocessing: Each processor is assigned a specific task. A master processor controls the
system; the other processors look to the master for instructions or predefined tasks. It defines a masterslave relationship. Example SunOS Version 4..
10.What is Real Time systems?
A time shared OS allows many users to share the computer simultaneously. The CPU time needed
is little for each user since each action or command in a time-shared system is short.
11. What is meant by Time-sharing Systems?
Time Sharing is a logical extension of multiprogramming .Here, CPU executes multiple jobs by
switching among them, but the switches occur so frequently that the users can interact with each program
while it is running.
12. What are the Components of a Computer System?




Application Programs
System Program
Operating System
Computer Hardware
13. What are Multiprocessor System?
Multiprocessor systems have systems more than one processor for communication, sharing the
computer bus, the memory, clock & peripheral devices.
14.. What are the advantages of multiprocessors?
 Increased throughput
 Economy of scale
 Increased reliability
CS2254-OPERATING SYSTEMS
Vi Institute of Technology
Department of Computer Science
Question Bank
15.. What is meant by clustered system?
Clustered systems are collection of multiple CPUs to accomplish computational work. Those
systems share storage and are closely linked via LAN networking.
16. What are the types of clustering?
 Asymmetric Clustering
 Symmetric Clustering & Clustering over a WAN
17. What is meant by Asymmetric Clustering?
In this clustering, one machine is in hot standby mode, while the other is running the application.
The hot standby machine just monitors the active server. If that server fails, hot stand by host become the
active server.
18. What is meant by Symmetric clustering?
In this, two or more hosts are running applications and they are monitoring each other. This
clustering requires more than one application be available to run and it uses all of the available hardware.
19. What is meant by parallel clusters?
Parallel clusters allow multiple hosts to access the same data on the shared storage. Each machine
has full access to all data in the database.
20. What is meant by Real time system?
Real time systems are systems that have their in-built characteristics as supplying immediate
response. In real time system, each process is assigned a certain level of priority according to the relative
importance of the events to be processed.
21.How is the protection for memory provided?
The protection against illegal memory access is done by using two registers. The base register and
the limit register. The base register holds the smallest legal physical address; the limit register contains the
size of the range. The base and limit registers can be loaded only by the OS using special privileged
instructions.
22.. What are the advantages of distributed systems?




Resource sharing
Load balancing
Reliability
Communication link easy
CS2254-OPERATING SYSTEMS
Vi Institute of Technology
Department of Computer Science
Question Bank
23. What are the applications of real-time systems?






Controlling the machines
Instruments
Industrial process
Landing & tasking off aero planes
Real time simulations
Military applications.
24.. What are the types of Real time systems?
 Hard Real Time System
 Soft Real Time System
25.What is the difference between Hard Real Time System and Soft Real Time System?
A hard real time system guarantees that critical tasks complete on time. In a soft real time system, a
critical real-time task gets priority over the other tasks, and retains that priority until it completes. Soft real
time systems have more limited utility than do hard real-time systems.
26. What is meant by distributed systems?
A distributed system is basically a collection of autonomous computer systems which co-operate
with one another through their h/w and s/w interconnections.
27. What are the disadvantages of distributed systems?
 Security weakness
 Over dependence on performance and reliability
 Maintenance and control become complex
28. What are Operating Services?
Normally, an operating system provides certain services to programs and to the users of those
programs. Some of them are:
 Program Execution.
 I/O operations
 File-system manipulation
 Communications
 Error Detection

29. What is System Programs?
CS2254-OPERATING SYSTEMS
Vi Institute of Technology
Department of Computer Science
Question Bank
System programs provide a convenient environment for program development and execution. Some
of these programs are user interfaces to system calls and others are more complex. Some of them are:





File Management
Status Information
File modification
Programming Language support
Program loading, execution and communication.
30. What is meant by System Calls?
The System Calls acts as a interface to a running program and the Operating system. These system
calls available in assembly language instructions.
31. What is Virtual machine?
The Application programs view everything under them in the hierarchy as though the system
programs were part of the machine itself. This layered approach is taken as the logical conclusion in the
concept of a Virtual machine.
32. What is known as system utilities?
Most operating systems are supplied with programs that solve common problems or perform
common operations. Such programs include web browsers, word processors and text formatters, spread
sheets, database systems, compilers, plotting and games. These programs are known as system utilities.
33. Define Process.
Process is defined as




Program in execution
A synchronous activity.
The "animated spirit" of a procedure
The "locus of control of a procedure in execution which is manifested by the existence of a "process
control block" in the operating system
34. What are the different process states available?
 Running, if it currently has the CPU
 Ready, if it could use a CPU if one were available
 Blocked, if it is waiting for some event to happen before it can proceed
35. What is meant by Dispatching?
CS2254-OPERATING SYSTEMS
Vi Institute of Technology
Department of Computer Science
Question Bank
The Process of assignment of the CPU to the first process on the ready list is called as
Dispatching.
36. What is PCB?
PCB is a data structure containing certain important information about the process including the
following:






Current state of the process
Unique identification of the process
A pointer to the process's parent
A pointer to the process's child
The process's priority
Pointers to locate the process's memory and to allocated resources.
37. What is meant by Context Switching?
When an interrupt occurs, the operating system saves the status of the interrupted process routes
control to the appropriate first level interrupt handler.
38. What is meant by PSW?
Program Status Words (PSW) controls the order of instruction execution and contains various
information about the state of a process. There are three types of PSW's namely
 Current PSW
 New PSW
 Old PSW
39. What is meant by Independent process?
A Process is Independent if it cannot affect or be affected by the other processes executing in the
system. Here no process shares its data with other process available.
40. What is meant by Direct Communication?
In Direct communication, each process that wants to communicate must explicitly name the
recipient or sender of the communication. In this scheme, the Send & Receive primitives are defined as:
 send ( p , message ) - Send a message to process P
 receive ( p , message ) - Receive a message to process p
41. What is meant by Indirect Communication?
CS2254-OPERATING SYSTEMS
Vi Institute of Technology
Department of Computer Science
Question Bank
In Indirect Communication, the messages are sent to and received from mailboxes or ports. A
mailbox is an object into which messages can be placed by processes and from which messages can be
removed. In this scheme, the Send & Receive primitives are defined as:
 send ( A , message ) - Send a message to mailbox A.
 receive ( A , message ) - Receive a message from mailbox A.
42.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.
43.What are the benefits of multithreaded programming?
• Responsiveness
• Resource sharing
• Economy
• Utilization of multiprocessor architectures
44.Compare user threads and kernel threads.
User threads
User threads are supported above the kernel and are implemented by a thread library at the
user level. Thread creation & scheduling are done in the user space, without kernel intervention.
Therefore they are fast to create and manage blocking system call will cause the entire process to
block
Kernel threads
Kernel threads are supported directly by the operating system .Thread creation, scheduling
and management are done by the operating system. Therefore they are slower to create & manage
compared to user threads. If the thread performs a blocking system call, the kernel can schedule
another thread in the application for execution
45.What is the use of fork and exec system calls?
Fork is a system call by which a new process is created. Exec is also a system call, which is
used after a fork by one of the two processes to replace the process memory space with a new
program.
46. Define thread cancellation & target thread.
The thread cancellation is the task of terminating a thread before it has completed. A thread
that is to be cancelled is often referred to as the target thread. For example, if multiple threads are
concurrently searching through a database and one thread returns the result, the remaining threads
might be cancelled.
47.What are the different ways in which a thread can be cancelled?
Cancellation of a target thread may occur in two different scenarios:
CS2254-OPERATING SYSTEMS
Vi Institute of Technology
Department of Computer Science
Question Bank
• Asynchronous cancellation: One thread immediately terminates the target thread is called
asynchronous cancellation.
• Deferred cancellation: The target thread can periodically check if it should terminate, allowing the
target thread an opportunity to terminate itself in an orderly fashion
48.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:
to the user program to restart that program.
49.What are the functions of Operating systems?
 Operating System acts as the Resource Manager
 Operating System also Controls the all the Storage Operations
PART-B
1. Explain the various types of computer systems?
o Mainframe Systems.
o Desktop Systems.
o Multiprocessor Systems.
o Distributed Systems.
o Clustered Systems.
o Handheld Systems.
2. Explain about Hardware protection methods.(OR) Explain how protection is provided for the
hardware resources by the operating system?
 Dual mode operation
 I/O Protection with diagram
 Memory protection with diagram
 CPU protection
3. What are the system components of an operating system and explain them?
 Process Management
 Main-memory management
 File Management
 I/O Management
 Secondary storage Management
 Networking
 Protection System
CS2254-OPERATING SYSTEMS
Vi Institute of Technology
Department of Computer Science
Question Bank

Command-Interpreter System
4. What are the various process scheduling concepts?
 Scheduling queues with diagram
 Queuing diagram
 Schedulers
 Context-Switch with diagram
5. Explain about inter process communication?
 Message-passing system
 Naming
 Direct Communication
 Indirect Communication
 Synchronization
 Buffering
6. Explain the System Structure of Operating System?
 Simple Structure
 Layered Approach
 Micro Kernels
7. Explain the concept of Virtual Machine with neat sketch
 Implementation
 Benefits
8. Explain Client-Server communication with an example?
 Sockets
 RPC
 RMI
9. Explain the various threading issues?
 The fork and exec system calls
 Cancellation
 Signal Handling
 Thread Pools
 Thread-Specific Data
CS2254-OPERATING SYSTEMS
Vi Institute of Technology
Department of Computer Science
Question Bank
Unit -II : Process Scheduling and Synchronization
Part-A
1.Define CPU scheduling.
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.
2.What is meant by CPU Scheduler?
When the CPU becomes idle, the operating system must select one of the processes in the ready
queue to be executed .This selection process is carried out by the CPU Scheduler.
3.Draw the state transition diagram?
4.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.
5.What is dispatch latency?
The time taken by the dispatcher to stop one process and start another running is known as dispatch
latency.
6.What are the various scheduling criteria for CPU scheduling?
The various scheduling criteria are
• CPU utilization
CS2254-OPERATING SYSTEMS
Vi Institute of Technology
Department of Computer Science
Question Bank
• Throughput
• Turnaround time
• Waiting time
• Response time
7. 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.
8.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.
9.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.
10. 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.
11. What are the requirements that a solution to the critical section problem must satisfy?
The three requirements are
• Mutual exclusion
• Progress
• Bounded waiting
12. Define entry section and exit section.
The critical section problem is to design a protocol that the processes can use to cooperate.
Each process must request permission to enter its critical section. The section of the code
implementing this request is the entry section. The critical section is followed by an exit section. The
remaining code is the remainder section.
13.Give two hardware instructions and their definitions which can be used for implementing
mutual exclusion.
• TestAndSet
boolean TestAndSet (boolean &target)
{
CS2254-OPERATING SYSTEMS
Vi Institute of Technology
Department of Computer Science
Question Bank
boolean rv = target; target =
true; return rv;
}
• Swap
void Swap (boolean &a, boolean &b)
{
a = b;
b = temp;
}
14. 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++;
}
15.. Define busy waiting and spinlock.
When a process is in its critical section, any other process that tries to enter its critical section
must loop continuously in the entry code. This is called as busy waiting and this type of semaphore is
also called a spinlock, because the process while waiting for the lock.
16. What are the conditions that must hold for Deadlock Prevention?




Mutual Exclusion Condition
Hold and Wait Condition
No Pre-emption condition
Circular Wait Condition.
17. What are the options for breaking a Deadlock?
 Simply abort one or more process to break the circular wait.
 Preempt some resources from one or more of the deadlocked processes.
18. What are the algorithms available for Deadlock avoidance?
CS2254-OPERATING SYSTEMS
Vi Institute of Technology
Department of Computer Science
Question Bank
1) Resource-Allocation Graph Algorithm
2) Banker's Algorithm
a. Safety Algorithm
b. Resource-Request Algorithm
19. What is a Monitor?
A Monitor is characterized by a set of programmer-defined operators. The representation of a
Monitor type consists of declaration of variables whose value define the state of an instance of the type, as
well as the bodies of procedures or functions that implement operations on the type.
20. Differentiate Long Term Scheduler and Short Term Scheduler
The long-term scheduler or job scheduler selects processes from the job pool and loads them into
memory for execution.
The short-term scheduler or CPU scheduler selects from among the process that are ready to execute,
and allocates the CPU to one of them.
21. What is meant by Binary Semaphore?
A Binary Semaphore is a semaphore with an integer value that can range between 0 and 1. It can be
simpler to implement than a counting semaphore, depending on the underlying hardware architecture.
22. What is meant by Race Condition?
A condition, when several processes access and manipulate the same data on currently and the
outcome of the execution depends on the particular order in which the access takes place is called as Race
condition.
23. What does a solution for Critical-Section Problem must satisfy?
 Mutual Exclusion.
 Progress
 Bounded Waiting
24. What is meant by Indefinite Blocking or Starvation?
Indefinite Blocking is a situation where process waits indefinitely within the semaphore. This may
occur if we add and remove processes from the list associated with a semaphore in LIFO order.
25.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.
26.What is the sequence in which resources may be utilized?
Under normal mode of operation, a process may utilize a resource in the following sequence:
• Request: If the request cannot be granted immediately, then the requesting process must
wait until it can acquire the resource.
CS2254-OPERATING SYSTEMS
Vi Institute of Technology
Department of Computer Science
Question Bank
• Use: The process can operate on the resource.
• Release: The process releases the resource.
27.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.
28.What are the methods for handling deadlocks?
The deadlock problem can be dealt with in one of the three ways:
a. Use a protocol to prevent or avoid deadlocks,
b. Allow the system to enter the deadlock state, detect it and then recover.
c. Ignore the problem all together, and pretend that deadlocks never occur in the system.
29.What is banker's algorithm?
Banker's algorithm is a deadlock avoidance algorithm that is applicable to a resourceallocation system with multiple instances of each resource type.The two algorithms used for its
implementation are:
a. Safety algorithm: The algorithm for finding out whether or not a system is in a safe state.
b. Resource-request algorithm: if the resulting resource allocation is 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.
30.What are a safe state and an unsafe state?
A state is safe if the system can allocate resources to each process in some order and still
avoid a deadlock. A system is in safe state only if there exists a safe sequence. A sequence of
processes <P1,P2,....Pn> is a safe sequence for the current allocation state if, for each Pi, the resource
that Pi can still request can be satisfied by the current available resource plus the resource held by all
the Pj, with j<i. if no such sequence exists, then the system state is said to be unsafe.
31.What is known as Priority inversion?
The high priority process would be waiting for a lower -priority one to finish. This situation is
known as Priority Inversion.
32.What is Mutual Exclusion?
A way of making sure that if one process is using a shared modifiable data, the other processes will
be excluded from doing the same thing. Each process executing the shared data variables excludes all
others from doing so simultaneously. This is called mutual exclusion.
33.Differentiate Deadlock and Starvation.
CS2254-OPERATING SYSTEMS
Vi Institute of Technology
Department of Computer Science
Question Bank
A set of processes is in deadlock state when every process in the set is waiting for an event
that can be caused only by the other process in the set.
Starvation or indefinite blocking is a situation where processes wait indefinitely within the
semaphore.
Part-B
1. Write about the various CPU scheduling algorithms?
 FCFS Scheduling
 SJFS Scheduling
 Priority Scheduling
 Round-Robin Scheduling
 Multilevel queue Scheduling
 Multilevel feedback queue Scheduling
2. Describe various scheduling criteria?
 CPU utilization
 Throughput
 Turnaround time
 Waiting time
 Response time
3. What is critical section problem and explain two process solutions and multiple process
solutions?
 Critical section problem definition
 Two problem solution
 Algorithm
 Multiple-process solution with diagram
4. Explain about critical regions and monitors?
Critical regions:
 Wait and Signal mutex
 Implementation
Monitors:


Monitor with condition variables
Monitor solution to dining-philosopher problem
5. Explain the various classic problems of synchronization?
 The Bounded-Buffer Problem
CS2254-OPERATING SYSTEMS
Vi Institute of Technology
Department of Computer Science
Question Bank


The Readers-Writers Problem
The Dining –Philosophers Problem
6. Explain what semaphores are, their usage, implementation given to avoid busy waiting and
binary semaphores?
 Semaphore Definition
 Usage for mutual exclusion and process synchronization
 Implementation to avoid spinlock using block and wakeup
 Binary semaphore
7. Give a detailed description about deadlocks and its characterization
 Deadlock definition
 Deadlock conditions
 Mutual exclusion
 Hold and wait
 No-preemption
 Circular wait
 Resource allocation graph
8. Explain about the methods used to prevent deadlocks?
 Mutual exclusion
 Hold and wait
 No pre-emption
 Circular wait
9. Explain the Banker’s algorithm for deadlock avoidance?




Deadlock avoidance definition
Data Structure used
Safety algorithm
Resource request algorithm
10. Explain about Synchronization Hardware?
 The Definition
 Mutual –Exclusion
 Bounded – waiting mutual exclusion
11. Consider the following set of processes, with the length of the CPU-burst time given in
milliseconds:
Process Burst Time Priority
CS2254-OPERATING SYSTEMS
Vi Institute of Technology
Department of Computer Science
Question Bank
1.
2.
3.
4.
5.
P1 10 3
P2 1 1
P3 2 3
P4 1 4
P5 5 2The processes are assumed to have arrived in the order P1, P2, P3, P4, P5, all at time 0.
a. Draw four Gantt charts illustrating the execution of these processes using FCFS,SJF,A non
preemptive priority (a smaller priority number implies a higher priority), and RR (quantum
= 1) scheduling. (4)
b. What is the turnaround time of each process for each of the scheduling algorithms in part a?
(4)
c. c. What is the waiting time of each process for each of the scheduling algorithms in Part a?
(4)
d. d. Which of the schedules in part a results in the minimal average waiting time (over all
processes)? (4)
UNIT-III : Storage Management
PART-A
1. What are the types of Scheduling available?
 Preemptive Scheduling
 Non - preemptive Scheduling
 Priority Scheduling
2. What is Preemptive Scheduling and Non - Preemptive Scheduling?
A Scheduling discipline is Pre-emptive if the CPU can be taken away before the process completes.
A Scheduling discipline is non pre-emptive if once a process has been given the CPU, the CPU
cannot be taken away from the process.
3. What are the properties of Scheduling Algorithms?
 CPU Utilization
 Throughput
 Turnaround time
 Waiting time
 Response time
4.Difference between absolute path name and relative path name
Absolute path name
Relative path name
1. It begins at the root and follows a path down
1. Defines a path from current directory.
to the specified file, giving the directory names
CS2254-OPERATING SYSTEMS
Vi Institute of Technology
Department of Computer Science
Question Bank
of the path.
2.
Lesser
when
Absolute path name
2. The path is long.
compared
to
5. Define Overlays.
It is to keep in memory only those instructions and data that are needed at any given time. When
other instructions are needed, they are loaded into space that was occupied previously by instruction that is
no longer needed.
6. What is meant by Memory-Management Unit?
The run-time mapping form virtual to physical addresses is done by a hardware device is a called as
Memory Management Unit.
7. What is meant by Input Queue?
The Collection of processes on the disk that is waiting to be brought into memory for execution
forms the Input Queue.
8. What is known as Dynamic loading?
With Dynamic loading, a routine is not loaded until it is called. All routines are kept on disk in a relocatable load format. The main program is loaded into memory and is executed. When a routine needs to
call another routine, the calling routine first checks to see whether the another routine has been loaded. If
not, the re-locatable linking loader is called to load the desired routine into memory and to update the
program's address tables to reflect this change. Then, Control is passed to the newly loaded routine.
9. What is meant by Swapping?
It is a process of bringing in each process in its entirety, running it for a while and then putting it
back on the disk.
10. What is the advantage of Dynamic Loading?
The advantage of Dynamic Loading is that an unused routine is never loaded.(i.e) when large
amounts of code are needed to handle infrequently occurring cases, such as error routines. Here although
program size may be large, the portion that is used may be much smaller and better memory space
utilization.
11. What is known as Dynamic Linking?
In this Dynamic Linking, a stub is included in the image for each library-routine reference. This
Stub is a small piece of code that indicates how to locate the appropriate memory-resident library routine or
how to load the library if the routine is not already present.
CS2254-OPERATING SYSTEMS
Vi Institute of Technology
Department of Computer Science
Question Bank
12.Define logical address and physical address.
An address generated by the CPU is referred as logical address. An address seen by the memory unit
that is the one loaded into the memory address register of the memory is commonly referred to as
physical address.
13. What is logical address space and physical address space?
The set of all logical addresses generated by a program is called a logical address space; the set of all
physical addresses corresponding to these logical addresses is a physical address space.
14. What is meant by Paging? Give its advantages.
Paging is a Memory-management scheme that permits the physical -address space of a process to
be Non-contiguous.
Advantages:
 Avoids the considerable problem of fitting the varying -sized memory chunks onto the baking store
 Fragmentation problems are also prevalent baking store, except that access is much slower, so
compaction is impossible.
15. . Difference between the internal and external fragmentation?
INTERNAL FRAGMENTATION
EXTERNAL FRAGMENTATION
1. Free space available internal to the partition 1. Free space available external to the partition
2. It is the area in a region or a page that is not 2. It occurs when there is enough space to satisfy
used by the process allocated to.
a request for memory, but none of the free
holes between processes in memory is large
enough to satisfy the request.
3. The space is wasted until the process 3. It can be used by using pointers.
terminates.
16.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
17.What is meant by Demand Paging?
CS2254-OPERATING SYSTEMS
Vi Institute of Technology
Department of Computer Science
Question Bank
Whenever the CPU tries to fetch the first instruction, it gets a page fault causing the 0S to bring in
the page containing that instruction. Thus the pages are loaded only on demand is called as Demand
Paging.
18. What is meant by Page Table?
Page Table is a table which has the ability to mark an entry invalid through a Valid –Invalid bit or
special value of protection bits.
19. What is meant by Locality of reference?
During any phase of execution, the page references only a relative small fraction of its pages. This
reference of fraction of all pages is called as Locality of Reference.
20. What is TLB and Hit-Ratio?
 Translation Look-aside Buffer (TLB) is a small, special and fast cache which is associated with
high speed memory.
 The Percentage of times that a particular page number is found in the Translation Look-aside Buffer
(TLB) is called as Hit- Ratio.
21. What is meant by Segmentation?
Segmentation is a memory-management scheme that supports the user-view memory. Blocks of
different size is called as Segments and its associative virtual storage Organization is called as
Segmentation.
22. What is meant by Memory Compaction?
While swapping creates multiple holes in memory, it is possible to combine them all into one big
one by moving all the processes downward as far as possible.
23.What is meant by Global Replacement and Local Replacement?
 Global Page Replacement allows a process to select a replacement frame from the set of all
frames, even if that frame is currently allocated to some other process.
 Local Replacement requires that each process select from only its own set of allocated frames.
Here the number of frames allocated to a process doesn't change.
24. What is meant by Working Set?
A Working Set is defined as the collection of pages a process is actively reference string.
CS2254-OPERATING SYSTEMS
Vi Institute of Technology
Department of Computer Science
Question Bank
25.Define lazy swapper.
Rather than swapping the entire process into main memory, a lazy swapper is used. A lazy
swapper never swaps a page into memory unless that page will be needed.
26.What is a pure demand paging?
When starting execution of a process with no pages in memory,the operating system sets the
instruction pointer to the first instruction of the process, which is on a non-memory resident page, the
process immediately faults for the page. After this page is brought into memory, the process
continues to execute, faulting as necessary until every page that it needs is in memory. At that point,
it can execute with no more faults. This schema is pure demand paging.
27. Define effective access time.
Let p be the probability of a page fault (0£p£1). The value of p is expected to be close to 0;
that is, there will be only a few page faults. The effective access time is Effective access time = (1-p)
* ma + p * page fault time. ma : memory-access Time
28.What are the various page replacement algorithms used for page replacement?
o FIFO page replacement
o Optimal page replacement
o LRU page replacement
o LRU approximation page replacement
o Counting based page replacement
o Page buffering algorithm.
29.What is a reference string?
An algorithm is evaluated by running it on a particular string of memory references and
computing the number of page faults. The string of memory reference is called a reference string.
30.What is meant by page fault?
A page is a fixed length memory block used as a transferring unit between physical memory
and an external storage. A page fault occurs when a program accesses a page that has been mapped in
address space, but has not been loaded in the physical memory.
31.What is meant by Belady’s Anomaly?
It is also called FIFO anomaly. Usually, on increasing the number of frames allocated to a
process' virtual memory, the process execution is faster, because fewer page faults occur. Sometimes,
the reverse happens, i.e., the execution time increases even when more frames are allocated to the
process. This is Belady's Anomaly.
Part-B
1. Explain about contiguous memory allocation?
 Contiguous allocation
 Memory protection with diagram
 Memory allocation
CS2254-OPERATING SYSTEMS
Vi Institute of Technology
Department of Computer Science
Question Bank




First fit
Best fit
Worst fit
Fragmentation
2. Give the basic concepts about paging. (OR)Non-contiguous Memory Allocation?
 Paging definition
 Basic method-page, frame, page table, page number and page offset
 Paging hardware diagram
 TLB with diagram
3. Explain about swapping concept?
 Definition
 Swapping of two process using Disk and Backing store
4. Explain about the techniques for structuring the page table ?
 Hierarchical paging with two and multi-level
 Hashed page table
 Inverted page table
5. Discuss the address translation mechanism in paging?
 Hit Ratio
 Protection
6. Explain the basic concepts of segmentation with neat diagram?
 User view of program
 Segmentation definition
 Hardware used with diagram-segment table,base limit & offset
 Protection and sharing with diagram
 Fragmentation
7. Differentiate Paging and Segmentation?
8. Consider the following snapshot of a system:
Process
Allocation
Max
Available
ABCD
ABCD
ABCD
P0
0012
0012
1520
P1
1000
1750
P2
1354
2356
P3
0632
0652
P4
0014
0656
Answer the following questions using the banker’s algorithm:
a. What is the content of the matrix Need? Is the system in a safe state? (8)
b. If a request from process P1 arrives for (0, 4, 2, 0), can the request be granted
CS2254-OPERATING SYSTEMS
Vi Institute of Technology
Department of Computer Science
Question Bank
immediately? (8)
9. Consider the following page reference string:
1, 2, 3, 4, 2, 1, 5, 6, 2, 1, 2, 3, 7, 6, 3, 2, 1, 2, 3, 6.
How many page faults would occur for the following replacement algorithms, assuming
one, two, three, four, five, six, or seven frames? Remember all frames are initially
empty, so your first unique pages will all cost one fault each.
 LRU replacement
 FIFO replacement
 Optimal replacement
10. Explain the various page replacement strategies?
 FIFO page replacement
 Optimal page replacement
 LRU page replacement
 LRU approximation page replacement
 Counting-based page replacement
 Page buffering algorithm
11. Explain Memory Management in LINUX ?
 Management of physical memory
 Virtual memory
 Lifetime of virtual address space
 Execution and Loading Static and Dynamic linking
12. Explain about Demand Paging with example?
 Definition
 Virtual memory implementation
 Lazy swapper ,page fault, valid-invalid bit
13. Discuss about Thrashing and the methods to avoid thrashing?
 Thrashing definition
 Causes of thrashing


Working-set model
Page-fault frequency
14. Discuss about Allocation of Frames?
 Minimum number of frames
 Allocation of Algorithm
 Global versus Local Allocation
CS2254-OPERATING SYSTEMS
Vi Institute of Technology
Department of Computer Science
Question Bank
UNIT-IV : File Systems
Part-A
1.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.
2. What are the various file attributes & types.
• File attributes: Name, identifier, type, size, location, protection, time, date
• File types: executable, object, library, source code etc.
3.What are the various file operations?
The six basic file operations are
• Creating a file
• Writing a file
• Reading a file
• Repositioning within a file
• Deleting a file
• Truncating a file
4.What are the information associated with an open file?
Several pieces of information are associated with an open file which may be:
• File pointer
• File open count
• Disk location of the file
• Access rights
5. 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.
6.Define UFD and MFD.
In the two-level directory structure, each user has her own user file directory (UFD). Each UFD has a
similar structure, but lists only the files of a single user. When a job 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.
7.What is a path name?
A pathname is the path from the root through all subdirectories to a specified file.In a two-level
directory structure a user name and a file name define a path name.
CS2254-OPERATING SYSTEMS
Vi Institute of Technology
Department of Computer Science
Question Bank
8. What are the Access methods of a file ?
 Sequential Access
 Direct Access
 Other Access methods
9.What are the functions of virtual file system (VFS)?
It has two functions
a. It separates file-system-generic operations from their implementation defining a clean VFS
interface. It allows transparent access to different types of file systems mounted locally.
b. VFS is based on a file representation structure, called a vnode. It contains a numerical value for a
network-wide unique file .The kernel maintains one vnode structure for each active file or directory.
10. What are the operations performed in a Directory?
1)
2)
3)
4)
5)
6)
7)
8)
Create
Delete
Opendir
Closedir
Readdir
Rename
Link
Unlink
11. What are the different directory structures available?





Single - Level Directory
Two - Level Directory
Three - Structured Directory
A cyclic - Graph Directory
General Graph Directory
12. What is meant by Boot Control block?
The Block which contains information needed by the system to boot an operating system from that
partition is called as Boot Control Block.
13. What is meant by Partition Control Block?
The Block which contains partition details such as the number of blocks in that partition, size of the
blocks, free -block count and free - block pointers is called as partition control Block.
14. What are the different methods for allocation in a File System?
CS2254-OPERATING SYSTEMS
Vi Institute of Technology
Department of Computer Science
Question Bank
 Contiguous Allocation
 Linked Allocation
 Indexed Allocation
15. What is meant by Free Space List?
The list which maintains/records all free disk block which means blocks that are not allocated to
some file or Directory.
16. What is meant by Buffering?
Buffering is a process of providing space in the primary storage to hold the physical blocks of files
at once.
17. What is meant by Double Buffering?
A Memory Mapping proceeds by reading in disk blocks from the file system and storing them in
the buffer cache. Because the virtual memory system cannot interface with the buffer cache, the contents of
file in the buffer cache must be copied into the page cache. This situation is known as Double Caching.
18. What are File Attributes?




Identifier
Type, Size
Location, protection
Time, Date & User Identification
19. What is meant by Identifier in Files?
This has a unique tag, which is always a number that identifies the file within the file-system and it
is non-human readable name for the file.
20. What is meant by File Pointer?
This pointer is unique to each process operating on the file and it is the pointer used by the pointer
used by the system to track the last read-write location as a current - file position pointer.
Part-B
1. What are files and explain the access methods for files?
 Definition
 Attributes, Operations and Types
 Sequential access with diagram
 Direct access
CS2254-OPERATING SYSTEMS
Vi Institute of Technology
Department of Computer Science
Question Bank
2.
Explain File system implementation?
 Directory implementation
 Linear list
 Hash Table
3.
Explain the various Directory structures?
 Single-level Directory
 Two-level Directory
 Tree structured Directory
 Acyclic-graph Directory
 General graph Directory
4.
Write notes about the protection strategies provided for files?
 Types of Access
 ACL
 3 classification-owner, group and other
 Protection approaches
5. Explain the various allocation methods for disk space?
 Contiguous allocation
 Linked allocation
 Indexed allocation
 Performance
6. Write note on
(i)Log structured file system?
 Definition


Merits
Demerits
(ii) Efficiency, Performance and Recovery
 Disk allocation
 Directory algorithms
 RAM or Virtual Disk
 Consistency checking
 Backup and Restore
(iii) File system mounting:
 Steps for Mounting
 Mount Point
7.
Explain Linux File system?
CS2254-OPERATING SYSTEMS
Vi Institute of Technology
Department of Computer Science
Question Bank



The virtual file system
Linux ext2fs file system
Linux proc file system
8. Explain the following File concepts:
o File Attributes.
o File Operations.
o File Types .
o Internal File Structure.
9. Describe the following Directory Implementation methods:
(i) Linear List
(ii) Hash Table
10. Explain about Free Space Management?
 Bit vector with example
 Linked list with diagram
 Grouping & counting
UNIT-V: I/O Systems
Part-A
1.Define seek time and latency time.
The time taken by the head to move to the appropriate cylinder or track is called seek time. Once the
head is at right track, it must wait until the desired block rotates under the read-write head. This delay
is latency time.
2.Define rotational latency and disk bandwidth.
Rotational latency is the additional time waiting for the disk to rotate the desired sector to the disk
head. The disk bandwidth is the total number of bytes transferred, divided by the time between the
first request for service and the completion of the last transfer.
3.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.
CS2254-OPERATING SYSTEMS
Vi Institute of Technology
Department of Computer Science
Question Bank
4. What is meant by Band Width?
Band Width is the total number of bytes transferred, divided by the total time between the first
request for service and the completion of the last transfer.
5. What is meant by Swap-Space Management?
It is a low-level task of the operating system .Efficient management of the swap space is called as
Swap space management. This Swap space is the space needed for the entire process image including code
and Data segments.
6. What is meant by Disk Scheduling?
Disk scheduling is a process of allocation of the disk to one process at a time. In multi-programmed
system, many processes try to read or write the records on disks as the same time. To avoid disk arbitration,
it is necessary.
7. Why Disk Scheduling necessary?
To avoid Disk arbitration which occurs when many processes try to read or write the records on
disks at the same time, Disk Scheduling is necessary.
8. What are the characteristics of Disk Scheduling?
1) Throughput
2) Mean Response Time 3.Variance of Response time
9.What are the different types of Disk Scheduling ?.
Some of the Disk Scheduling are (i).SSTF Scheduling (ii).FCFS Scheduling (iii) SCAN Scheduling
(iv).C-SCAN Scheduling (v).LOOK Scheduling.
10.What is meant by SSTF Scheduling?.
SSTF Algorithm selects the request with the minimum seek time from the current head position.
and SSTF chooses the pending request to the current head position.
11.What is meant by FCFS Scheduling ?
It is Simplest form of Disk Scheduling. This algorithm serves the first come process always and is
does not provide Fast service.
12.What is meant by SCAN Scheduling ?.
In the SCAN algorithm, the disk arm starts at one end of the disk and moves toward the other end
of the disk. At the other end, the direction of head movement is reversed and servicing continues across the
disk.
CS2254-OPERATING SYSTEMS
Vi Institute of Technology
Department of Computer Science
Question Bank
13.What is meant by C-SCAN Scheduling?
C-SCAN means Circular SCAN algorithm. This Scheduling is a variant of SCAN designed to
provide a more waiting time. This essentially treats the cylinder as a circular list that wraps around from
the final cylinder to the first one.
14.Defing Throughput?
It is defined as the number of requests serviced per unit time.
15. What is meant by Data Striping?.
Data Stripping means splitting the bits of each byte across multiple disks .It is also called as Bit level Striping .
16.What is meant by Boot Disk ?.
A Disk that has a boot partition is called as Boot Disk.
17.What are the Components of a Linux System ?
Linux System composed of three main modules.
They are :(i).Kernel
(ii).System libraries
(iii).System utilities
18. What are the main support for the Linux modules ?.
The Module support under Linux has three components. They are :
(i). Module Management
(ii).Driver Registration.
(iii).Conflict Resolution mechanism.
19.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.
20. 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.
CS2254-OPERATING SYSTEMS
Vi Institute of Technology
Department of Computer Science
Question Bank
22.What is meant by Buffer cache ?.
It is the kernel's main cache for block-oriented devices such as disk drives and is the main
mechanism through which I/O to these devices is performed.
23.What is the Disadvantage of Static Linking ?.
The main disadvantage of static linking is that every program generated must contain copies of
exactly the same common system library functions.
24.What is meant by Kernel in Linux system ?.
Kernel is responsible for maintaining all the important abstractions of the operating system
including such things as virtual memory and processes.
25.What is meant by System Libraries?.
System Libraries define a standard set of functions through which applications can interact with the
kernel and that implement much of the operating -system functionality that doesn’t need the full privileges
of kernel code.
26.What is meant by System Utilities?.
System Utilities are system programs that perform individual, specialized management tasks. Some
of the System utilities may be invoked just to initialize and configure some aspect of the system and others
may run permanently, handling such tasks as responding to incoming network connections, accepting
logon requests from terminals or updating log files.
30.What is meant by Device drivers?.
Device drivers include (i) Character devices such as printers, terminals (ii) Block devices (including
all disk drives) and network interface devices.
31.Define daisy chain.
When device A has a cable that plugs into device B, and device B has a cable that plugs into device
C, and device C plugs into a port on the computer, this arrangement is called a daisy chain. A daisy
chain usually operates as a bus.
32What is sector sparing?
Low-level formatting also sets aside spare sectors not visible to the operating system. The controller
can be told to replace each bad sector logically with one of the spare sectors. This scheme is known as
sector sparing or forwarding.
33.What is Streams?
CS2254-OPERATING SYSTEMS
Vi Institute of Technology
Department of Computer Science
Question Bank
A stream is a data path that passes data in both directions between a STREAMS driver in kernel space, and a
process in user space. The word “stream” refers to an instance of a full-duplex path between a user application
and a driver.
34.What is RAID?
RAID stand for "redundant array of independent disks." With RAID technology, data can be
mirrored on one or more other disks in the same array.
PART-B
1. Write about the kernel I/O subsystem.
 I/O Scheduling
 Buffering
 Caching
 Spooling and device reservation
 Error handling
 Kernel data structures
2. Explain the various disk scheduling techniques?
 FCFS Scheduling
 SSTF Scheduling
 C-SCAN Scheduling
 LOOK Scheduling
3. Write notes on Disk management
 Disk formatting-low level formatting
 Boot block-bootstrap loader, boot block, boot disk & system disk
 Bad blocks-sector sparing ,sector slipping
4. Write notes on swap-space management.
 Swap-space use
 Swap-space location
 Swap-space management
5. Explain the various application I/O interface
 Block and character devices
 Network devices
 Clocks & times
 Blocking & non-blocking I/O
6. What is RAID? Explain its various levels?
 RAID
RAID 1
CS2254-OPERATING SYSTEMS
0
Vi Institute of Technology
Department of Computer Science
Question Bank




RAID 2
RAID 3
RAID 4
RAID 5
7. Write note on Disk attachment
 Network-Attached Storage
 Storage-Area Networks
 Stable-Storage
8. Write notes on Streams
 Benefits
 Performance
 Advantages
9. Explain in detail about I/O hardware?
 Policy
 Interrupts
 DMA
CS2254-OPERATING SYSTEMS
Download