22
CS140 Operating Systems and Systems Programming Final Exam March 17, 2003 (Total time = 165 minutes, Total Points = 165) Name: (please print)______________________________ In recognition of and in the spirit of the Stanford University Honor Code, I certify that I will neither give nor receive unpermitted aid on this exam. Signature:_______________________________________ This examination is closed notes and closed book. You may not collaborate in any manner on this exam. You have 165 minutes (2 hours and 45 minutes) to complete the exam. Before starting, please check to make sure that you have all 22 pages. 1 12 2 13 3 14 4 15 5 16 6 17 7 18 8 19 9 20 10 21 11 Total Name:_______________

CS140 Operating Systems and Systems Programming Final Exam ...€¦ · CS140 Final Winter 2003 Name_____ Page 2 of 22 f (1) (10 points) Your Nachos HW4 project partner adds a weird

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: CS140 Operating Systems and Systems Programming Final Exam ...€¦ · CS140 Final Winter 2003 Name_____ Page 2 of 22 f (1) (10 points) Your Nachos HW4 project partner adds a weird

CS140 Operating Systems and Systems Programming Final Exam

March 17, 2003

(Total time = 165 minutes, Total Points = 165)

Name: (please print)______________________________ In recognition of and in the spirit of the Stanford University Honor Code, I certify that I will neither give nor receive unpermitted aid on this exam. Signature:_______________________________________

This examination is closed notes and closed book. You may not collaborate in

any manner on this exam. You have 165 minutes (2 hours and 45 minutes) to complete the exam. Before starting, please check to make sure that you have all 22 pages.

1 12 2 13 3 14 4 15 5 16 6 17 7 18 8 19 9 20 10 21 11 Total

Name:_______________

Page 2: CS140 Operating Systems and Systems Programming Final Exam ...€¦ · CS140 Final Winter 2003 Name_____ Page 2 of 22 f (1) (10 points) Your Nachos HW4 project partner adds a weird

CS140 Final Winter 2003 Name____________________

Page 2 of 22f

(1) (10 points) Your Nachos HW4 project partner adds a weird protection system to your project’s file system. The protection system requires that in order to open a file a process must pass the message digest of the file as an additional argument to the open system call. Unfortunately your partner leaves town early leaving you to write up the design document for the project. (a) Would you classify this protection system as an access control list or a capability based system? Justify your answer. (b) Describe a file system workload in which this kind of protection system would have large performance overhead.

Page 3: CS140 Operating Systems and Systems Programming Final Exam ...€¦ · CS140 Final Winter 2003 Name_____ Page 2 of 22 f (1) (10 points) Your Nachos HW4 project partner adds a weird

CS140 Final Winter 2003 Name____________________

Page 3 of 22f

(2) (8 points) What are the key pieces of information that must be setup on both end-points of a TCP/IP connection? How many messages does it take to complete this setup?

Page 4: CS140 Operating Systems and Systems Programming Final Exam ...€¦ · CS140 Final Winter 2003 Name_____ Page 2 of 22 f (1) (10 points) Your Nachos HW4 project partner adds a weird

CS140 Final Winter 2003 Name____________________

Page 4 of 22f

(3) (7 points) Describe what kind of changes you would make to a modern operating system to get it to run faster in a virtual machine running on a virtual machine monitor.

Page 5: CS140 Operating Systems and Systems Programming Final Exam ...€¦ · CS140 Final Winter 2003 Name_____ Page 2 of 22 f (1) (10 points) Your Nachos HW4 project partner adds a weird

CS140 Final Winter 2003 Name____________________

Page 5 of 22f

(4) (7 points) A speaker is talking about directly accessing physical I/O devices from virtual machines. The speaker claims that programmed I/O and interrupts are easy, but DMA is problematic. Describe what the problem is for I/O devices doing DMA to or from virtual machines.

Page 6: CS140 Operating Systems and Systems Programming Final Exam ...€¦ · CS140 Final Winter 2003 Name_____ Page 2 of 22 f (1) (10 points) Your Nachos HW4 project partner adds a weird

CS140 Final Winter 2003 Name____________________

Page 6 of 22f

(5) (12 points) For each of the issues below, describe if virtual circuits or datagram protocols would have an advantage in dealing with issue. Justify your answer. (a) Quality of Service (b) Failures (c) Very low-bandwidth links

Page 7: CS140 Operating Systems and Systems Programming Final Exam ...€¦ · CS140 Final Winter 2003 Name_____ Page 2 of 22 f (1) (10 points) Your Nachos HW4 project partner adds a weird

CS140 Final Winter 2003 Name____________________

Page 7 of 22f

(6) (7 points) Describe the mechanism used in TCP to allow multiple data packets to be in flight at the same time.

Page 8: CS140 Operating Systems and Systems Programming Final Exam ...€¦ · CS140 Final Winter 2003 Name_____ Page 2 of 22 f (1) (10 points) Your Nachos HW4 project partner adds a weird

CS140 Final Winter 2003 Name____________________

Page 8 of 22f

(7) (7 points) Describe the structure of 32bit Internet addresses that keeps the size of the forwarding tables on the routers manageable.

Page 9: CS140 Operating Systems and Systems Programming Final Exam ...€¦ · CS140 Final Winter 2003 Name_____ Page 2 of 22 f (1) (10 points) Your Nachos HW4 project partner adds a weird

CS140 Final Winter 2003 Name____________________

Page 9 of 22f

(8) (7 points) Explain how an Ethernet local area network handles contention for the network.

