Operating Systems Exam: Fall 2001 - Layered Approach, Page Replacement, Mutex, Exams of Operating Systems

The comprehensive exam questions for operating systems, held in fall 2001. The exam covers various topics including the layered approach to operating system design, page replacement algorithms, and mutual exclusion algorithms. Questions include explaining callbacks, describing different page replacement algorithms, and analyzing peterson's algorithm.

Typology: Exams

2012/2013

Uploaded on 04/07/2013

seshan_kim55
seshan_kim55 🇮🇳

4.7

(3)

54 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Comprehensive Examination
Operating Systems
Fall 2001
This exam has 4 questions, all of equal value. Answer all the questions to the best of your ability.
For each question, keep you answer on the same page (you may use the other side of the page).
WRITE YOUR ID ON EACH INDIVIDUAL PAGE. Good luck!
1. In the layered approach to operating system design, the system is composed of horizontal
layers where a higher layer can call on the resources of a lower layer, but not vice-versa.
However, in some situations, it may be necessary for a lower layer to initiate the passing of
information up to a higher layer in an unscheduled way, so that it is not simply a question of
constructing a return to a method or procedure call. In order to preserve the integrity of the
layered approach, this is often done using "callbacks". Explain how this works and what the
basic data structures and methods/classes are that are required to support it.
2a. Briefly describe each of the following page replacement algorithms in terms of (1) the page it
chooses to evict, and (2) what information the operating system must keep track of, if any, to
make that choice.
a) Random (RAND)
b) First In First Out (FIFO)
c) Least Recently Used (LRU)
d) Most Recently Used (MRU)
2b. State which page replacement algorithm the operating system should use to best handle the
following applications, and briefly justify your answer.
a) Personal workstation (multiprocessing: mail, text editing, web browsing, applications
with good locality)
b) Web search engine (single application: gigantic hash tables larger than physical
memory, very little locality)
c) Web server (single application: nearly every object on the file system is eventually
accessed, but accesses have excellent locality)
d) Scientific computing (single application: gigantic arrays larger than physical
memory)
e) TiVo, ReplayTV (single application: storing and replaying compressed video files
much larger than physical memory)
f) Palmtop, cell phone (multiprocessing: applications fit entirely in physical memory)
pf2

Partial preview of the text

Download Operating Systems Exam: Fall 2001 - Layered Approach, Page Replacement, Mutex and more Exams Operating Systems in PDF only on Docsity!

Comprehensive Examination

Operating Systems

Fall 2001

This exam has 4 questions, all of equal value. Answer all the questions to the best of your ability. For each question, keep you answer on the same page (you may use the other side of the page). WRITE YOUR ID ON EACH INDIVIDUAL PAGE. Good luck!

  1. In the layered approach to operating system design, the system is composed of horizontal layers where a higher layer can call on the resources of a lower layer, but not vice-versa. However, in some situations, it may be necessary for a lower layer to initiate the passing of information up to a higher layer in an unscheduled way, so that it is not simply a question of constructing a return to a method or procedure call. In order to preserve the integrity of the layered approach, this is often done using "callbacks". Explain how this works and what the basic data structures and methods/classes are that are required to support it.

2a. Briefly describe each of the following page replacement algorithms in terms of (1) the page it chooses to evict, and (2) what information the operating system must keep track of, if any, to make that choice.

a) Random (RAND) b) First In First Out (FIFO) c) Least Recently Used (LRU) d) Most Recently Used (MRU)

2b. State which page replacement algorithm the operating system should use to best handle the following applications, and briefly justify your answer.

a) Personal workstation (multiprocessing: mail, text editing, web browsing, applications with good locality) b) Web search engine (single application: gigantic hash tables larger than physical memory, very little locality) c) Web server (single application: nearly every object on the file system is eventually accessed, but accesses have excellent locality) d) Scientific computing (single application: gigantic arrays larger than physical memory) e) TiVo, ReplayTV (single application: storing and replaying compressed video files much larger than physical memory) f) Palmtop, cell phone (multiprocessing: applications fit entirely in physical memory)

  1. Consider Peterson’s algorithm for two process mutual exclusion: int turn = 0; int in0 = 1, in1 = 1;

process 0: 0.1 while (1) { 0.2 in0 = 1; 0.3 turn = 1; 0.4 while (inl && turn ==1) do; 0.5 critical section 0.6 in0 = 0; 0.7 non-critical section }

process 1: 1.1 while (1) { 1.2 inl = 1; 1.3 turn = 0; 1.4 while (in0 && turn = 0) do ; 1.5 critical section 1.6 inl = 0; 1.7 non-critical section }

a) Suppose that each process sets "turn" to itself (rather than to the other process). That is, line 0.3 is changed to turn = 0 and line 1.3 is changed to turn = 1.

Will this cause the algorithm to violate mutual exclusion? If so, then give an execution in which mutual exclusion is violated. If not, then briefly explain why not.

b) Consider the original algorithm (that is, without line 0.3 and 1.3 changed). Suppose that you run this on a multiprocessor, that does not have sequential consistency. In this multiprocessor, writes to variables are not immediately flushed to (shared) memory but instead can remain for some time in the processor’s data cache.

Will this algorithm continue to ensure mutual exclusion when run on such a multiprocessor? If so, then explain why; if not, then give an execution in which mutual exclusion is violated.

  1. New airport security regulations will likely require that a passenger present a boarding pass prior to proceeding with security screening and enter the boarding area.

(a) Is this a capabilities based or access control list based access control system (authorization to obtain access to security screening/boarding area)? Explain.

(b) What other aspect of the airline checkin procedure is (also?) an access control list based system? Explain.

(c) Explain the difference between authentication and authorization.