ebook img

Operating systems: design and implementation PDF

1071 Pages·2006·3.474 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 Operating systems: design and implementation

OPERATING SYSTEMS DESIGN AND IMPLEMENTATION Third Edition This page intentionally left blank OPERATING SYSTEMS DESIGN AND IMPLEMENTATION Third Edition ANDREW S. TANENBAUM Vrije Universiteit Amsterdam, The Netherlands ALBERT S. WOODHULL Amherst, Massachusetts Upper Saddle River, New Jersey 07458 Library of Congress Cataloging in Publication Data Tanenbaum, Andrew S. Operating Systems: Design and Implementation / Andrew S. Tanenbaum, Albert S. Woodhull. -- 3rd ed. ISBN: 0-13-142938-8 1. Operating systems (Computers) I. Woodhull, Albert S. II. Title QA76.76.O63T36 2006 005.4’3--dc22 Vice President and Editorial Director, ECS: Marcia J. Horton Executive Editor: Tracy Dunkelberger Editorial Assistant: Christianna Lee Executive Managing Editor: Vince O'Brien Managing Editor: Camille Trentacoste Director of Creative Services: Paul Belfanti Art Director and Cover Manager: Heather Scott Cover Design and Illutsration: Tamara Newnam Managing Editor, AV Management and Production: Patricia Burns Art Editor: Gregory Dulles Manufacturing Manager, ESM: Alexis Heydt-Long Manufacturing Buyer: Lisa McDowell Executive Marketing Manager: Robin O'Brien Marketing Assistant: Barrie Reinhold © 2006, 1997, 1987 by Pearson Education, Inc. Pearson Prentice Hall Pearson Education, Inc. Upper Saddle River, NJ 07458 All rights reserved. No part of this book may be reproduced in any form or by any means, without permission in writ- ing from the publisher. Pearson Prentice Hall® is a trademark of Pearson Education, Inc. The authors 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 authors and pub- lisher make no warranty of any kind, expressed or implied, with regard to these programs or to the documentation contained in this book. The authors and publisher shall not be liable in any event for incidental or consequential dam- ages 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. Printed in the United States of America 10 9 8 7 6 5 4 3 2 1 ISBN 0-13-0-13-142938-8 Pearson Education Ltd., London Pearson Education Australia Pty. Ltd., Sydney Pearson Education Singapore, Pte. Ltd. Pearson Education North Asia Ltd., Hong Kong Pearson Education Canada, Inc., Toronto Pearson Educación de Mexico, S.A. de C.V. Pearson Education-Japan, Tokyo Pearson Education Malaysia, Pte. Ltd. Pearson Education, Inc., Upper Saddle River, New Jersey To Suzanne, Barbara, Marvin, and the memory of Sweetie π andBram - AST To Barbara andGordon - ASW The MINIX 3Mascot Other operating systems have an animal mascot, so we felt MINIX 3 ought to have one too. We chose the raccoon because raccoons are small, cute, clever, agile, eat bugs, and are user-friendly—at least if you keep your garbage can well locked. This page intentionally left blank CONTENTS PREFACE xiv 1 INTRODUCTION 1 1.1WHAT ISANOPERATING SYSTEM? 4 1.1.1TheOperating System asanExtended Machine 4 1.1.2TheOperating System asaResource Manager 5 1.2HISTORY OFOPERATING SYSTEMS 6 1.2.1TheFirst Generation (1945–55)Vacuum Tubes andPlugboards 7 1.2.2TheSecondGeneration (1955–65)Transistors andBatch Systems 7 1.2.3TheThirdGeneration (1965–1980)ICsandMultiprogramming 9 1.2.4TheFourthGeneration (1980–Present)Personal Computers 14 1.2.5HistoryofMINIX3 16 1.3OPERATING SYSTEM CONCEPTS 19 1.3.1Processes 20 1.3.2Files 22 1.3.3TheShell 25 1.4SYSTEM CALLS 26 1.4.1System Calls forProcess Management 27 1.4.2System Calls forSignaling 31 1.4.3System Calls forFile Management 33 1.4.4System Calls forDirectory Management 38 1.4.5System Calls forProtection 40 1.4.6System Calls forTime Management 42 vii viii CONTENTS 1.5OPERATING SYSTEM STRUCTURE 42 1.5.1MonolithicSystems 42 1.5.2Layered Systems 45 1.5.3Virtual Machines 46 1.5.4Exokernels 49 1.5.5Client-Server Model 49 1.6OUTLINE OFTHE REST OFTHIS BOOK 51 1.7SUMMARY 51 2 PROCESSES 55 2.1INTRODUCTIONTOPROCESSES 55 2.1.1TheProcess Model 56 2.1.2Process Creation 57 2.1.3Process Termination 59 2.1.4Process Hierarchies 60 2.1.5Process States 60 2.1.6Implementation ofProcesses 62 2.1.7Threads 64 2.2INTERPROCESS COMMUNICATION 2.2.1RaceConditions 69 2.2.2CriticalSections 70 2.2.3Mutual Exclusion withBusyWaiting 71 2.2.4Sleep andWakeup 76 2.2.5Semaphores 78 2.2.6Mutexes 81 2.2.7Monitors 81 2.2.8Message Passing 85 2.3CLASSICAL IPCPROBLEMS 88 2.3.1TheDiningPhilosophersProblem 89 2.3.2TheReaders andWriters Problem 92 2.4SCHEDULING 93 2.4.1IntroductiontoScheduling 94 2.4.2Scheduling inBatch Systems 99 2.4.3Scheduling inInteractive Systems 102 2.4.4Scheduling inReal-Time Systems 109 2.4.5Policy versus Mechanism 110 2.4.6Thread Scheduling 110 CONTENTS ix 2.5OVERVIEW OFPROCESSES INMINIX 3 112 2.5.1TheInternal Structure ofMINIX3 112 2.5.2Process Management inMINIX3 116 2.5.3Interprocess Communication inMINIX3 120 2.5.4Process Scheduling inMINIX3 122 2.6IMPLEMENTATION OFPROCESSES INMINIX 3 125 2.6.1Organization oftheMINIX3Source Code 125 2.6.2CompilingandRunniingMINIX3 128 2.6.3TheCommonHeader Files 130 2.6.4TheMINIX3Header Files 138 2.6.5Process Data Structures andHeader Files 146 2.6.6Bootstrapping MINIX3 156 2.6.7System Initialization 160 2.6.8Interrupt Handling inMINIX3 167 2.6.9Interprocess Communication inMINIX3 178 2.6.10Scheduling inMINIX3 182 2.6.11Hardware-Dependent Kernel Support 185 2.6.12UtilitiesandtheKernel Library 190 2.7THE SYSTEM TASK INMINIX 3 192 2.7.1Overview oftheSystem Task 194 2.7.2Implementation oftheSystem Task 197 2.7.3Implementation oftheSystem Libarary 200 2.9THE CLOCK TASK INMINIX 3 204 2.8.1Clock Hardware 204 2.8.2Clock Software 206 2.8.3Overview oftheClock Driver inMINIX3 208 2.8.4Implementation oftheClock Driver inMINIX3 212 2.9SUMMARY 214 3 INPUT/OUTPUT 221 3.1PRINCIPLES OFI/OHARDWARE 222 3.1.1I/ODevices 223 3.1.2Device Controllers 3.1.3Memory-Mapped I/O 225 3.1.4Interrupts 226 3.1.5Direct Memory Access 227

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.