Memory Management 1) Consider a logical address space of 64 (or 26) pages of 1,024 (or 210) bytes each, mapped onto a physical memory of 32 (or 25) frames. a. How many bits are there in the logical address? b. How many bits are there in the physical address? 2) Page Address Translation Assuming a 1 KB page size, what are the page numbers and offsets for the following address references (provided as decimal numbers): a. 2375 b. 19366 c. 30000 d. 256 e. 16385 3) Sharing memory pages a) What is the effect of allowing two entries in a page table to point to the same page frame in memory? Explain how this effect could be used to decrease the amount of time needed to copy a large amount of memory from one place to another. b) What is the copy-on-write feature, and under what circumstances is it beneficial to use this feature? c) What is a re-entrant program 4) What is the difference between a physical address and a virtual address? 5) A computer with a 32 bit address uses a two level page table. Virtual addresses are split into a 9-bit top-level, an 11-bit second-level page table, and an offset. How large are the pages and how many are there in the address space. Page 1 of 6
6) Given five memory partitions of 100 KB, 500 KB, 200 KB, 300 KB, and 600 KB (in order), how would the best-fit, and worst-fit algorithms place processes of 212 KB, 417 KB, 112 KB, and 426 KB (in order)? Which algorithm makes the most efficient use of memory? 100 KB 500 KB 200 KB 300 KB 600 KB Page 2 of 6
Virtual Memory 7) Under what circumstances do page faults occur? Describe the actions taken by the operating system when a page fault occurs. 8) Consider the following page reference string: 1, 2, 3, 4, 2, 1,5,3,6,7,2,1,2,3,7,6,3,5 How many page faults would occur for the following replacement algorithms, assuming, three, frames? Remember that all frames are initially empty, so your first unique pages will cost one fault each. a. LRU replacement b. Second chance replacement, aka clock replacement Page 3 of 6
FILE MANAGEMENT 9) What file organization would you choose (and why) to maximize efficiency in terms of speed of access, use of storage space and ease of updating (adding/deleting /modifying) when the data are: ( give me a good enough reason for your choice and you ll get credit, even if it isn t the choice I would make) a.) Updated infrequently and accessed frequently in random order? b.) Updated frequently and accessed in its entirety relatively frequently? c.) Updated frequently and accessed frequently in random order? 10) Name one advantage of hard links over symbolic links and one advantage of symbolic links over hard links. 11) Directories can be implemented as special files that can be accessed in limited ways, or as ordinary files. What are the advantages and disadvantages of each approach? Consider the operating system, file management, disk management and whatever else you feel should be considered. 12) Describe the folling methods of keepting track of which discks blocks go with which files (sec 4.3.2) a) Contiguous Allocation b) Linked-list Allocation c) Index node (i-node) Allocation 13) What is a virtual file system (VFS)? I/O Management and Disk Scheduling 14) For the following disk accesses, compute the total number of tracks traversed for the following list of seeks to disk cylinder: 26 37 100 14 88 33 99 12. Assume head is initially positioned over 26. FCFS SSTF : Shortest service Time SCAN (assume the head is going up, i.e., moving in the direction of decreasing track number) C-SCAN (assume the head is going up, i.e.,, moving in the direction of decreasing track number) Page 4 of 6
15) What are the advantages and disadvantages of smaller vs. larger disk sector size? Talk about both advantages and disadvantages. Consider operating system work, like buffering, paging, disk scheduling, etc.. 16) Suppose a disk free space list indicates that the following blocks of storage are available: 100 blocks, 500 blocks, 200 blocks, 300 blocks, and 600 blocks (in order). There are requests to allocate 212 blocks, 417 blocks, 112 blocks, and 426 blocks (in order)? Using the first best fit allocation strategy, who would the blocks be allocated? Using the worst best fit allocation strategy, who would the blocks be allocated? Which strategy makes the most efficient use of storage? 17) Define device memory mapped I/O and direct memory access (DMA) and how they are related. 18) FFS (Fast file system). Include the layout and use of inode structure and entries. 19) What is meant by device independence with regards to I/O software. 20) Explain how an OS can facilitate installation of a new device without an need for recompiling the OS. Reliability 21) We discussed 3 approaches to reliability. Describe one: Careful sequencing of file system operations Copy-on-write Journaling 22) Describe what is meant by RAID. Explain levels RAID 0 and RAID 3. DeadLocks 23) Consider the traffic deadlock depicted in Figure 1.a. Show that the four necessary conditions for deadlock indeed hold in this example. b. State a simple rule for avoiding deadlocks in this system. 24) 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, new resources are bought 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? Page 5 of 6
a. Increase Available (new resources added) b. Decrease Available (resource permanently removed from system) c. Increase Max for one process (the process needs more resources than allowed, it may want more) d. d. Decrease Max for one process (the process decides it does not need that many resources) e. Increase the number of processes 25) Know how to do the banker s algorithm, determine if a system is in a safe state 26) With regards to deadlock management, what is meant by a safe state? Page 6 of 6