CS307
Midterm
Ondich
Due in class on Monday, May 15, 2000
This exam is open-book, open-notes, open-computer, open-Internet,
but closed-other-people. You may, however, ask Jeff Ondich
questions.
I know they're not all equally easy, but each question is worth 6 points anyway.
Explain your answers, but do so briefly.
- List a few events that would cause an operating system's scheduler
to get called.
- Processes can be scheduled based on a strict priority system.
That is, when each process is launched, it is assigned an integer priority, and
when the scheduler is called for any reason, it runs the unblocked process
whose priority is highest (choosing randomly if there is more than
one highest-priority process).
What are the problems with such a scheduling system? Briefly describe
modifications to strict priority that would address these problems.
- Consider Peterson's solution to the mutual exclusion problem, as
shown in Figure 2-8 on page 37 of Tanenbaum. Suppose you try to modify
it to handle three processes by changing N to 3, and changing enter_region
to look like this:
void enter_region( int process )
{
int other1 = (process+1) % 3;
int other2 = (process+2) % 3;
interested[process] = TRUE;
turn = process;
while( turn == process && (interested[other1] == TRUE || interested[other2] == TRUE) )
{
}
}
Using processes numbered
0, 1, and 2, describe a sequence of events that would cause
a race condition with this version of enter_region.
- Suppose we are using a 2-level page table system in which each second-level
page table takes up exactly one page, and we have a
32-bit virtual address space with 4KB pages and 4 bytes per page table entry.
- How many bytes will each program need to use to store the
first-level page table?
- Assuming that exactly one second-level page table is in
memory and exactly half of its entries are valid, how many
bytes of memory in our virtual address space actually reside
in physical memory?
- Why must the first-level page table always be in memory?
What would happen if it weren't?
- What is spooling, and for what is it commonly used? Where does the
word "spool" come from?
- The UNIX System V-based file system for Linux uses i-nodes that
contain 10 direct block
pointers, 1 single-indirect block pointer, 1 double-indirect block
pointer, and 1 triple-indirect block pointer. If each block is
big enough to hold 1024 32-bit block pointers, what is the maximum
file size?
- Create a UNIX file A. Then create a hard link B to A (using
a "ln A B"), create a soft link C to A ("ln -s A C"), and finally
delete A ("rm A"). Now execute "cat B" and "cat C". What happens
in each case, and why?
- Do problem 9 from Chapter 5 of Tanenbaum.
- Do problem 13 from Chapter 6 of Tanenbaum.
Jeff Ondich,
Department of Mathematics and Computer Science,
Carleton College, Northfield, MN
55057,
(507) 646-4364,
jondich@carleton.edu