0% found this document useful (0 votes)
32 views7 pages

PT2 Question Bank

Uploaded by

DK
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views7 pages

PT2 Question Bank

Uploaded by

DK
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

SETHU INSTITUTE OF TECHNOLOGY

(An Autonomous Institution |Accredited with ‘A++’ Grade by NAAC)

PULLOOR, KARIAPATTI–626115

PERIODICAL TEST – II

Part A- 2marks
1. Which algorithm makes the most efficient use of memory? Given memory partitions
of 100K, 500K, 200K, and 600K (in order), how would each of the First-fit, Best-fit,
and Worst-fit algorithms place processes of  212K, 417K, 112K, and 426K (in
order)?

2. Consider a logical address space of eight pages of 1024 words each, mapped onto a
physical memory of 32 frames.
a. How many bits are there in the logical address?
b. How many bits are there in the physical address?

3. Explain the difference between internal and external fragmentation


.
4. Why page are sizes always powers of 2?

5. What is demand paging?

6. Paging system consists of physical memory 2^24 bytes, pages of logical address space
is 256.Page size of 2^10 bytes, how many bits are in a logical address.

7. What is Virtual memory? Mention its advantages?

8. If the average page fault service time of 25 milliseconds and a memory access time of
100 nanoseconds. Calculate the effective access time.

9. What do you mean by page fault?

10. What is file? List some operations on it?

11. Explain the purpose of the open () and close () operations


12. In a file system with a hierarchical directory structure, explain how the path
/home/user/documents/file.txt would be resolved by the system.

13. Given a sequence of disk requests at cylinder numbers 98, 183, 37, 122, 14, and the
initial head position at cylinder 53, which request will be served first use the SSTF
(Shortest Seek Time First) algorithm?
14. Consider a logical address space of eight pages of 1024 words each, mapped onto a
physical memory of 32 frames. How many bits are in the logical address and physical
address?
15. Suppose that a system is in an unsafe state. Show that it is possible for the processes
to complete their execution without entering a deadlock state.
16. Differentiate logical memory from physical memory
17. When virtual memory is implemented in a computing system, there are certain costs
associated with the technique and certain benefits. List the costs and the benefits. Is it
possible for the costs to exceed the benefits? If it is, what measures can be taken to
ensure that this does not happen?
18. How does the system discover thrashing?
19. Consider a logical address space of eight pages of 1024 words each, mapped onto a
physical memory of 32 frames. How many bits are in the logical address and physical
address?
20. What is meant by Demand Paging?
21. If the average page faults service time of 25 ms and a memory access time of
100ns.Calculate the effective access time
22. What are the steps required to handle a page fault in demand paging?
23. What are the types of Path Names?
24. What are conditions under which a deadlock situation may arise?
25. Give an example of an application in which data in a file should be accessed in the
following order: i. sequential ii. Random
26. Construct a Resource Allocation Graph for the following scenario. At time’t’ Process P1
request for a resource X, process P2 requests for a resource Y. Both the resources are
Available and they are allocated to the requesting process. At time t1 where t1>t2 both the
processes are still holding the resources, however process P1 request for Y which is held by
P2, process P2 request for X held by P1. Will there be a deadlock? if there is a deadlock
discuss the four necessary conditions for deadlock, else justify there is no deadlock .
27. Suppose that a system is in an unsafe state. Show that it is possible for the
processes to complete their execution without entering a deadlock state.
28. Differentiate logical memory from physical memory
29. Analyze the process of calculating the number of bits required for both the logical and
physical addresses in a memory system with a logical address space consisting of 8
pages, each containing 1024 words and physical memory with 32 frames.
30. What is meant by Demand Paging?
31. If the average page faults service time of 25 ms and a memory access time of
100ns.Calculate the effective access time.
32. How does the system discover thrashing?
33. Will optimal page replacement algorithm suffer from Belady’s anomaly? Justify your
Answer.
34. Explain the purpose of the open() and close() operations.
35. What are the types of Path Names?
36. Why rotational latency is usually not considered in disk scheduling? How would you
modify SSTF, SCAN, and C-SCAN to include latency optimization?
37. The queue of requests in FIFO is 86, 147, 91, 177, 94,150,102,175,130. What is the
total head movement needed to satisfy the requests for the FCFS Scheduling
algorithm.
38. Give an example of an application in which data in a file should be accessed in the
following order: i. sequential ii. Random
Part B-16 marks
1. Consider the following snapshot of a system:
Process Allocation Max Available
ABCD ABCD ABCD

P0 0012 0 012 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?
b. If a request from process P1 arrives for (0, 4, 2, 0), can the request be granted
immediately? Evaluate the impact of this request on the system’s safety.

2. Consider the traffic deadlock depicted in Figure

a. Show that the four necessary conditions for deadlock hold in this example.
b. State a simple rule for avoiding deadlocks in this system.

3.Consider the following snapshot of a system:


