ebook img

The Design of the UNIX Operating System (Prentice-Hall Software Series) PDF

488 Pages·1986·6.538 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview The Design of the UNIX Operating System (Prentice-Hall Software Series)

AT&T `11=n (cid:127) (cid:127)n(cid:127)(cid:127) n THE DESIGN OF THE UNIX ® OPERATING SYSTEM Maurice J. Bach PRENTICE-HALL, INC., Englewood Cliffs, New Jersey 07632 Copyright © 1986 by Bell Telephone Laboratories, Incorporated. Published by Prentice-Hall, Inc. A division of Simon & Schuster Englewood Cliffs, New Jersey 07632 Prentice-Hall Software Series Brian W. Kernighan, Advisor Cover Design Consultant: Sarah Bach UNIX® is a registered trademark of AT&T. DEC, PDP and VAX are trademarks of Digital Equipment Corp. Series 32000 is a trademark of National Semiconductor Corp. ®Ada is a registered trademark of the U.S. Government (Ada Joint Program Office). UNIVAC is a trademark of Sperry Corp. This document was set on an AUTOLOGIC, Inc. APS-5 phototypesetter driven by the TROFF formatter operating under the UNIX system on an AT&T 3B20 computer. The Publisher offers discounts on this book when ordered in bulk quantities. For more information write: Special Sales/College Marketing Prentice-Hall, Inc. College Technical and Reference Division Englewood Cliffs, New Jersey 07632 The author and publisher of this book have used their best efforts in preparing this book. These efforts include the development, research, and testing of the theories and programs to determine their effectiveness. The author and publisher make no warranty of any kind, expressed or implied, with regard to these programs or the documentation contained in this book. The author and publisher shall not be liable in any event for incidental or consequential damages in connection with, or arising out of, the furnishing, performance, or use of these programs. All rights reserved. No part of this book may be reproduced, in any form or by any means, without permission in writing from the publisher Prentice-Hall International (UK) Limited, London Prentice-Hall of Australia Pty. Limited, Sydney Prentice-Hall Canada Inc., Toronto Prentice-Hall Hispanoamericana, S.A., Mexico Prentice-Hall of India Private Limited, New Delhi Prentice-Hall of Japan, Inc., Tokyo Prentice-Hall of Southeast Asia Pte. Ltd., Singapore Editora Prentice-Hall do Brasil, Ltda., Rio de Janeiro To my parents, for their patience and devotion, to my daughters, Sarah and Rachel, for their laughter, to my son, Joseph, who arrived after the first printing, and to my wife, Debby, for her love and understanding. CONTENTS PREFACE (cid:9) xi CHAPTER 1 GENERAL OVERVIEW OF THE SYSTEM (cid:9) 1 1.1 History (cid:9) 1 1.2 System Structure (cid:9) 4 1.3 User Perspective (cid:9) 6 1.4 Operating System Services (cid:9) 14 1.5 Assumptions About Hardware (cid:9) 15 1.6 Summary (cid:9) 18 v (cid:9)(cid:9) CHAPTER 2 INTRODUCTION TO THE KERNEL (cid:9) 19 2.1 Architecture of the UNIX Operating System (cid:9) 19 2.2 Introduction to System Concepts (cid:9) 22 2.3 Kernel Data Structures (cid:9) 34 2.4 System Administration (cid:9) 34 2.5 Summary and Preview (cid:9) 36 2.6 Exercises 37 CHAPTER 3 THE BUFFER CACHE (cid:9) 38 3.1 Buffer Headers (cid:9) 39 3.2 Structure of the Buffer Pool (cid:9) 40 3.3 Scenarios for Retrieval of a Buffer (cid:9) 42 3.4 Reading and Writing Disk Blocks (cid:9) 53 3.5 Advantages and Disadvantages of the Buffer Cache (cid:9) 56 3.6 Summary (cid:9) 57 3.7 Exercises 58 CHAPTER 4 INTERNAL REPRESENTATION OF FILES (cid:9) 60 4.1 Inodes (cid:9) 61 4.2 Structure of a Regular File (cid:9) 67 4.3 Directories (cid:9) 73 4.4 Conversion of a Path Name to an Inode (cid:9) 74 4.5 Super Block (cid:9) 76 4.6 Inode Assignment to a New File (cid:9) 77 4.7 Allocation of Disk Blocks (cid:9) 84 4.8 Other File Types (cid:9) 88 4.9 Summary (cid:9) 88 4.10 Exercises (cid:9) 89 vi (cid:9)(cid:9) CHAPTER 5 SYSTEM CALLS FOR THE FILE SYSTEM (cid:9) 91 5.1 Open (cid:9) 92 5.2 Read (cid:9) 96 5.3 Write (cid:9) 101 5.4 File and Record Locking (cid:9) 103 5.5 Adjusting the Position of File I/0 — LSEEK (cid:9) 103 5.6 Close (cid:9) 103 5.7 File Creation (cid:9) 105 5.8 Creation of Special Files (cid:9) 107 5.9 Change Directory and Change Root (cid:9) 109 5.10 Change Owner and Change Mode (cid:9) 110 5.11 STAT and FSTAT (cid:9) 110 5.12 Pipes 111 5.13 Dup (cid:9) 117 5.14 Mounting and Unmounting File Systems (cid:9) 119 5.15 Link (cid:9) 128 5.16 Unlink (cid:9) 132 5.17 File System Abstractions 138 5.18 File System Maintenance (cid:9) 139 5.19 Summary (cid:9) 140 5.20 Exercises (cid:9) 140 CHAPTER 6 THE STRUCTURE OF PROCESSES (cid:9) 146 6.1 Process States and Transitions (cid:9) 147 6.2 Layout of System Memory (cid:9) 151 6.3 The Context of a Process (cid:9) 159 6.4 Saving the Context of a Process (cid:9) 162 6.5 Manipulation of the Process Address Space (cid:9) 171 6.6 Sleep (cid:9) 182 V" (cid:9)(cid:9) 6.7 Summary (cid:9) 188 6.8 Exercises 189 CHAPTER 7 PROCESS CONTROL (cid:9) 191 7.1 Process Creation (cid:9) 192 7.2 Signals (cid:9) 200 7.3 Process Termination (cid:9) 212 7.4 Awaiting Process Termination (cid:9) 213 7.5 Invoking Other Programs (cid:9) 217 7.6 The User ID of a Process (cid:9) 227 7.7 Changing the Size of a Process (cid:9) 229 7.8 The Shell (cid:9) 232 7.9 System Boot and the INIT Process (cid:9) 235 7.10 Summary (cid:9) 238 7.11 Exercises (cid:9) 239 CHAPTER 8 PROCESS SCHEDULING AND TIME (cid:9) 247 8.1 Process Scheduling (cid:9) 248 8.2 System Calls For Time (cid:9) 258 8.3 Clock (cid:9) 260 8.4 Summary (cid:9) 268 8.5 Exercises 268 CHAPTER 9 MEMORY MANAGEMENT POLICIES (cid:9) 271 9.1 Swapping (cid:9) 272 9.2 Demand Paging (cid:9) 285 9.3 A Hybrid System With Swapping and Demand Paging (cid:9) . . (cid:9) 307 9.4 Summary (cid:9) 307 9.5 Exercises (cid:9) 308 (cid:9)(cid:9) CHAPTER 10 THE I/O SUBSYSTEM (cid:9) 312 10.1 Driver Interfaces (cid:9) 313 10.2 Disk Drivers (cid:9) 325 10.3 Terminal Drivers (cid:9) 329 10.4 Streams (cid:9) 344 10.5 Summary (cid:9) 351 10.6 Exercises (cid:9) 352 CHAPTER 11 INTERPROCESS COMMUNICATION (cid:9) 355 11.1 Process Tracing 356 11.2 System V IPC (cid:9) 359 11.3 Network Communications (cid:9) 382 11.4 Sockets (cid:9) 383 11.5 Summary (cid:9) 388 11.6 Exercises (cid:9) 389 CHAPTER 12 MULTIPROCESSOR SYSTEMS (cid:9) 391 12.1 Problem of Multiprocessor Systems (cid:9) 392 12.2 Solution With Master and Slave Processors (cid:9) 393 12.3 Solution With Semaphores (cid:9) 395 12.4 The Tunis System 410 12.5 Performance Limitations (cid:9) 410 12.6 Exercises (cid:9) 410 CHAPTER 13 DISTRIBUTED UNIX SYSTEMS (cid:9) 412 13.1 Satellite Processors (cid:9) 414 13.2 The Newcastle Connection (cid:9) 422 13.3 Transparent Distributed File Systems (cid:9) 426 13.4 A Transparent Distributed Model Without Stub Processes . (cid:9) 429 ix

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.