Assignment 3 -Operating Systems Homework Assignment 3 Submission is via Canvas. You may submit either a plain text (.txt) or a PDF (.pdf) file. Succinct, concise answers to the questions are preferable to long, rambling ones. Textbook Questions (50 points) 1. OSC 7.16: In a real computer system, neither the resources available nor the demands of processes for resources are consistent over long periods (months). Resources break or are replaced, new processes come and go, and new resources are purchased and added to the system. If deadlock is controlled by the banker’s algorithm, which of the following changes can be made safely (without introducing the possibility of deadlock), and under what circumstances? [6 points] a. Increase Available (new resources added) b. Decrease Available (resources are permanently removed from the system) c. Increase Max for one process (the process needs or wants more resources than allowed) d. Decrease Max for one process (the process decides it does not need that many resources) e. Increase the number of processes f. Decrease the number of processes 2. OSC 8.13: Compare the memory organization schemes of contiguous memory allocation, pure segmentation, and pure paging with respect to the following issues: [9 points] a. External fragmentation b. Internal fragmentation c. Ability to share code across processes 3. OSC 8.25: Consider a paging system with the page table stored in memory. [5 points] a. If a memory reference takes 50 nanoseconds, how long does a paged memory reference take? b. If we add TLBs, and 75% of all page-table references are found in the TLBs, what is the effective memory reference time? (Assume that finding a page-table entry in the TLBs takes 2 nanoseconds if the entry is present.) 4. OSC 9.14: Assume that a program has just referenced an address in virtual memory. Describe a scenario in which each of the following can occur. (If no such scenario can occur, explain why.) [12 points] a. TLB miss with no page fault b. TLB miss and page fault c. TLB hit and no page fault d. TLB hit and page fault CIS 415 Assignment 3 -2- 5. OSC 9.21: Consider the following page reference string: 7, 2, 3, 1, 2, 5, 3, 4, 6, 7, 7, 1, 0, 5, 4, 6, 2, 3, 0, 1 Assume demand paging with 3 frames, how many page faults would occur for the following replacement algorithms? [18 points] a. LRU replacement b. FIFO replacement c. Optimal replacement