Page 10: CS140 Operating Systems and Systems Programming Final Exam ...€¦ · CS140 Final Winter 2003 Name_____ Page 2 of 22 f (1) (10 points) Your Nachos HW4 project partner adds a weird

CS140 Final Winter 2003 Name____________________

Page 10 of 22f

(9) (7 points) Give an example of the end-to-end argument as applied to computer networks.

Page 11: CS140 Operating Systems and Systems Programming Final Exam ...€¦ · CS140 Final Winter 2003 Name_____ Page 2 of 22 f (1) (10 points) Your Nachos HW4 project partner adds a weird

CS140 Final Winter 2003 Name____________________

Page 11 of 22f

(10) (8 points) Describe how one would get both integrity and security in an email system using a public key crypto system.

Page 12: CS140 Operating Systems and Systems Programming Final Exam ...€¦ · CS140 Final Winter 2003 Name_____ Page 2 of 22 f (1) (10 points) Your Nachos HW4 project partner adds a weird

CS140 Final Winter 2003 Name____________________

Page 12 of 22f

(11) (7 points) Describe how the principle of minimum privileges might be used in the design of a secure operating system. Give examples.

Page 13: CS140 Operating Systems and Systems Programming Final Exam ...€¦ · CS140 Final Winter 2003 Name_____ Page 2 of 22 f (1) (10 points) Your Nachos HW4 project partner adds a weird

CS140 Final Winter 2003 Name____________________

Page 13 of 22f

(12) (8 points) Explain how a write-ahead logging file system can give better write performance than a similar file system without write-ahead logging.

Page 14: CS140 Operating Systems and Systems Programming Final Exam ...€¦ · CS140 Final Winter 2003 Name_____ Page 2 of 22 f (1) (10 points) Your Nachos HW4 project partner adds a weird

CS140 Final Winter 2003 Name____________________

Page 14 of 22f

(13) (7 points) Describe the problem that can occur if the operating system allows the file cache and virtual memory system to compete for the physical memory of the machine.

Page 15: CS140 Operating Systems and Systems Programming Final Exam ...€¦ · CS140 Final Winter 2003 Name_____ Page 2 of 22 f (1) (10 points) Your Nachos HW4 project partner adds a weird

CS140 Final Winter 2003 Name____________________

Page 15 of 22f

(14) (12 points) The FAT file system used a linked file approach. The link pointers themselves were only 16bits so as disks are got bigger so did the block size. Of the issues listed below, what effect did this increasing block size have? (a) Sequential file access performance. (b) Random file access performance. (c) Fragmentation.

Page 16: CS140 Operating Systems and Systems Programming Final Exam ...€¦ · CS140 Final Winter 2003 Name_____ Page 2 of 22 f (1) (10 points) Your Nachos HW4 project partner adds a weird

CS140 Final Winter 2003 Name____________________

Page 16 of 22f

(15) (7 points) Why did the BSD fast file system tend to spread big files over the disk.

Page 17: CS140 Operating Systems and Systems Programming Final Exam ...€¦ · CS140 Final Winter 2003 Name_____ Page 2 of 22 f (1) (10 points) Your Nachos HW4 project partner adds a weird

CS140 Final Winter 2003 Name____________________

Page 17 of 22f

(16) (7 points) Describe the technique used in RAID4 or RAID5 devices to duplicate state without having complete copies of the data.

Page 18: CS140 Operating Systems and Systems Programming Final Exam ...€¦ · CS140 Final Winter 2003 Name_____ Page 2 of 22 f (1) (10 points) Your Nachos HW4 project partner adds a weird

CS140 Final Winter 2003 Name____________________

Page 18 of 22f

(17) (8 points) Given an extent-based file system, would increasing the rotation speed of the disk improve: (a) the sequential file access performance? (b) What about the random file access performance? Be sure to justify your answer.

Page 19: CS140 Operating Systems and Systems Programming Final Exam ...€¦ · CS140 Final Winter 2003 Name_____ Page 2 of 22 f (1) (10 points) Your Nachos HW4 project partner adds a weird

CS140 Final Winter 2003 Name____________________

Page 19 of 22f

(18) (7 points) Explain why a best-fit memory allocation policy would be expected to do better than a worse-fit policy?

Page 20: CS140 Operating Systems and Systems Programming Final Exam ...€¦ · CS140 Final Winter 2003 Name_____ Page 2 of 22 f (1) (10 points) Your Nachos HW4 project partner adds a weird

CS140 Final Winter 2003 Name____________________

Page 20 of 22f

(19) (7 points) Why did the BSD 4.3 Unix implementers add an additional hand to their virtual memory clock algorithm? Describe what this hand did.

Page 21: CS140 Operating Systems and Systems Programming Final Exam ...€¦ · CS140 Final Winter 2003 Name_____ Page 2 of 22 f (1) (10 points) Your Nachos HW4 project partner adds a weird

CS140 Final Winter 2003 Name____________________

Page 21 of 22f

(20) (7 points) Describe how the freelist data structure of a file system can be regenerated if it is lost.

Page 22: CS140 Operating Systems and Systems Programming Final Exam ...€¦ · CS140 Final Winter 2003 Name_____ Page 2 of 22 f (1) (10 points) Your Nachos HW4 project partner adds a weird

CS140 Final Winter 2003 Name____________________

Page 22 of 22f

(21) (7 points) Why do CPU scheduling algorithms tend to give high priorities to jobs that need the least amout of CPU?