cs604 Final Term - Current Papers Solved
cs604 Final Term - Current Papers Solved
2. In the _________ algorithm the disk arm starts at one end of the disk, and moves toward the
other end, servicing requests as it reaches each cylinder, until it gets to the other end of the
disk.
A. Scan Correct (Page no 244)
B. SSTF
C. Look
D. C-Look
3. The _______ algorithm selects the request with the minimum seek time from the current head
position.
A. Scan
B. SSTF Correct (Page no 243)
C. Look
D. C-Look
4. Assume a logical address space of 16 pages of 1024 words, each mapped into a physical
memory of 32 frames. Each word consists of 2 bytes. What will be the total number of bits
required for f (frames)?
6. "Only one process may use a resource at a time" best describe which one of the following?
A. Circular wait
B. Hold and wait
C. No preemption
D. Mutual Exclusion Correct (Page no 102, 131)
7. Which of the following memory allocation scheme suffers from External fragmentation?
9. _________________ occurs in a dynamic memory allocation system when many of the free
blocks are too small to satisfy any request.
A. and n
B. and 0
C. 0 and 1 Correct
D. 1 and n
A. Paging
B. Segmentation Correct (Page no 175)
C. Locality of reference
D. Demand Paging
13. __________ is the separation of user logical memory from physical memory
15. For page replacement algorithms, the page fault rate may increase as the number of allocated
frames __________
A. Keep Constant
B. Increases Correct (Page no 198)
C. Decreases
D. Available
16. In case of thrashing, if CPU utilization is too low, the operating system _____________ the
degree of multiprogramming
19. When there is no external fragmentation, free memory blocks are scattered on hard disk then
___________ is used in order to utilize these blocks for space management.
A. Indexed Allocation
B. Contiguous Allocation
C. Linked Allocation Correct (Page no 235)
D. Variable Allocation
20. The condition in which a set {P0,P1....Pn} of waiting processes must exist such that p0 is
waiting for a resource that is held by p1,p1 is waiting for a resource that is held by P2, and so
on,Pn-1 is waiting for a resource held by Pn, and Pn is waiting for a resource held by P0.
A. Mutual exclusion
B. Hold and wait
C. No preemption
D. Circular wait Correct (Page no 128)
21. Intel 80386 used paged segmentation with ________ level paging.
A. One
B. Two Correct (Page no 185)
C. Three
D. Four
22. __________ is a variation of fork system call in several Unix operating system used for Virtual
Memory.
23. In a UNIX system, ___________ system call can be used to request the operating system to
memory map an opened file.
24. In deadlock detection and recovery algorithm, a deadlock exists in the system if and only if the
wait for graph contains a ____________.
A. Operating system
B. Programmer Correct (Page no 159)
C. Kernel
D. Shell
26. In __________ page replacement algorithm oldest frame is replaced with another.
A. LIFO
B. FIFO Correct (Page no 198)
C. LRU
D. Optimal
27. A page table needed for keeping track of pages of the page table is called ____________
A. 2-level paging
B. Page directory Correct (Page no 170)
C. Page size
D. Page table size
A. 2
B. 3
C. 4 Correct (Page no 167)
D. 5
29. The most important property of the working set is its ________.
A. Delay
B. Thrashing
C. Time
D. Size Correct (Page no 210)
30. The critical section problem can be solved by the following except
A. Bakery Algorithm
B. TSL instruction
C. Semaphore Correct (Google)
D. Monitors
32. Which of the following in infinite blocking caused due to unavailability of resources?
33. The operation(s) that can be invoked on condition variables of Monitor are __________.
A. Wait()
B. Signal()
C. Block
D. Both wait () and signal Correct (Page no 123)
34. Which of the following is effective memory access time T effective with part of page table in
TLB and rest in main memory according to the following information?
T effective = 50 ns
T TLB = 10 ns
A. 100 ns
B. 70 ns
C. 48 ns Correct
D. 140 ns
36. Physical memory is broken down into fixed-sized blocks, called ________.
37. If members of a team have to work sequentially on the shared files then _________ is the
most suitable scheme.
A. Common Login
B. Common Group
C. Link
D. Duplication File Correct (Page no 227)
38. ___________ wastes CPU cycles that some other process may be able to use productively.
A. Mutual Exclusion
B. Bounded Waiting
C. Busy Waiting Correct (Page no 109)
D. None of the given options
39. What do we name to an address that is loaded into the memory-address register of the
memory?
A. Logical address
B. Physical address Correct (Page no 155)
C. Binary address
D. None of the given options
A. Directory
B. Link File
C. Ordinary File
D. Block Special File Correct (Page no 217)
41. "No resource can be forcibly removed from a process holding it" best describe which one of
the following conditions?
A. Mutual Exclusion
B. Hold and wait
C. Starvation
D. No preemption Correct (Google)
42. The mechanism that brings a page into memory only when it is needed is called
____________.
A. Segmentation
B. Fragmentation
C. Demand Paging Correct (Page no 186)
D. Pager Replacement
A. Virtual memory implements the translation of a program's address space into physical
memory address space.
B. Virtual memory allows each program to exceed the size of the primary memory
C. Virtual memory increases the degree of multiprogramming
D. Virtual memory reduces the context switching overhead Correct
44. Consider the case when multiple instances of a text editor are invoked. Only one copy of the
editor needs to be kept in the physical memory. Each user's page table maps in to the same
physical copy of the editor, but data pages are mapped onto different frames. This is the
advantage of ___________.
45. ___________ is the situation in which number of processes involved in the circular wait and
none of them in making progress.
A. Starvation
B. Dormant
C. Deadlock Correct
D. Safe sequence
46. In ______ scheme, free frames are equally divided among processes.
47. _____________ is the time for the disk arm to move the head to the cylinder containing the
desired sector.
A. Rotational Latency
B. Access Time
C. I/O time
D. Seek time Correct (Page no 242)
48. When a process needs to execute, memory is requested by the process. The size of the
process is compared with the amount of adjacent memory available to execute the process.
This method is called ____________.
49. Wait and signal operations of semaphores were originally termed __________.
A. Bounded buffer
B. Counting
C. Binary Correct
D. Mutex
51. Preventing the condition of ____________ to happen, deadlocks can be prevented to happen.
A. Critical region
B. Monitors
C. Circular wait Correct (Page no 135)
D. Critical section
52. The major criterion in the selection of a particular algorithm is that we want to __________
53. ___________ is used in the detection and recovery mechanism to handle deadlocks.
A. Addressing
B. Binding Correct (Page no 144)
C. Routing
D. Memory
55. ____________ keeps in memory only those instructions and data that are needed at any given
time.
A. Paging
B. Swapping
C. Overlays Correct (Page no 144)
D. Fragmentation
57. Which command, displays permissions and some other attributes for prog1.c in your current
directory?
"There exists a bound on the number of times that other processes are allowed to enter
their critical sections after a process made a request to enter its critical section and before
that request is granted"
A. Progress
B. Mutual Exclusion
C. Critical Region
D. Bounded Waiting Correct (Page no 101)
61. In Bakery’s algorithm, the ticket numbering scheme always generate numbers ________
A. Virtual memory help in executing bigger programs even greater in size that of main
memory
B. Virtual memory makes the processes to stuck when the collective size of all the
processes becomes greater size of main memory. Correct
C. Virtual memory also allows files and memory to be shared by several different processes
through page sharing
D. Virtual memory makes the task of programming easier because the programmer need
not worry about the physical memory.
3 Marks Questions
Question no 1:
Suppose, Logical address space=32 bits and page size = 8k then calculate the following.
Answer:
Since there are 2^20 pages in total, the page number (p) requires 20 bits.
The remaining bits are used for the offset (d), which is 12 bits since the page size is 8k (2^13)
and 2^12 is 4k. Therefore, 32 - 20 = 12 bits are used for the offset.
Question no 2:
In segmentation, how do you evaluate whether a logical address is legal or not? Write
evaluation criteria and segment offset partitioning.
Answer:
The segment number must be less than the maximum number of segments allowed by the
system, and the offset must be less than the size of the segment identified by the segment
number.
A Spin lock is a synchronization object that normally device drivers used to avoid destructive
interference in an object-based multitasking environment. Spin locks are released explicitly,
although some are released automatically. You are required to mention the negative effects
of spin lock?
Answer:
Question no 4:
Write down the access modes and classes of users (to implement file protection permissions)
in UNIX based systems.
Answer:
The access modes in UNIX based systems are read, write, and execute. The classes of users to
implement file protection permissions are owner, group, and others
Question no 5:
Semaphore are used as synchronization tools for orderly execution of cooperating processes.
However, sometimes incorrect use of semaphores may lead to Deadlock, starvation and
mutual exclusion violation. Write down the ways through which programmer does not have to
write down wait() and signals() calls in correct sequence and let the compiler do the serialized
execution of these calls.
Answer:
One way to avoid the need for the programmer to manually write wait() and signal() calls in the
correct sequence is to use the concept of monitors. In this approach, the programmer defines a monitor
module which contains shared variables and procedures. The monitor ensures that only one process can
execute inside the monitor at a time, and provides its own wait() and signal() procedures that are
automatically executed in the correct order.
Another approach is to use higher-level synchronization constructs like semaphores with higher-level
programming languages that have built-in support for such constructs. For example, some programming
languages provide constructs like monitors or mutexes which can automatically handle the required
synchronization operations, thereby simplifying the programming process and reducing the likelihood of
errors.
5 Marks Questions
Question no 1:
You are required to calculate the following parameters assuming logical address space of 8 pages of
1MB and physical address space of 16 frames.
Answer:
Since the logical address space consists of 8 pages, we need log2(8) = 3 bits to represent the
page number. Therefore, p = 3.
Since the physical address space consists of 16 frames, we need log2(16) = 4 bits to represent
the frame number. Therefore, f = 4.
Since each page is 1MB in size, and the page size is the same as the frame size, there is no
displacement or offset within each page/frame. Therefore, d = 0.
The logical address consists of two parts: the page number and the displacement. Since p = 3
and d = 0, the number of bits required for the page number is 3 and the number of bits required
for the displacement is 20 (since each page is 1MB in size, which is 220 bytes). Therefore, the
logical address requires a total of 23 bits.
The physical address also consists of two parts: the frame number and the displacement. Since f
= 4 and d = 0, the number of bits required for the frame number is 4 and the number of bits
required for the displacement is 20. Therefore, the physical address requires a total of 24 bits.
Question no 2:
You are required to identify the name of the problem which can be solved by the code given
below. Also define that problem.
1st Process:
do (
wait(empty);
wait(mutex);
signal(mutex);
signal(full);
} while(1);
2nd Process:
do (
wait(full);
wait (mutex);
buffer to nextc
signal(mutex);
signal(empty);
….
while(1);
Answer:
The code given implements a solution to the Producer-Consumer problem in operating systems
using two semaphores and a mutex to synchronize access to a shared buffer. The Producer
produces items and puts them in the buffer, while the Consumer removes items from the buffer
and consumes them. The semaphores and mutex ensure that the Producer and Consumer do
not interfere with each other's access to the buffer
Question no 3:
Answer:
2. Hold and Wait: A process holding at least one resource is waiting to acquire
additional resources held by other processes.
4. Circular Wait: There exists a set of processes {P1, P2, ..., Pn} such that P1 is waiting
for a resource held by P2, P2 is waiting for a resource held by P3, ..., and Pn is
waiting for a resource held by P1, creating a circular chain of dependencies.
To put it simply, deadlock occurs when multiple processes are waiting for resources that
are being held by other processes, creating a circular dependency that cannot be
resolved. This results in all the processes being stuck in a deadlock, unable to proceed
further.
Question no 4:
Consider a scenario in which some software engineers working on the same project
need to share files or directories related to the project. You are required to write
down at least four ways that facilitate file sharing in this scenario.
Answer:
There are several ways in which software engineers can share files or directories related
to a project. Some of these ways include:
1. Shared Network Drives: Shared network drives can be set up so that all the
software engineers have access to the same files and directories. This can be done
through a centralized server or cloud-based storage services such as Google Drive,
Dropbox, or OneDrive.
2. Version Control Systems: Version control systems such as Git, SVN, and Mercurial
can be used to share project files among software engineers. These systems allow
developers to make changes to files and keep track of the changes made by others,
ensuring that everyone is working on the latest version of the code.
3. File Transfer Protocols: FTP or SFTP can be used to transfer files between software
engineers working on the same project. These protocols are secure and allow large
files to be transferred easily.
4. Collaborative Tools: Collaborative tools such as Microsoft Teams, Slack, Trello, and
Asana can be used to facilitate file sharing and project collaboration. These tools
allow team members to share files, assign tasks, and communicate with each other
in real-time, making it easier to collaborate on projects.