UNIVERSITY OF HOUSTON Department of Computer Science COSC 4330: Fundamentals of Operating Systems FINAL EXAMINATION December 15, 1992 CLOSED BOOK: You are allowed one 8.5 by 11" sheet of notes. 1. What is a TRANSLATION LOOKASIDE BUFFER (10 points)? What is the major difference between a page table entry and a trans- lation lookaside buffer entry? (5 points) A translation lookaside buffer (TLB) is a set of hardware registers containing the most recently used page table entries. It is searched first by the memory management unit before consulting the page table of the current process. In addition to the information stored in the page table entry it is caching, each TLB entry must also contain a PAGE NUMBER. (This information is not needed in the page table entry because it is implicitly indicated by the location of the entry in the page table). 2. What was the motivation for adding a second hand to the Clock page replacement algorithm? (10 points) When main memory sizes started to grow in the mid-eighties, it was found that the hand of the clock was taking too much time to scan the whole main memory. Hence, more recent UNIX implementations have added a second hand that follows the first hand at a fixed angle. Now the first hand clears valid bits and the second hand expels the pages that have not been accessed by the process after their valid bit had been cleared by the first hand. 3. Explain why the VMS page replacement algorithm is neither a true local nor a true global algorithm. (10 points) What are the major advantages of this approach? (2x5 points) The VMS page replacement policy is neither a global nor a local policy because (a) VMS allocates to each process a fixed-size partition that it manages using a FIFO policy, and (b) the pages expelled by the FIFO policy are put at the end of a large global queue from which they can be reclaimed. The two major advantages of the VMS policy are: (a) it provides efficient support for real-time processes because VMS can allocate to each real-time process enough page frames to keep the whole address space of the process in main memory and guarantee that none of its pages would ever be expelled. (b) it achieves the almost the same overall performance as LRU without requiring any special hardware. 4. What characterizes all processes that run efficiently on a virtual memory system? (10 points) All processes that run efficiently on a virtual memory system obey to the principle of locality, that is they access at any time a small fraction of their total address space and this fraction does not change too frequently. 5. What is the purpose of the dirty bit? (5 points) The purpose of the dirty bit is to keep track of which pages have been modified since they were brought into main memory and which pages were not. Pages that have been modified since they were brought into main memory are said to be "dirty" because they need to be copied back to disk before being expelled from main memory; the other pages are said to be "clean" because their copy on disk is still valid. 6. What are memory mapped files? (10 points) What are their main advantage (4 points) and their disadvantages (3x2 points) ? A mapped file is a file that is mapped into the virtual memory space of the processes accessing it. Once a file is mapped, it becomes part of the address space of the process. The major advantage of memory mapped files is than their contents can be accessed through standard programming constructs: Hence standard assignments can replace replace reads and writes, which reduces the number system calls and context switches. Four major disadvantages are: (a) The OS will never know the exact file size; it knows only the number of pages in the file. (b) If two or more processes on the same machine access one file at the same time, OS must map the file into a shared memory segment. (c) Shared access by two or more processes on different machines is even harder to implement. (d) Some files are too large to be mapped into a 32 bit virtual address space. 7. What are the contents of a UNIX directory entry? (2x5 points) A UNIX directory entry only contains a file name and an i-number, that is the index of the i-node describing the file in the table of i-nodes of the disk partition. 8. What information is contained in the access control list of a UNIX file? (10 points) The UNIX access control list of a file contains the three possible rights (read, write or execute) of three groups of users (the owner of the file, all users specified in the "/etc/group" entry associated with the group-ID of the file and all other users). --IMPORTANT----IMPORTANT----IMPORTANT----IMPORTANT----IMPORTANT-- Please do not try to answer these questions by yourself BEFORE having a clear idea of what's on the test for which you are studying. Materials covered in each test DO VARY from semester to semester because the pace of the course can change, some materials are be added and other deleted almost every semester. ----------------------------------------------------------------