6.4 The first known correct software solution to the critical-section problem for n processes
with a lower bound on waiting of n 1 turns, was presented by Eisenberg and McGuire.
The processes share the following variables:
var flag: array [0.n-1] of (idle
10.21 What is a general graph?
Answer: A tree structure where links can go from one branch to a node earlier in the same
branch or other branch, allowing cycles.
10.22 What problems arise if the directory structure is a general graph?
Answer: Searching fo
13.12 Why is it important to balance file system I/O among the disks and controllers on a system
in a multitasking environment?
Answer: A system can only perform at the speed of its slowest bottleneck. Disks or disk
controllers are frequently the bottlene
8.18 In the IBM/370, memory protection is provided through the use of keys. A key is a 4-bit
quantity. Each 2K block of memory has a key (the storage key) associated with it. The CPU
also has a key (the protection key) associated with it. A store operatio
19.4 The RC 4000 system (and other systems) have defined a tree of processes (called a process
tree) such that all the descendants of a process are given resources (objects) and access
rights by their ancestors only. Thus, a descendant can never have the
The internal data structures and algorithms used by the operating system to implement this
interface. We also discuss the lowest level of the file system the secondary storage structure.
We first describe disk-head-scheduling a
What if a holographic storage drive were invented? Suppose that a holographic drive costs
$10,000 and has an average access time of 40 milliseconds. Suppose that it uses a $100
cartridge the size of a CD. This cartridge holds 40,000 images, and each image
9.8 Consider a demand-paging system with the following time-measured utilizations:
Which (if any) of the following will (probably) improve CPU utilization? Explain your
a. Install a faster CPU.
b. Install a bigger paging disk.
c. Increase the degr
10.21 What is a file path name?
Answer: A list of the directories, subdirectories, and files we must traverse to reach a file
from the root directory.
10.22 If we use the two-level directory, how do we access common files and programs, like
9.12 Suppose that we want to use a paging algorithm that requires a reference bit (such as
second-chance replacement or working-set model), but the hardware does not provide one.
Sketch how we could simulate a reference bit even if one were not provided b
13.8 Requests are not usually uniformly distributed. For example, a cylinder containing the file
system FAT or inodes can be expected to be accessed more frequently than a cylinder that
only contains files. Suppose that you know that 50 percent of the req
10.8 Give an example of an application in which data in a file should be accessed in the following order:
a. Print the content of the file.
b. Print the content of record i. This record can be found using hashing or ind
9.1 Why is there a valid/invalid bit? Where is it kept?
Answer: To indicate whether an address is invalid, or a page is swapped out. It is kept in
the page-frame table.
9.2 What is a page fault?
Answer: An interrupt caused by program needing a specific pa
10.2 Similarly, some systems support many types of structures for a file's data, while others
simply support a stream of bytes. What are the advantages and disadvantages? Answer:
10.3 What are the advantages and disadvantages of recording the n
6.16 Write a monitor that implements an alarm clock that enables a calling program to delay
itself for a specified number of time units (ticks). You may assume the existence of a real
hardware clock, which invokes a procedure tick in your monitor at regul
6.17 Explain the purpose of the checkpoint mechanism. How often should checkpoints be performed? How does the frequency of checkpoints affect:
System performance when no failure occurs?
The time it takes to recover from a system crash? The
time it takes t
10.12 Consider a system that supports 5000 users. Suppose that you want to allow 4990 of these
users to be able to access one file.
a. How would you specify this protection scheme in UNIX?
b. Could you suggest another protection scheme that can be used mo
First we describe the types of storage devices used for tertiary storage. Next, we discuss the
issues that arise when an operating system uses tertiary storage. Finally, we consider some
performance aspects of tertiary storage s
11.7 Why is it advantageous for the user for an operating system to dynamically allocate its
internal tables? What are the penalties to the operating system for doing so?
Answer: Dynamic tables allow more flexibility in system use growth tables are never
10.9 How can an index file be used to speed up the access in direct-access files?
Answer: Have an index in memory; the index gives the key and the disk location of its
corresponding record. Scan the index to find the record you want, and then access it
Virtual memory can be a very interesting subject since it has so many different aspects: page
faults, managing the backing store, page replacement, frame allocation, thrashing, page size. The
objectives of this chapter are to explain these
11.7 One problem with contiguous allocation is that the user must preallocate enough space for
each file. If the file grows to be larger than the space allocated for it, special actions must
be taken. One solution to this problem is to define a file struc
8.1 What is the advantage of dynamic loading?
Answer: Routines that are never used are never loaded; thus more free memory.
8.2 What is a relocation register?
Answer: A base register used to give the lowest physical address for a process.
8.3 List two way
Factors to consider when designing a file
The key attribute or field (primary key) This is a field in a file that
contains unique values for each record in the file. This attribute is
usually used to sort and identify records in a file.
Type of dat
11.3 What problems could occur if a system allowed a file system to be mounted simultaneously at more than one location?
Answer: There would be multiple paths to the same file, which could confuse users or
encourage mistakes (deleting a file with one path
The role of the operating system in computer I/O is to manage and control I/O operations and I/O
devices. Although related topics appear in other chapters, here we bring together the pieces to
paint a complete picture. In this chapter we descr
13.18 Discuss the relative merits of sector sparing and sector slipping.
13.1 What is a sector? track? cylinder?
Sector smallest block that can be read or written on a disk.
Track collection of sectors all on same circumference on
12.1 Consider the following I/O scenarios on a single-user PC.
a. A mouse used with a graphical user interface
b. A tape drive on a multitasking operating system (assume no device preallocation is
c. A disk drive containing user files
d. A grap
9.13 Segmentation is similar to paging, but uses variable-sized pages. Define two
segment-replacement algorithms based on FIFO and LRU page-replacement
schemes. Remember that since segments are not the same size, the segment that is
chosen to be replaced
14.9 Suppose that we agree that 1 kilobyte is 1024 bytes, 1 megabyte is 1024 2 bytes, and 1
gigabyte is 10243 bytes. This progression continues through terabytes, petabytes, and
exabytes (10246). Scientists estimate that a few enormous geological and astr
9.12 What is page replacement?
Answer: Selecting a frame (preferably not in use) as a victim; swap it out; swap in the
desired page into this frame; restarting program.
9.13 How many swaps are needed for pure page replacement?
Answer: Two: first one out,
14.2 In a disk jukebox, what would be the effect of having more open files than the number of
drives in the jukebox?
Answer: Two bad outcomes could result. One possibility is starvation of the applications
that issue blocking I/Os to tapes that are not mo
11.1 Explain first-fit, best-fit, and worst-fit methods of allocating space for contiguous files.
First-fit: Scan available blocks of disk for successive free sectors; use the first area
found that has sufficient space; do not scan beyond that poi
13.6 Write a monitor-type program (see Chapter 6) for disk scheduling using the SCAN and CSCAN disk-scheduling algorithms.
Answer: We provide only the solution for C-SCAN.
type diskhead = monitor var
headpos, count: integer;
8.23 How many frames are needed for each page?
8.24 How much fragmentation occurs with paging? Which type?
Answer: On the average, one-half of last page in each job; this is internal fragmentation.
8.25 In what order are the frames assigned?