Final Exam O.S
Final Exam O.S
Final Exam O.S
Concepts/Terms:
Banker's Algorithm, Deadlock detection (pg 268), reusable resource, consumable resource, memory
managements requirements & Techniques, Fixed/dynamic partitioning, Simple
paging/segmentation, virtual memory paging/segmentation, fragmentation (internal, external),
placement/replacement, page table, segment table, logical-physical address translation (e.g., pg
308), thrashing (321), resident set, working set, principle of locality, Concepts that appear in table
8.3 (pg 340) and table 8.4 (pg 352), page fault, segment fault, modify bit, invalid bit, System
Scheduling (types, criteria, policies), FCFS, RR, SPN, Feedback, Disk Scheduling Policies (SSTF,
SCAN, FIFO)---pros/cons and algorithm.
Text Questions:
Chapter
Questions
2, 3, 8, 9, 12.
4, 9.
1, 13(a)
11
SAMPLE QUESTIONS (including some questions from the Ph.D. qualifying exam in OS) :
1. Employing semaphores, Solve the reader/writer problem giving the writer priority.
2. Describe the deadlock detection algorithm found on pages 266-268.
3. Considering the basic function of a page table, for example: the need to locate, replace, or
swap pages to/from secondary storage; memory protection and sharing, explain what the
fields of a page-table would be and the rational for each field.
4. Given a system that uses the bankers algorithm for avoiding deadlock and the resource
state shown below, explain why it is a safe or unsafe state. Assume that the total number of
each system resource is <6, 4, 4, 2>, where <R0, R1, R2, R3> and Ri means the amount of
resource i.
Current Allocations
Process
R0
R1
R2
R3
Process
R0
R1
R2
R3
P1
P1
P2
P2
P3
P3
P4
P4
P5
P5
Priority preemption
non-preemptible resources
memory fragmentation
quantum preemption
Paging
Thrashing
virtual memory
Page Frame
working-set
page fault
6. Explain how a paging system works, be certain to include faults, thrashing, pages, frames,
swapping, page replacement strategies, address translation, and anomalies.
12 Explain the mapping of a virtual address to a real address under a paging system, include
faults, pages, page frames, swapping, page replacement (be sure you are clear, and use
diagrams if necessary.)
13 Discuss deadlock; what is it. Provide an illustration, explain the necessary conditions for
deadlock, and name the three basic approaches to handling deadlock.
15. There are three basic issues in defining a paging policy: when to fetch a page, when to
remove/replace a page, and where to place pages. Discuss one aspect of each issue.
17. Assume a disk with 200 tracks and that the disk request queue has random requests in it. The
requested tracks, in the order received are: 55, 58, 39, 18, 90, 160, 150, 38, and 184. Assuming
that the disk head is a track 100, and is moving toward track 200, show the sequence that the
requests will be serviced and the total track sequence traversed for each of the following
scheduling policies: FCFS, SSTF, and SCAN.
18. (Ph.D. exam) Semaphores: Using semaphores, implement a writer's priority solution to the
readers/writes problem.
19. (Ph.D. exam) Deadlock: A system that uses the Banker's Algorithm deadlock avoidance has five
(5) processes (1, 2, 3, 4, and 5) and four (4) types of resources (A, B, C, and D). There are multiple
resources of each type. Is the following state safe or not? If it is, show how the processes can
complete. If not, show how they can deadlock.
Process
Current loan
Max need
Current claim
ABCD
ABCD
ABCD
1020
0312
2451
3006
4213
3242
3512
2775
5508
6214
22
32
03
25
20
1
2
3
4
5
Resources Available
Total Resources
A B C D
3 4 0 1
13 13 9 13
B C
2
0
2
0
0
2
0
4
2
1
20. (Ph.D. exam) Virtual memory: Draw a picture showing how virtual memory addresses in a page
system are translated to real addresses when using combined associative/direct mapping
21. (Ph.D. exam) Virtual memory: Why is it generally more desirable to replace an unmodified page
rather than a modified one? In what circumstances might it be more desirable to replace a
modified page?
22. (Ph.D. exam) Virtual memory: How might a storage manager determine if storage is overcommitted (i.e., too many processes)?
2. We discussed two memory models in class, strongly ordered and weakly ordered. Explain
each model, and include how they can affect a programmers view of memory.
3. A system is composed of 4 processes, { p1, p2, p3, p4 }and three types of serial reusable
resources, {s1, s2, s3}. The number of units of the resources are t1=3, t2=2, and t3=2.
Process p1 holds 1 unit of s1 and requests 1 unit of s2. P2 holds 2 units of s2 and requests 1
unit each of s1 and s3. P3 holds 1 unit of s1 and requests 1 unit of s2. P4 holds 2 units of s3
and requests 1 unit of s1. Show the serially reusable resource graph to represent this
system state. Show the reduced form of the graph. Which, if any, of the processes are
deadlocked in this state?
23. (Ph.D. exam) In a file system: what is the difference between a queued access method and a
basic access method?
24. What would it mean to retain state information in a fileserver system? What are the pros and
cons of either retaining state information or being a stateless fileserver?
a. 011011110100
b. 011011100000
Question 7.7
a. Yes, it is possible.
b. It provides a greater variety of block sizes (e.g., 5, 8, 13, 21) to choose from, so there is
the potential to reduce internal fragmentation, but by the same token it can increase
external fragmentation in that there may be many unusable blocks created.