CIS332 (Spring 1999)
Principles of Operating Systems;
Professor Franz J. Kurfess
Home page:http://www.cis.njit.edu/franzE-mail:franz@cis.njit.edu
Faculty Assistant: Ning Zhu E-mail:cis332fk@cis.njit.edu
(All questions regarding homework must be sent to this address)
|
Task |
Deadline |
Points |
Student Name: |
|
Background and Prerequisites |
Tuesday, Jan. 26, 1999 |
|
The prerequisite for this course is CIS 114 or equivalent, which is the second
part of "Introduction to Computer Science". You must be familiar with the basic
operation of a computer system, programming concepts like data structures
and algorithms, and practical programming in a programming language like C, C++
or Java.
The following questions are intended to assess your background for this course.
The main goal is to verify that all students in class have the required
background, and I might ask students who perform very badly to drop the class.
1 a). What is the final value of next-count when the following pseudo code is
executed with an initial value of x-count = 0 ?.
|
next-count := 0; |
loop until x-count = 2 |
if x-count < 1 then begin |
next-count := next-count + 1; |
x-count := x-count + 1; |
end; |
end loop; |
b). Explain the execution of the following two C codes. Assume that they are executed
simultaneously and share a common variable turn with an initial value of 0. |
(a). |
|
|
(b). |
while (TRUE) { |
|
|
while (TRUE) { |
while (turn != 0) |
|
|
while (turn != 1) |
critical_section(); |
|
|
critical_section(); |
turn =1; |
|
|
turn =0; |
noncri_section(); |
|
|
noncri_section(); |
} |
|
|
} |
2. If a computer system doesn't have enough main memory (RAM) to store
the instructions and data for the execution of a task, is it
possible for the CPU to fetch instructions or data directly
from the hard disk, without using main memory? Explain
your answer!
3. For a computer system with a 64-bit word length, which of
the following statements describes the largest amount of main memory?
Explain your answer!
a) 250 MBytes
b) 32 million words
c) 256,000 KBytes
d) 32 Mwords
4. List your experiences with the following (List hardware, software etc., you have used).
a). Hardware
b). Operating Systems
c). Application Programming Software