Final Exam with Solution - Operating Systems | ECS 150, Exams of Operating Systems

Material Type: Exam; Class: Operating Systems; Subject: Engineering Computer Science; University: University of California - Davis; Term: Fall 2007;

Typology: Exams

Pre 2010

Uploaded on 07/31/2009

koofers-user-f5i
koofers-user-f5i 🇺🇸

10 documents

1 / 17

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
12/13/2007 ecs150 fall 2007, FINAL exam 1
ecs150 fall 2007 final solutions
Name:
Student ID:
Email:
totally 8 questions (2%, 4% or 6% each), 17 pages. (question #1 has 4 possible answers)
Please write precise and clean answers (should be around half to one full page). But, please do not leave it
blank there as I will give partial credits. Please READ the questions VERY CAREFULLY before putting
down the final answer. And, also please mark your answer clearly. You can use the back of the pages.
Every page of this exam book needs to be returned back. Also, while turning in your exam book, please
make sure to SIGN the special sign-up sheet. If you do NOT sign up and in case WE LOSS your exam
book, it will be hard to convince us that you actually turn in the exam book back to us.
If we suspect any cheating behavior, we will pass the case to the academic committee immediately.
Score: ___/32
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Final Exam with Solution - Operating Systems | ECS 150 and more Exams Operating Systems in PDF only on Docsity!

ecs150 fall 2007, FINAL exam

ecs150 fall 2007 final solutions

If we suspect any cheating behavior, we will pass the case to the academic committee immediately.book, it will be hard to convince us that you actually turn in the exam book back to us.make sure to SIGN the special sign-up sheet. If you do NOT sign up and in case WE LOSS your examEvery page of this exam book needs to be returned back. Also, while turning in your exam book, pleasedown the final answer. And, also please mark your answer clearly. You can use the back of the pages.blank there as I will give partial credits. Please READ the questions VERY CAREFULLY before puttingPlease write precise and clean answers (should be around half to one full page). But, please do not leave it totally 8 questions (2%, 4% or 6% each), 17 pages. (question #1 has 4 possible answers)Email:Student ID:Name:

Score: ___

ecs150 fall 2007, FINAL exam

(Soft Update, 4%)

In each of the following diagrams, we have TWO directory blocks and TWO I-Node blocks. The first

(one block write in each step). Also, you MUST draw the dependency arrows in each step (only on the memory side).synchronize the memory/disk step-by-step via completing/marking the diagrams. Hint: we will need FIVE disk writesrow shows the initial values of memory and disk BEFORE the synchronization. Please use the rules of “Soft Update” to

Q-

D

(empty)

D

(empty)

D

(empty)(empty)(empty)

iN(D5)

(empty)(empty) iN(D1)

(empty)(empty) iN(D3)

(empty)

D2 D

(empty)(empty)

(empty)(empty)(empty)

D

(empty) iN(D2)

(empty) iN(D1)

(empty)(empty)(empty) iN(D8)

D

(empty)

D

(empty)

D

(empty)(empty)(empty)

iN(D5)

(empty)(empty) iN(D1)

(empty)(empty) iN(D3)

(empty)

memory

disk

D

(empty)

D

(empty)

D

(empty)(empty)(empty)

iN(D5)

(empty)(empty) iN(D1)

(empty)(empty) iN(D3)

(empty)

D

(empty) (empty) (empty)

iN(D5)

(empty)(empty) iN(D1)

Solution #1/

ecs150 fall 2007, FINAL exam

(Soft Update, 4%)

In each of the following diagrams, we have TWO directory blocks and TWO I-Node blocks. The first

(one block write in each step). Also, you MUST draw the dependency arrows in each step (only on the memory side).synchronize the memory/disk step-by-step via completing/marking the diagrams. Hint: we will need FIVE disk writesrow shows the initial values of memory and disk BEFORE the synchronization. Please use the rules of “Soft Update” to

Q-

D

(empty)

D

(empty)

D

(empty)(empty)(empty)

iN(D5)

(empty)(empty) iN(D1)

(empty)(empty) iN(D3)

(empty)

D2 D

(empty)(empty)

(empty)(empty)(empty)

D

(empty) iN(D2)

(empty) iN(D1)

(empty)(empty)(empty) iN(D8)

D

(empty)

D

(empty)

D

(empty)(empty)(empty)

iN(D5)

(empty)(empty) iN(D1)

(empty)(empty) iN(D3)

(empty)

(empty) (empty)(empty) (empty)

memory

disk

D

(empty)

D

(empty)

D

(empty)(empty)(empty)

iN(D5)

(empty)(empty) iN(D1)

(empty)(empty) iN(D3)

(empty)

Solution #2/

(empty)(empty) iN(D3)

(empty)

ecs150 fall 2007, FINAL exam

memory

disk

D

(empty)

D

(empty)

D

(empty)(empty)(empty)

iN(D5)

(empty)(empty) iN(D1)

(empty)(empty) iN(D3)

(empty)

D

(empty)

D

(empty)

D

(empty)(empty)(empty)

iN(D5)

(empty)(empty) iN(D1)

(empty)(empty) iN(D3)

(empty)

D

(empty)

D

(empty)

D

(empty)(empty)(empty)

iN(D5)

(empty)(empty) iN(D1)

(empty)(empty) iN(D3)

(empty)

D

(empty)

D

(empty)

D

(empty)(empty)(empty)

iN(D5)

(empty)(empty) iN(D1)

(empty)(empty) iN(D3)

(empty)

D

(empty)

D

(empty)

iN(D5)

(empty)(empty) iN(D1)

ecs150 fall 2007, FINAL exam

memory

disk

D

(empty)

D

(empty)

D

(empty)(empty)(empty)

iN(D5)

(empty)(empty) iN(D1)

(empty)(empty) iN(D3)

(empty)

D

(empty)

D

(empty)

D

(empty)(empty)(empty)

iN(D5)

(empty)(empty) iN(D1)

(empty)(empty) iN(D3)

(empty)

D

(empty)

D

(empty)

D

(empty)(empty)(empty)

iN(D5)

(empty)(empty) iN(D1)

(empty)(empty) iN(D3)

(empty)

D

(empty)

D

(empty)

D

(empty)(empty)(empty)

iN(D5)

(empty)(empty) iN(D1)

(empty)(empty) iN(D3)

(empty) (empty)(empty) iN(D3)

(empty)

D

(empty)

D

(empty)

ecs150 fall 2007, FINAL exam

(Soft Update, 4%)

In each of the following diagrams, we have TWO directory blocks and TWO I-Node blocks. The first

(one block write in each step). Also, you MUST draw the dependency arrows in each step (only on the memory side).synchronize the memory/disk step-by-step via completing/marking the diagrams. Hint: we will need FIVE disk writesrow shows the initial values of memory and disk BEFORE the synchronization. Please use the rules of “Soft Update” to

Q-

D

(empty)

D

(empty)

D

(empty)(empty)(empty)

iN(D5)

(empty)(empty) iN(D1)

(empty)(empty) iN(D3)

(empty)

D2 D

(empty)(empty)

(empty)(empty)(empty)

D

(empty) iN(D2)

(empty) iN(D1)

(empty)(empty)(empty) iN(D8)

D

(empty)

D

(empty)

D

(empty)(empty)(empty)

iN(D5)

(empty)(empty) iN(D1)

(empty)(empty) iN(D3)

(empty)

memory

disk

D

(empty)

D

(empty)

D

(empty)(empty)(empty)

iN(D5)

(empty)(empty) iN(D1)

(empty)(empty) iN(D3)

(empty)

Solution #4/

(empty)(empty) iN(D8) iN(D3)

D

(empty)

D

(empty)

ecs150 fall 2007, FINAL exam

(Buddy System, 2%)

After the following operations: allocate(256), allocate(128), allocate(64), allocate(128), release(C,

bitmap array.Please use the next page to draw/represent your answer. Don’t forget -- free list pointers, block labels and sizes, and128), our buddy memory system looks like the following diagram. What will the system look like AFTER release(F, 128)?

Q-

Bitmap (32-Bytes chunks)

0

1023

32

64

128

256

512

Free list

B

C

D

D’

F

E’

F’

1 1 1 1 1 1 1 1 0 0

0 1 1 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0

0

ecs150 fall 2007, FINAL exam

Bitmap (32-Bytes chunks)

0

1023

32

64

128

256

512

Free list

B

C

D

D’

A’

1 1 1 1 1 1 1 1 0 0

0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

0

ecs150 fall 2007, FINAL exam

(Priority Ceiling & Lottery Ticket Sharing, 2%)

Please compare the priority ceiling protocol and the lottery

Priority ceiling guarantees “deadlock-free”, while lottery sharing does not.sharing. Please justify your answer.ticket sharing, and describe ONE CRITICAL PROPERTY supported by priority ceiling but NOT lottery ticket

Q-

ecs150 fall 2007, FINAL exam

(Lottery Scheduling in FreeBSD 5.4, 4%)

In homework assignment #2, we have observed that lottery mode #

integrity of the kernel operations.as a “payback”. This will still maintain the advantage of lottery scheduling and yet protect theprocess will inherit the amount of tickets from the preempting kernel process for a period of timeprocess wins the lottery but must let another kernel process to run, then in the next round, this userNot all, but some kernel processes MUST run regardless the results of lottery. However, if a userOne approach is to define dependency relationship between certain kernel processes and others.kernel activities, and vice versa.)kernel instability. (Hint: please consider in WHAT situations the user time-share processes should preempt thelottery scheduling implementation for FreeBSD kernel (i.e., neither mode 1 nor 2) to avoid any possibility forthe kernel due to incorrect/imperfect interleaving between kernel and user activities. Please describe a different(allowing the Time Share processes to compete with the kernel activities) potentially slows down or even crashes

Q-

ecs150 fall 2007, FINAL exam

(Jouranling, Soft Update, NFS, and AFS, 6%)

You are a software project lead for a major software company,

paradigm of soft update or journaling for the project source filedifferent time zones). You, as the lead, are going to make a couple decisions: (1). Whether you should use thedifferent countries. In other words, all 30 members need to access all the source codes from time to time (maybe inand your team is working on a large software project involving 30 programmers physically distributed in four

dependency

synchronization, assuming you are

ways to approach the issue).This question doesn’t have a standard answer (i.e., you might have many differentsupporting them.should use NFS (a stateless DFS) or AFS (a stateful DFS)? Please describe your decisions and the argumentsusing “make”-like facilities to maintain the dependency relationships among the source files? (2). Whether you

Q-

ecs150 fall 2007, FINAL exam

(Kernel Loadable Modules, 6%)

Kernel loadable module is a very useful facility to flexibly change the

ways to approach the issue).This question doesn’t have a standard answer (i.e., you might have many differentcan do to prevent/avoid/recover/contain the failure internally.assume that the bad code can be injected into the kernel with full authorization, and then we ask what the kernelmerely suggest a stronger authentication/authorization scheme to check whether this is the right administrator. WePlease note that we assume that authorization mechanisms are not dependable. I.e., I will give NO credit if youintroduced by KLD.Please suggest an enhancement to the OS kernel such that we can avoid/prevent/recover from such failurescareless, our kernel will panic in a unpredictable way, which is very undesirable for mission critical applications.programmers of these modules and the administrators with authority to load/unload them into our kernel. Iffunctionalities of the kernel. On the other hand, the correct operations of the kernel with KLD solely depend on the

Q-