II Year IV Sem Cs8493 Operating Systems
II Year IV Sem Cs8493 Operating Systems
ENGINEERING
Question Bank
To equip students with values, ethics and life skills needed to enrich their lives and
M3
enable them to meaningfully contribute to the progress of society
M4 To prepare students for higher studies and lifelong learning, enrich them with the
practical and entrepreneurial skills necessary to excel as future professionals and
contribute to Nation’s economy
M3 To produce engineers with good professional sKills, ethical values and life skills for the
betterment of the society.
PEO3 Apply ethical Knowledge for professional excellence and leadership for the
betterment of the society.
PEO4 Develop life-long learning skills needed for better employment and
entrepreneurship
CS8493 OPERATING SYSTEMS
LTPC 3003
OBJECTIVES:
TOTAL : 45 PERIODS
TEXT BOOK :
1. Abraham Silberschatz, Peter Baer Galvin and Greg Gagne, ―Operating System
Concepts‖, 9th Edition, John Wiley and Sons Inc., 2012.
Ans:
C212.1 BTL-1
• Complex Operating System is required
• Large main memory required
• Very expensive
user interaction is
there won’t be any user
involved in the
interactions
processing
14 Define: process
Ans: A process is a program in execution. It is an
C212.1 BTL-1
active entity and it includes the process stack,
containing temporary data and the data section
contains global variables.
16 What is scheduler?
Ans: A process migrates between the various
scheduling queues through out its life time. The OS C212.1 BTL-1
must select processes from these queues in some
fashion. This selection process is carried out by a
scheduler.
17 What are the use of job queues, ready queues
and device queues?
Ans: As a process enters a system they are put in to
a job queue. This queues consist of all jobs in the
C212.1 BTL-1
system. The processes that are residing in main
memory and are ready and waiting to execute are
kept on a list called ready queue. The list of
processes waiting for particular I/O devices kept in
the device queue.
29
Summarize the functions of DMA.
Ans: Direct memory access (DMA) is a method that
allows an input/output (I/O) device to send or
C212.1 BTL-2
receive data directly to or from the main memory,
bypassing the CPU to speed up memory operations.
The process is managed by a chip known as a DMA
controller (DMAC).
• Storage allocation.
• Disk scheduling
Ans:Program execution
Communications
Error detection
Ans:Increased throughput
C212.1 BTL-1
Economy of scale
Increased reliability
Ans:
Process Control
C212.1 BTL-1
File-management
Device-management
Information maintenance
Communications
Monitor Mode
Ans:
Operating System
Computer Hardware
PART B & C
10 What is a thread?
Ans: 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 C212.2 BTL-1
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.
Ans:
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 Creating and manage blocking system call
C212.2
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 Creating & manage
compared to user threads. If the thread performs a
blocking system call, the kernel can schedule
another thread in the application for execution
13 What is the use of fork and exec system calls? C212.2 BTL-1
Ans: Fork is a system call by which a new process is
Creatingd. Exec is also a system call, which is used
after a fork by one of the two processes to place the
process memory space with a new program.
• Switching context
• Switching to user mode
• Jumping to the proper location in the user
program to restart that program.
20 What are the various scheduling criteria for CPU
scheduling?
Ans: The various scheduling criteria are,
C212.2 BTL-1
• CPU utilization
• Throughput
• Turnaround time
• Waiting time
• Response time
21 What are the requirements that a solution to the
critical section problem must satisfy?
Ans: The three requirements are C212.2 BTL-1
• Mutual exclusion
• Progress
• Bounded waiting
22 Define: Critical section problem.
Ans: Consider a system consists of 'n' processes.
Each process has segment of code called a critical
section, in which the process may be changing C212.2 BTL-1
common variables, updating a table, writing a file.
When one process is executing in its critical section,
no other process can allowed executing in its critical
section.
boolean rv = target;
target = true;
return rv;
C212.2 BTL-1
}
• Swap
boolean temp = a;
a = b;
b = temp;
}
25 What is a semaphore?
Ans: A semaphore 'S' is a synchronization tool
which is an integer value that, apart from
initialization, is accessed only through two standard C212.2 BTL-1
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.
26 Define Deadlock.
Ans: A process requests resources; if the resources
are not available at that time, the process enters a
C212.2 BTL-1
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.
Ans: Job Queue: As process enters the system they C212.2 BTL-1
are put into job queue.
39 Define schedulers?
No preemption
Circular Wait
PART B&C
1 Suppose that the following processes arrive for
execution at the times indicated. Each process will
run the listed amount of time. In answering the
questions, use non-preemptive scheduling and
base all decisions on the information you have at
the time the decision must be made. (Nov/Dec
2018)
Process Arrival Time Burst Time
P1 0.0 8
C212.2 BTL-1
P2 0.4 4
P3 1.0 1
UNIT III
STORAGE MANAGEMENT
PART A
S. Question CO Blooms
No. Taxano
my
Level
1 What is the difference between user-level instructions and
privileged instructions? (April/May 2017)
Ans: A non-privileged (i.e. user-level) instruction is an
C212.3 BTL-1
instruction that any application or user can execute. A privileged
instruction, on the other hand, is an instruction that can only be
executed in kernel mode. Instructions are divided in this manner
because privileged instructions could harm the kernel.
Ans: In certain situations the page tables could become large C212.3 BTL-1
enough that by paging the page tables, one could simplify the
memory allocation problem (by ensuring that everything is
allocated as fixed-size pages as opposed to variable-sized
chunks) and also enable the swapping of portions of page table
that are not currently used.
Logical Physical
1. An address seen by
memory unit that is, the one
loaded into the memory
address register of the
1. An address generated memory is referred to as
by CPU is referred to us a physical address.
logical address.
12 Define Overlays.
Ans: To enable a process to be larger than the amount of
memory allocated to it, overlays are used. The idea of overlays
is to keep in memory only those instructions and data that are C212.3 BTL-1
needed at a given time.
When other instructions are needed, they are loaded into space
occupied previously by instructions that are no longer needed.
13 Define swapping.
Ans: A process needs to be in memory to be executed. However
C212.3 BTL-1
a process can be swapped temporarily out of memory to a
backing store and then brought back into memory for continued
execution. This process is called swapping.
1. When the user is paying for management costs, and the costs
are cheaper for a time-sharing system than for a single-user
computer. C212.3 BTL-1
Ans:
Protection bits that are associated with each frame accomplish C212.3 BTL-1
memory protection in a paged environment. The protection bits
can be checked to verify that no writes are being made to a read-
only page.
Ans:
The two major problems to implement demand paging is
developing,
Ans:
C212.3 BTL-1
When the allocated memory may be slightly larger than the
requested memory, the difference between these two numbers is
internal fragmentation.
Ans:
Compaction is a solution to external fragmentation. The C212.3 BTL-1
memory contents are shuffled to place all free memory together
in one large block. It is possible only i f relocation is dynamic,
and is done at execution time.
Ans:
Paging is a memory management scheme that permits the
C212.3 BTL-1
physical -address space of a process to be non-contiguous. In
the case of paging, physical memory is broken into fixed-sized
blocks called frames and logical memory is broken into blocks
of the same size called pages.
Ans:
When the bit is set to valid, this value indicates that the
C212.3 BTL-1
associated page is in the process’s logical address space, and is
thus a legal page. If the bit is said to invalid, this value indicates
that the page is not in the process’s logical address space. Using
the valid-invalid bit traps illegal addresses.
Ans:
All addresses need to be adjusted upward by 250.So the
adjusted addresses would be 300, 328, 400, 402, and 40
Ans:
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 C212.3 BTL-1
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.
Ans:
C212.3 BTL-1
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
Ans:
This memory holds those pages that are not present in main C212.3 BTL-1
memory. The secondary memory is usually a high speed disk. It
is known as the swap device, and the section of the disk used for
this purpose is known as swap space.
45 What is the basic approach of Page Replacement?
Ans:
If no frame is free is available, find one that is not currently
C212.3 BTL-1
being used and free it. A frame can be freed by writing its
contents to swap space, and changing the page table 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.
Ans:
FIFO page replacement
Ans:
C212.3 BTL-1
Best fit allocates the smallest hole that is big enough. The entire
list has to be searched, unless it is sorted by size. This strategy
produces the smallest leftover hole.
Ans:
First fit allocates the first hole that is big enough. Searching can C212.3 BTL-1
either start at the beginning of the set of holes or where the
previous first-fit search ended. Searching can be stopped as soon
as a free hole that is big enough is found.
b. How many bits are there in the physical address? C212.3 BTL-1
Ans:
a. Logical address: 16 bits
PART B&C
1 Explain about given memory management techniques. (i)
Partitioned allocation (ii) Paging and translation look-aside
buffer. (Nov/Dec 2015) (Apr/May 2017)
C212.3 BTL-5
Refer page no 360-371 from text book “Abraham Silberschatz,
Peter Baer Galvin and Greg Gagne, “Operating System
Concepts”, 9th Edition, John Wiley and Sons Inc., 2012”.
5 C212.3 BTL-3
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.
Identify the no.of 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.
14 What is thrashing and explain the methods to avoid thrash C212.3 BTL-1
UNIT IV
I/O SYSTEMS
Mass Storage Structure- Overview, Disk Scheduling and Management; File System Storage-
File Concepts, Directory and Disk Structure, Sharing and Protection; File System
Implementation- File System Structure, Directory Structure, Allocation Methods, Free Space
Management; I/O Systems.
PART A
Blooms
S.
Taxano
No Question CO
my
.
Level
1 Distinguish file from dictionary. (Apr/May2017)
Ans: C212.4 BTL-4
A file is any kind of computer document whereas a directory is a
collection of files and folders.
Ans:
Most disks do not export their rotational position information to
the host. Even if they did, the time for this information to reach C212.4 BTL-1
the scheduler would be subject to imprecision and the time
consumed by the scheduler is variable, so the rotational position
information would become incorrect. Further, the disk requests
are usually given in terms of logical block numbers, and the
mapping between logical blocks and physical locations is very
complex.
8 What are the functions of Virtual File System (VFS) layer in C212.4 BTL-1
file system implementation? (Nov/Dec 2015)
Ans:
A virtual file system (VFS) or virtual file system switch is an
abstraction layer on top of a more concrete file system. The
purpose of a VFS is to allow client applications to access
different types of concrete file systems in a uniform way. A VFS
can, for example, be used to access local and network storage
devices transparently without the client application noticing the
difference.
9 What is a file?
Ans:
C212.4 BTL-1
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.
Reading a file
Repositioning within a file
Deleting a file
Truncating a file
Access rights
13 Define Directory.
Ans:
The device directory or simply known as directory records C212.4 BTL-1
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.
Two-level Directory
Tree-Structured Directories
Acyclic-Graph Directories
General Graph Directory
17 Examine how an index file is used to speed up the access in C212.4 BTL-4
direct-access files?
Ans:
Have an index in memory; the index gives the key and the disk
location of its corresponding record. Scan the index to find the
record you want, and then access it directly.
a. Contiguous allocation
b. Linked allocation
c. Indexed allocation
File-organization module
Basic file system
I/O control
Devices
Ans:
The time taken by the head to move to the appropriate cylinder C212.4 BTL-1
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.
Ans:
Rotational latency is the additional time waiting for the disk to C212.4 BTL-1
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.
Ans:
The free-space list is implemented as a bit map or bit vector. BTL-1 &
C212.4
BTL-4
Each block is represented by 1 bit. If the block is free, the bit is
1; if the block is allocated, the bit is 0.
Advantages: It is relatively simple and its efficiency in finding
the first free block or n consecutive free blocks on the disk.
Ans:
C212.4 BTL-1
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.
Ans:
C212.4 BTL-1
The most general scheme to implement identity-dependent
access is to associate with each file and directory an access
control unit.
Ans:
The way to split „m’ frames among „n’ processes is to give
C212.4 BTL-1
everyone an equal share, m/n frames. For instance, if there are
93 frames and 5 processes, each process will get 18 frames. The
leftover 3 frames could be used as a free-frame buffer pool. This
scheme is called equal allocation.
Ans:
Effective access time = (1-p) *ma + p*page fault time C212.4 BTL-5
= (1-p) *100+p*25000000
= 100-100p+25000000*p
= 100 + 24999900p
Ans:
Path names can be of two types.
C212.4 BTL-1
Absolute path name: Begins at the root and follows a path down
to the specified file, giving the directory names on the path.
Ans:
The locality model states that, as a process executes, it moves
C212.4 BTL-1
from locality to locality. Locality is of two types.
Spatial locality
Temporal locality.
Ans:
The disadvantages are,
Ans:
The advantages are, C212.4 BTL-1
No external fragmentation
Ans:
The disadvantages are,
SCAN Scheduling
C-SCAN Scheduling
LOOK scheduling
Ans:
Programmed I/O C212.4 BTL-1
Ans:
C212.4 BTL-1
Sequentially - Print the content of the file.
Ans:
C212.4 BTL-1
There would be multiple paths to the same file, which could
confuse users or encourage mistakes. (Deleting a file with one
path deletes the file in all the other).
50 Why must the bit map for file allocation be kept on mass
storage rather than in main memory?
Ans:
C212.4 BTL-1
In case of system crash (memory failure ), the free-space list
would not be lost as it would be if the bit map had been stored in
main memory
PART B
1 Explain about directory structure? (Apr/May 2015) (Apr/May C212.4 BTL-5
2017)
Refer page no 517 – 526 from text book “Abraham Silberschatz,
Peter Baer Galvin and Greg Gagne, “Operating System
Concepts”, 9th Edition, John Wiley and Sons Inc., 2012”.
2 What are files and explain the access methods for files?
(Apr/May 2017)
C212.4 BTL-1
Refer page no 379 – 382 from text book “Abraham Silberschatz,
Peter Baer Galvin and Greg Gagne, “Operating System
Concepts”, 9th Edition, John Wiley and Sons Inc., 2012”.
Refer page no 498 – 502 from text book “Abraham Silberschatz, C212.4 BTL-5
Peter Baer Galvin and Greg Gagne, “Operating System
Concepts”, 9th Edition, John Wiley and Sons Inc., 2012”.
9 C212.4 BTL-4
Distinguish between a STREAMS driver and STREAMS
module. (Nov/Dec 2016)
Refer page no 601-602 from text book “Abraham
Silberschatz, Peter Baer Galvin and Greg Gagne, “Operating
System Concepts”, 9th Edition, John Wiley and Sons Inc.,
2012”.
10 BTL – 1
What are the various disk space allocation methods. Explain in C212.4 & BTL-
detail. (Apr/May 2018) 5
11 Consider a file system where a file can be deleted and the disk
space reclaimed while the links to that file still exist. What
C212.4 BTL-1 &
problems may occur if a new file is created in the same storage BTL-4
area or with the same absolute path name? How these problem
be avoided? (Nov/Dec 2015)
12 Illustrate an application that could benefit from operating system C212.4 BTL-2
support for random access to indexed files. (Nov/Dec 2015)
14 Write briefly about file attributes, operations, types and structure C212.4 BTL-5
15 Discuss in detail about file allocation methods. What are the C212.4 BTL-6
possible structures for directory? Discuss themin detail.
UNIT V
CASE STUDY
PART A
Blooms
S. Taxano
Question CO
No. my
Level
1 What are the features of Linux file system? (Apr/May 2017)
Ans:
• Specifying paths C212.5 BTL-1
• Partition, drives/devises and Directories
• Mounting and Unmounting
• Case sensitivity
• File Extensions
• Hidden files
• File System Permissions
2 What is the use of kernel modules in Linux? (Apr/May 2017)
Ans:
C212.5 BTL-1
Kernel modules are pieces of code that can be loaded and
unloaded into the kernel upon demand. They extend the
functionality of the kernel without the need to reboot the system.
Ans:
A mechanism that allows different device drivers to, reserve C212.5 BTL-1
hardware resources and to protect those resources from
accidental use by another driver.
Linux provides a ventral conflict resolution mechanism.
18 Define XEN.
Ans:
Xen is a virtual machine monitor (VMM) for x86-compatible C212.5 BTL-1
computers. Xen can securely execute multiple virtual machines,
each running its own OS, on a single physical system with close-
to-native performance. Xen is open source, and is released under
terms of the GNU General Public License.
Ans:
• Better utilization of computer hardware.
• More securable and manageable than one kernel running C212.5 BTL-1
many applications.
• Reduce complexity of hardware.
• Consumes less power and less space.
• Requires less maintenance
Extended life for installed software.
20 Illustrate the key features of VMware server virtualization.
Ans:
• High Availability (HA) C212.5 BTL-2
• Fault Tolerance (FT)
• vMotion
• Storage vMotion
• Distributed Resource Scheduler (DRS)
21 Explain guest operating system.
Ans: A guest OS is the software installed on either a virtual C212.5 BTL-2
machine (VM) or partitioned disk that describes an operating
system that is different than the host operating system.
Ans:
Linux virtualization refers to running one or more virtual
machines on a physical computer that's operated by the Linux C212.5 BTL-1
open source operating system. Linux virtualization can be used
for isolating specific apps, programming code or even an
operating system itself, as well as for security and performance
testing purposes.
27 Prepare a list of LINUX system administrator
responsibilities.
Ans:
C212.5 BTL-1
The Linux system administrators are responsible for installing,
configuring and maintaining the Linux servers and workstations.
They are responsible for maintaining the network environment
as well as the health of the network and servers.
32 C212.5 BTL-1
What is handle? How does a process obtain a handle?
(Apr/May 2018)
Ans: A handle is an abstract reference to a resources.
A process gets a handle by creating an object, by opening an
existing object, by receiving a duplicated handle from another
process, or by inhering a handle from the parent process. When a
process exists, all its open handles are implicitly closed.
Ans:
C212.5 BTL-1
Data Stripping means splitting the bits of each byte across
multiple disks .It is also called as Bit –level Striping.
Ans:
C212.5 BTL-1
Linux System composed of three main modules. They are:
Ans:
The Module support under Linux has three components. They
are:
C212.5 BTL-1
(i). Module Management
(ii).Driver Registration.
Ans:
C212.5 BTL-1
A Process is the basic context within which all user-requested
activity is serviced within the Operating system.
Ans:
C212.5 BTL-1
Process Personalities are primarily used by emulation libraries to
request that system call be compatible with certain versions of
UNIX.
Ans:
C212.5 BTL-1
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.
Ans:
C212.5 BTL-1
Kernel is responsible for maintaining all the important
abstractions of the operating system including such things as
virtual memory and processes.
Ans:
System Libraries define a standard set of functions through C212.5 BTL-1
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.
Ans:
C212.5 BTL-1
The module management allows modules to be loaded into
memory and to talk to the rest of the kernel.
Ans:
C212.5 BTL-1
Driver Registration allows modules to tell the rest of the kernel
that a new driver has become available
Ans:
C212.5 BTL-1
This mechanism allows different device drivers to reserve
hardware resources and to protect those resources from
accidental use by another driver.
Ans:
C212.5 BTL-1
Device drivers include (i) Character devices such as printers,
terminals (ii) Block devices including all disk drives) and
network interface devices.
Ans:
Media layer is an Apple Inc. term that refers to software
C212.5 BTL-1
frameworks and technologies that enable audio, visual and other
multimedia capabilities within an iOS powered device. It defines
the entire multimedia architecture within Apple-powered mobile
devices and applications.
PART B&C
1 Explain about Linux kernel and virtualization with neat sketch.
(Apr/May 2017) (Nov/Dec 2016)
C212.5 BTL-2
Refer page no 703 – 705 from text book “Abraham Silberschatz,
Peter Baer Galvin and Greg Gagne, “Operating System
Concepts”, 9th Edition, John Wiley and Sons Inc., 2012”.
Answer: When there are few other users, the task is large, and
the hardware is fast, timesharing
makes sense. The full power of the system can be brought to
bear on the user’s
C212.5 BTL-1
problem. The problem can be solved faster than on a personal
computer. Another case
occurs when lots of other users need resources at the same time.