Seventh Edition ABRAHAM SILBERSCHATZ Yale University PETER BAER GALVIN Corporate Technologies, Inc. GREG GAGNE Westminster College WILEY JOHN WILEY & SONS. INC EXECUTIVE EDITOR Bill Zobrist SENIOR PRODUCTION EDITOR Ken Santor COVER DESIGNER Madelyn Lesure COVER ILLUSTRATION Susan St. Cyr TEXT DESIGNER Judy Allan This book was set in Palatino by the author using LaTeX and printed and bound by Von Hoffmann, Inc. The cover was printed by Von Hoffmann, Inc. This book is printed on acid free paper. GO Copyright © 2005 John Wiley & Sons, Inc. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center. 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011. fax (201) 748-6008. To order books or for customer service please, call l(800)-CALL-WILEY (225-5945). ISBN 0-471-69466-5 Printed in the United States of America 10 987654321 To my children, Lemot, Sivan, and Aaron Avi Silberschatz To my wife, Carla, and my children, Given Owen and Maddie Peter Baer Calvin In memory of Uncle Sonny, Robert Jon Heilemcin 1933 — 2004 Greg Gagne [...]... Sharing 397 Chapter 11 11 .1 11. 2 11 .3 11 .4 11 .5 11 .6 11 .7 File-System Interface 10 .6 Protection 402 10 .7 Summary 407 Exercises 408 Bibliographical Notes 409 File-System Implementation File-System Structure 411 File-System Implementation 413 Directory Implementation 419 Allocation Methods 4 21 Free-Space Management 429 Efficiency and Performance 4 31 Recovery 435 11 .8 11 .9 11 .10 11 .11 Log-Structured File... of, 15 8 -15 9 implementation of, 18 4 -18 5 multilevel feedback-queue scheduling of, 16 8 -16 9 multilevel queue scheduling of, 16 6 -16 7 priority scheduling of, 16 2 -16 4 round-robin scheduling of, 16 4 -16 6 shortest-job-first scheduling of, 15 9 -16 2 dispatcher, role of, 15 7 and I/O-CPU burst cycle, 15 4 -15 5 models for, 18 1 -18 5 deterministic modeling, 18 1 -18 2 and implementation, 18 4 -18 5 queueing-netrwork analysis, 18 3... Contents PART ONE Chapter 1 1 .1 1.2 1. 3 1. 4 1. 5 1. 6 1. 7 1. 8 Introduction Operating-System Services 39 User Operating-System Interface 41 System Calls 43 Types of System Calls 47 System Programs 55 Operating-System Design and Implementation 56 Chapter 3 1. 9 1. 10 1. 11 1 .12 1. 13 Protection and Security 26 Distributed Systems 28 Special-Purpose Systems 29 Computing Environments 31 Summary 34 Exercises 36... STUDIES Chapter 21 The Linux System 21. 1 21. 2 21. 3 21. 4 21. 5 21. 6 21. 7 21. 8 21. 9 21. 10 21. 11 21. 12 Linux History 737 Design Principles 742 Kernel Modules 745 Process Management 748 Scheduling 7 51 Memory Management 756 FileSvstems 764 Input and Output 770 Interprocess Communication Network Structure 774 Security 777 Summary 779 Exercises 780 Bibliographical Notes 7 81 Chapter 22 Windows XP 22 .1 22.2 22.3... 12 Mass-Storage Structure 12 .1 Overview of Mass-Storage Structure 4 51 12.2 Disk Structure 454 12 .3 Disk Attachment 455 12 .4 Disk Scheduling 456 12 .5 Disk Management 462 12 .6 Swap-Space Management 466 12 .7 12 .8 12 .9 12 .10 RAID Structure 468 Stable-Storage Implementation 477 Tertiary-Storage Structure 478 Summary 488 Exercises 489 Bibliographical Notes 493 Chapter 13 I/O Systems 13 .1 13.2 13 .3 13 .4 13 .5... interlock, I/O, 3 61- 362 intermachine interface, 642 internal fragmentation, 287, 382 international use, 787 Internet address, 623 Internet Protocol (IP), 584-585 interprocess communication (IPC), 96 -10 2 in client-server systems, 10 8 -11 5 remote method invocation, 11 4 -11 5 remote procedure calls, 11 1 -11 3 sockets, 10 8 -11 1 in Linux, 739, 773-774 Mach example of, 10 5 -10 6 in message-passing systems, 99 -10 2 POSIX... Libraries 13 1 Threading Issues 13 8 Chapter 5 5 .1 5.2 5.3 5.4 5.5 4.5 Operating-System Examples 14 3 4.6 Summary 14 6 Exercises 14 6 Bibliographical Notes 15 1 CPU Scheduling Basic Concepts 15 3 Scheduling Criteria 15 7 Scheduling Algorithms 15 8 Multiple-Processor Scheduling 16 9 Thread Scheduling 17 2 Chapter 6 6 .1 6.2 6.3 6.4 6.5 6.6 Threads 5.6 Operating System Examples 17 3 5.7 Algorithm Evaluation 18 1 5.8 Summary... 6, 511 - 518 procedures supervised by, 517 - 518 I/O system(s), 495^96 application interface, 505- 511 block and character devices, 507-508 blocking and nonblocking I/O, 510 - 511 clocks and timers, 509- 510 network devices, 508-509 hardware, 496-505 direct memory access, 503-504 interrupts, 499-503 polling, 498-499 kernels, 511 - 518 buffering, 512 - 514 caching, 514 data structures, 516 - 517 error handling, 515 ... (kilobyte), 6 Kerberos, 814 kernel(s), 6, 511 - 518 buffering, 512 - 514 caching, 514 data structures, 516 - 517 error handling, 515 I/O scheduling, 511 - 512 and I/O subsystems, 517 - 518 Linux, 743, 744 multimedia systems, 720-722 nonpreemptive, 19 4 -19 5 preemptive, 19 4 -19 5, 7 01 protection, 515 - 516 real-time, 698-700 spooling and device reservation, 514 - 515 task synchronization (in Linux), 753-755 Windows XP, 788-793,... 628 16 .7 16 .8 16 .9 16 .10 Robustness 6 31 Design Issues 633 An Example: Networking 636 Summary 637 Exercises 638 Bibliographical Notes 640 Chapter 17 Distributed File Systems 17 .1 17.2 17 .3 17 .4 17 .5 Background 6 41 Naming and Transparency 643 Remote File Access 646 Stateful Versus Stateless Service 6 51 File Replication 652 17 .6 An Example: AFS 654 17 .7 Summary 659 Exercises 660 Bibliographical Notes 661 . Notes 409 10 .5 File Sharing 397 Chapter 11 File-System Implementation 11 .1 File-System Structure 411 11 .8 Log-Structured File Systems 437 11 .2 File-System Implementation 413 11 .9 NFS 438 11 .3 Directory. Implementation 419 11 .10 Example: The WAFL File System 444 11 .4 Allocation Methods 4 21 11. 11 Summary 446 11 .5 Free-Space Management 429 Exercises 447 11 .6 Efficiency and Performance 4 31 Bibliographical. Systems 29 1. 4 Operating-System Structure 15 1. 12 Computing Environments 31 1.5 Operating-System Operations 17 1. 13 Summary 34 1. 6 Process Management 20 Exercises 36 1. 7 Memory Management 21 Bibliographical