Process Allocation Max Available
ABCD ABCD ABCD
P0 2001 4212 3321
P1 3121 5252
P2 2103 2316
P3 1312 1424
P4 1432 3665
Answer the following questions using the banker’s algorithm:
What is the content of the matrix Need?
Is the system in a safe state?
If a request from process P1 arrives for (1, 1, 0, 0), can the request be granted immediately
4.Program binaries in many systems are typically structured as follows. Code is stored
starting with a small, fixed virtual address, such as 0. The code segment is followed by the
data segment that is used for storing the program variables. When the program starts
executing, the stack is allocated at the other end of the virtual address space and is allowed to
grow toward lower virtual addresses. What is the significance of this structure for the
following schemes?
a. Contiguous memory allocation
b. Pure segmentation
c. Pure paging
5. Consider 5 processes P0 through P4; 3 resource types A(10 instances), B(5instances, and
C(7 instances).Snapshot at time T0:

Allocati Max Available


on ABC ABC
P0 A B C
P1 0 1 0 753 332
P2 2 0 0 322
P3 3 0 2 902
P4 2 1 1 222
002 433
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?
b. If a request from process P1 arrives for (1,0,2), can the request be granted
immediately?
c. Can request for (3,3,0) by P4 be granted?
d. Can request for (0,2,0) by P0 be granted?

6. Given memory Partitions of 100 KB,500 KB,200 KB,300 KB and 600 KB(in order) how
would each of the first-fit, best-fit and worst -fit algorithms place processes of 212 KB,417
KB,112 KB and 426 KB ?
(i) which algorithm makes the most efficient use of memory?
(ii)Consider the following segment table
Segment base length
0 219 60
1 2300 14
2 90 100
3 1327 580
What are the physical addresses for the following logical addresses?
a.0, 430 b. 1, 10 c. 2 500 d.3, 400

7. 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.
a. LRU page replacement.
b. FIFO page replacement
c. optimal page replacement

8. Consider a demand-paged computer system where the degree of multi programming is


currently fixed at four. The system was recently measured to determine utilization of the CPU
and the paging disk. The results are one of the following alternatives. For each case, what is
happening? Can the degree of multi programming be increased to increase the CPU
utilization? Is the paging helping?
a. CPU utilization 13 percent; disk utilization 97 percent
b. CPU utilization 87 percent; disk utilization 3 percent
c. CPU utilization 13 percent; disk utilization 3 percent
9. Consider the Pages referenced by the CPU in the order are
6, 7, 8, 9, 6, 7, 1, 6, 7, 8, 9, 1
How many page faults would occur for the following replacement algorithm, assuming four
and six frames respectively?
a. LRU page replacement.
b. FIFO page replacement
c. optimal page replacement

10. Why can VMMs not implement trap-and-emulate-based virtualization on some CPUs?
Lacking the ability to trap-and-emulate, what method can a VMM use to implement
virtualization

11. 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.
a. LRU page replacement.
b. FIFO page replacement
c. optimal page replacement

12. Consider a system with 80% hit ratio, 50 Nano-seconds time to search the associative
registers, 750 Nano-seconds time to access memory.
Find the time to access a page
(a) When the page number is in associative memory
(b) When the time to access a page when not in associative memory.
(c) Find the effective memory access time.

13. Consider a file system in which a file can be deleted and its disk space reclaimed while
links to that file still exist. What problems may occur if a new file is created in the same
storage area or with the same absolute path name? How can these problems be avoided?

14. Compare different disk scheduling algorithms (FCFS, SSTF, SCAN, C-SCAN, LOOK,
C-LOOK) and analyze their effectiveness in minimizing seek time and improving disk
throughput under various workload conditions. Analyze the trade-offs between fair ness and
performance in disk scheduling algorithms. Which scheduling algorithm strikes the best
balance, and why?
15. Consider that a disk drive has 5,000 cylinders, numbered 0 to 4,999.The drive is currently
serving request at cylinder 143, and the previous request was at cylinder 125. The queue of
pending requests, in FIFO order, is: 86, 1470, 913, 1774, 948, 1509, 1022, 1750, 130
Starting from the current head position, what is the total distance (in cylinders) that the disk
arm moves to satisfy all pending requests for each of the following disk scheduling
algorithms?
A. FCFS B. SSTF C. SCAN D. C-SCAN E. LOOK F. C-LOOK

16. Consider a file system in which a file can be deleted and its disk space reclaimed while
links to that file still exist. What problems may occur if a new file is created in the same
storage area or with the same absolute path name? How can these problems be avoided?

17. Consider a disk with 200 tracks and the queue has random requests from different
processes in the order:
55, 58, 39, 18, 90, 160, 150, 38, 184 Initially arm is at 100. Find the Average Seek length
using FIFO,SSTF, SCAN and C-SCAN algorithm

18. Analyze the open-file table is used to maintain information about files that are currently
open. Should the operating system maintain a separate table for each user or just maintain one
table that contains references to files that are Currently being accessed by all users? If the
same file is being accessed by two different programs or users, should there be separate
entries in the open-file table?

You might also like