INSTRUCTOR’S MANUAL
TO ACCOMPANY
OPERATING-
SYSTEM
CONCEPTS
SEVENTH EDITION
ABRAHAM SILBERSCHATZ
Yale University
PETER BAER GALVIN
Corporate Technologies
GREG GAGNE
Westminster College
Preface
This volume is an instructor’s manual for the Seventh Edition of Operating-
System Concepts, by Abraham Silberschatz, Peter Baer Galvin, and Greg Gagne.
It consists of answers to the exercises in the parent text.
Although we have tried to produce an instructor’s manual that will aid
all of the users of our book as much as possible, there can always be im-
provements (improved answers, additional questions, sample test questions,
programming projects, alternative orders of presentation of the material, addi-
tional references, and so on). We invite you to help us in improving this manual.
If you have better solutions to the exercises or other items which would be of
use with Operating-System Concepts, we invite you to send them to us for con-
sideration in later editions of this manual. All contributions will, of course, be
properly credited to their contributor.
Internet electronic mail should be addressed to os-book@cs.yale.edu.
Physical mail may be sent to Avi Silberschatz, Department nof Computer Sci-
ence, Yale University 51 Prospect Street, New Haven, CT 06520, USA.
A. S.
P. B. G
G. G.
iii
Contents
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Chapter 1
Chapter 2 Operating-System Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Chapter 3
Threads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Chapter 4
CPU Scheduling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Chapter 5
Process Synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Chapter 6
Chapter 7 Deadlocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Chapter 8 Memory Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Chapter 9 Virtual Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
File-Systems Interface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Chapter 10
File-Systems Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Chapter 11
Chapter 12 Mass Storage Structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
I/O Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Chapter 13
Protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Chapter 14
Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Chapter 15
Chapter 16 Network Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Chapter 17 Distributed Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Chapter 18 Distributed-File Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Chapter 19 Multimedia Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
Embedded Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Chapter 20
Chapter 21 The Linux System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Chapter 22 Windows XP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Influential Operating Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Chapter 23
v
1C H A P T E R
Introduction
Chapter 1 introduces the general topic of operating systems and a handful of
important concepts (multiprogramming, time sharing, distributed system, and
so on). The purpose is to show why operating systems are what they are by
showing how they developed. In operating systems, as in much of computer
science, we are led to the present by the paths we took in the past, and we can
better understand both the present and the future by understanding the past.
Additional work that might be considered is learning about the particular
systems that the students will have access to at your institution. This is still just
a general overview, as specific interfaces are considered in Chapter 3.
Exercises
1.1
In a multiprogramming and time-sharing environment, several users
share the system simultaneously. This situation can result in various
security problems.
a. What are two such problems?
b. Can we ensure the same degree of security in a time-shared ma-
chine as in a dedicated machine? Explain your answer.
Answer:
a. Stealing or copying one’s programs or data; using system re-
sources (CPU, memory, disk space, peripherals) without proper
accounting.
b. Probably not, since any protection scheme devised by humans
can inevitably be broken by a human, and the more complex
the scheme, the more difficult it is to feel confident of its correct
implementation.
1
2
Chapter 1 Introduction
1.2 The issue of resource utilization shows up in different forms in differ-
ent types of operating systems. List what resources must be managed
carefully in the following settings:
a. Mainframe or minicomputer systems
b. Workstations connected to servers
c. Handheld computers
Answer:
a. Mainframes: memory and CPU resources, storage, network band-
width.
b. Workstations: memory and CPU resouces
c. Handheld computers: power consumption, memory resources.
1.3 Under what circumstances would a user be better off using a time-
sharing system rather than a PC or single-user workstation?
Answer: When there are few other users, the task is large, and the
hardware is fast, time-sharing makes sense. The full power of the system
can be brought to bear on the user’s problem. The problem can be solved
faster than on a personal computer. Another case occurs when lots of
other users need resources at the same time.
A personal computer is best when the job is small enough to be exe-
cuted reasonably on it and when performance is sufficient to execute the
program to the user’s satisfaction.
1.4 Which of the functionalities listed below need to be supported by the
operating system for the following two settings: (a) handheld devices
and (b) real-time systems.
a. Batch programming
b. Virtual memory
c. Time sharing
Answer: For real-time systems, the operating system needs to support
virtual memory and time sharing in a fair manner. For handheld systems,
the operating system needs to provide virtual memory, but does not
need to provide time-sharing. Batch programming is not necessary in
both settings.
1.5 Describe the differences between symmetric and asymmetric multipro-
cessing. What are three advantages and one disadvantage of multipro-
cessor systems?
Answer: Symmetric multiprocessing treats all processors as equals, and
I/O can be processed on any CPU. Asymmetric multiprocessing has one
master CPU and the remainder CPUs are slaves. The master distributes
tasks among the slaves, and I/O is usually done by the master only.
Multiprocessors can save money by not duplicating power supplies,
housings, and peripherals. They can execute programs more quickly
and can have increased reliability. They are also more complex in both
hardware and software than uniprocessor systems.