OS6 - Solutions Manual !!!!!!!!!!!!!
120 pág.

OS6 - Solutions Manual !!!!!!!!!!!!!


DisciplinaSistemas Operacionais I9.281 materiais183.375 seguidores
Pré-visualização31 páginas
INSTRUCTOR\u2019S MANUAL
TO ACCOMPANY
OPERATING
SYSTEM
CONCEPTS
SIXTH EDITION
ABRAHAM SILBERSCHATZ
Bell Laboratories
PETER BAER GALVIN
Corporate Technologies
GREG GAGNE
Westminster College
Copyright c
2001 A. Silberschatz, P. Galvin and Greg Gagne
PREFACE
This volume is an instructor\u2019s manual for the Sixth 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. In cases where the answer to a question involves a long program, algorithm
development, or an essay, no answer is given, but simply the keywords \u201cNo Answer\u201d are added.
Although we have tried to produce an instructor\u2019s manual that will aid all of the users of our
book as much as possible, there can always be improvements (improved answers, additional
questions, sample test questions, programming projects, alternative orders of presentation of
the material, additional references, and so on). We invite you, both instructors and students, 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
consideration in later editions of this manual. All contributions will, of course, be properly
credited to their contributor.
Internet electronic mail should be addressed to avi@bell-labs.com. Physical mail may be sent
to Avi Silberschatz, Information Sciences Research Center, MH 2T-310, Bell Laboratories, 600
Mountain Avenue, Murray Hill, NJ 07974, USA.
A. S.
P. B. G
G. G.
iii
CONTENTS
Chapter 1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Chapter 2 Computer-System Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Chapter 3 Operating-System Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Chapter 4 Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Chapter 5 Threads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Chapter 6 CPU Scheduling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Chapter 7 Process Synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Chapter 8 Deadlocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Chapter 9 Memory Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Chapter 10 Virtual Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Chapter 11 File-System Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Chapter 12 File-System Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Chapter 13 I/O Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Chapter 14 Mass-Storage Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Chapter 15 Distributed System Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Chapter 16 Distributed File Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Chapter 17 Distributed Coordination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Chapter 18 Protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Chapter 19 Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Chapter 20 The Linux System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Chapter 21 Windows 2000 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Appendix A The FreeBSD System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
Appendix B The Mach System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
v
Chapter 1
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.
Answers to Exercises
1.1 What are the three main purposes of an operating system?
Answer:
\ufffd To provide an environment for a computer user to execute programs on computer
hardware in a convenient and efficient manner.
\ufffd To allocate the separate resources of the computer as needed to solve the problem
given. The allocation process should be as fair and efficient as possible.
\ufffd As a control program it serves two major functions: (1) supervision of the execution of
user programs to prevent errors and improper use of the computer, and (2) manage-
ment of the operation and control of I/O devices.
1.2 List the four steps that are necessary to run a program on a completely dedicated machine.
Answer:
a. Reserve machine time.
b. Manually load program into memory.
c. Load starting address and begin execution.
d. Monitor and control execution of program from console.
1
2 Chapter 1 Introduction
1.3 What is the main advantage of multiprogramming?
Answer: Multiprogramming makes efficient use of the CPU by overlapping the demands
for the CPU and its I/O devices from various users. It attempts to increase CPU utilization
by always having something for the CPU to execute.
1.4 What are the main differences between operating systems for mainframe computers and
personal computers?
Answer: The design goals of operating systems for those machines are quite different.
PCs are inexpensive, so wasted resources like CPU cycles are inconsequential. Resources
are wasted to improve usability and increase software user interface functionality. Main-
frames are the opposite, so resource use is maximized, at the expensive of ease of use.
1.5 In a multiprogramming and time-sharing environment, several users share the system si-
multaneously. 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 machine as we have in a
dedicated machine? Explain your answer.
Answer:
a. Stealing or copying one\u2019s programs or data; using system resources (CPU, memory,
disk space, peripherals) without proper accounting.
b. Probably not, since any protection scheme devised by humans can inevitably be bro-
ken by a human, and the more complex the scheme, the more difficult