Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

15 Questions in Final Exam - Operating Systems | CS 471, Exams of Operating Systems

Final Material Type: Exam; Professor: Mukkamala; Class: OPERATING SYSTEMS; Subject: Computer Science; University: Old Dominion University; Term: Spring 2007;

Typology: Exams

Pre 2010

Uploaded on 10/18/2008

koofers-user-nrp
koofers-user-nrp 🇺🇸

10 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS 471 – Final Name__________________________
Exam must be returned to instructor by midnight, Monday, April 30
If you desire, you may fax your exam to the CS office. The number is 757-683-4900.
The exam is open book and open notes, but any work you turn in must be your own. By
submitting this work to the instructor, you are pledging that you neither gave nor
received assistance on this exam.
1. (5 pts) What is the purpose of “magic numbers” in UNIX? What does the OS error
message “bad magic number” mean? How is the same issue addressed in Windows?
2. (5 pts) In UNIX, after a fork() call, how is a child process distinguished from the parent
process? Also, why does a programmer have to worry about this issue?
3. (5 pts) UNIX keeps track of the number of links to a file. Why is this necessary?
4. (10 pts) If deadlock is controlled by the banker's algorithm, which of the following changes
can be made safely? For each explain why or why not.
a. Increase Available
b. Decrease Available
c. Increase Max for one process
d. Decrease Max for one process
e. Increase the number of processes
f. Decrease the number of processes
5. (10 pts) Which of the following programming techniques are “good” for a demand-paged
environment? Which are not good? Justify your answer.
a. Stack
b. Hashed symbol table
c. Sequential search
d. Binary search
6. (5 pts) Why does
cpp prog.cc | cc1 | cc2 | as > prog.o
present a bounded buffer problem?
7. (5 pts) How does a system administrator allow some networked machines to provide rpc,
ftp, or telnet services while keeping others from providing these same services?
1
pf3

Partial preview of the text

Download 15 Questions in Final Exam - Operating Systems | CS 471 and more Exams Operating Systems in PDF only on Docsity!

CS 471 – Final Name__________________________

Exam must be returned to instructor by midnight, Monday, April 30

If you desire, you may fax your exam to the CS office. The number is 757-683-4900. The exam is open book and open notes, but any work you turn in must be your own. By submitting this work to the instructor, you are pledging that you neither gave nor received assistance on this exam.

  1. (5 pts) What is the purpose of “magic numbers” in UNIX? What does the OS error message “bad magic number” mean? How is the same issue addressed in Windows?
  2. (5 pts) In UNIX, after a fork() call, how is a child process distinguished from the parent process? Also, why does a programmer have to worry about this issue?
  3. (5 pts) UNIX keeps track of the number of links to a file. Why is this necessary?
  4. (10 pts) If deadlock is controlled by the banker's algorithm, which of the following changes can be made safely? For each explain why or why not. a. Increase Available b. Decrease Available c. Increase Max for one process d. Decrease Max for one process e. Increase the number of processes f. Decrease the number of processes
  5. (10 pts) Which of the following programming techniques are “good” for a demand-paged environment? Which are not good? Justify your answer. a. Stack b. Hashed symbol table c. Sequential search d. Binary search
  6. (5 pts) Why does cpp prog.cc | cc1 | cc2 | as > prog.o present a bounded buffer problem?
  7. (5 pts) How does a system administrator allow some networked machines to provide rpc, ftp, or telnet services while keeping others from providing these same services?
  1. (5 pts) From a design perspective, rpc calls were intended to be conceptually similar to “normal” function calls within C (or C++). This was to make it easy for programmers to use. In spite of this, rpc calls are more complex that local function calls. Why?
  2. (5 pts) Why might rsh present security problems that telnet would not?
  3. (5 pts) How are port numbers used to provide some OS services?
  4. (5 pts) Consider the following two code fragments from two threads which are part of one process: Thread a; Thread b: b = a + c; a = x + y; Why is this a race condition? Add code to eliminate this problem.
  5. (10 pts) Consider the following implementation of locks. class Lock { int value = FREE; } Lock::Acquire() { Disable interrupts; // Keep dispatcher away while ( value != FREE ) { Enable interrupts; // handle pending interrupts Disable interrupts; } value = BUSY; Enable interrupts; } Lock::Release() { Disable interrupts; value = FREE; Enable interrupts; } a. Explain how this code can fail if it did not disable interrupts. b. This implementation will not work for multiprocessor architecture. Why not? c. This implementation has a very undesirable feature. Rewrite the code to eliminate it.
  6. (5 pts) Consider a paged memory system (with no virtual memory). Suppose memory access time is 40 nanoseconds and that it takes 15 nanoseconds to search the associative memory used to store part of the page table. If the hit rate for this associative memory is 0.98, what is the effective memory access time?