Docsity

CS 323 OS Design Exam, Univ. of Illinois at Urbana-Champaign, Dept. of Comp. Sci. - Prof. , Exams of Computer Science

Partial preview of the text

Download CS 323 OS Design Exam, Univ. of Illinois at Urbana-Champaign, Dept. of Comp. Sci. - Prof. and more Exams Computer Science in PDF only on Docsity!

University of Illinois at Urbana-Champaign Department of Computer S ien e

First Examination CS 323 Op erating System Design Fall, 2002

10-10:50 am Wednesday O tob er 9 1320 Digital Computer Lab oratory

Print your name and ID numb er neatly in the spa e provided b elow; print your name at the upp er right orner of every page.

Name: ID Numb er:

This is an losed b o ok, losed notes exam. You may use al ulators.

Do all parts of all ve problems in this b o oklet. This b o oklet should in lude this title page, plus pages 1-7. Do your work inside this b o oklet, using the ba ks of pages if needed. Problems are of various diÆ ulty degree, hen e if you don't know the answer immediately, progress to the following problem and ome ba k to the unsolved problem later.

Problem S ore Grader 1 2 3 4 5 6

Total

2 Problem - Pro ess S heduling (40 Points)

Consider the workload in Table 1:

Pro ess Burst Time Priority Arrival Time P 1 10ms 3 0ms P 2 5 ms 2 2ms P 3 2ms 1 1ms P 4 3ms 4 4ms

Table 1: Pro ess Workload

  1. (20 Points) Provide s hedule (draw Gantt harts) using preemptive Shortest Job First, and preemptive Priority (a smaller priority numb er implies higher priority) s heduling p oli ies.

Gantt Chart for Preemptive Shortest Job First (use the ab ove table for workload)

Gantt Chart for Preemptive Priority

  1. (10 Points) What is the average waiting time of the ab ove sp e i ed s heduling dis iplines?
  2. (10 Points) What is the turnaround time of all pro esses for the ab ove sp e i ed s heduling dis iplines?

4 Problem - Syn hronization via Message Passing (10 Points)

Let us assume the mailb ox A and the non-blo king 're eive' primitive re v-nonblo k(A,msg) (i.e., if a re eive primitive do es not nd a message in mailb ox A, then it returns NIL as a value and do es not wait for the message).

  1. (5 Points) Write pseudo- o de for the blo king re eive primitive re v-blo k(A,msg) using re v- nonblo k(A,msg) (i.e., if re v-blo k do es not nd any message in mailb ox A, then it waits using busy waiting).
  2. (5 Points) Write pseudo- o de to implement a proto ol with a knowledgement b etween sender and re eiver using send(A,msg), reply(A,a k), re v-blo k(A,msg) primitives.

5 Problem - Virtual Memory (5 Points)

Consider a following virtual address spa e of 1024 pages with 128 words p er page, mapp ed onto a physi al memory of 256 frames. Assume that word is the smallest addressable unit.

 3 Points How many bits are there in the logi al address?

 2 Points How many bits are there in the physi al address?