Operating System Concepts Essentials, 2nd Edition

3y ago
53 Views
4 Downloads
5.71 MB
782 Pages
Last View : 27d ago
Last Download : 3m ago
Upload by : Emanuel Batten
Transcription

OPERATINGSYSTEMCONCEPTSlsssEaitenSecond EditionAbraham SilberschatzPeter Baer GalvinGreg Gagne

OperatingSystem ConceptsEssential sSecond Edition

This page is intentionally left blank

OperatingSystem ConceptsEssential sSecond EditionABRAHAM SILBERSCHATZYale UniversityPETER BAER GALVINCorporate Technologies, Inc.GREG GAGNEWestminster College

Vice President & Executive PublisherExecutive EditorExecutive Marketing ManagerAssociate Production ManagerCover designerDon FowleyBeth Lang GolubChristopher RuelJoyce PohMadelyn LesureThis book was set in Palatino by the author using LaTeX and printed and bound by Courier Kendallville.The cover was printed by Courier Kendallville. This book is printed on acid free paper.Founded in 1807, John Wiley & Sons, Inc. has been a valued source of knowledge and understanding for morethan 200 years, helping people around the world meet their needs and fulfill their aspirations. Our company isbuilt on a foundation of principles that include responsibility to the communities we serve and where we live andwork. In 2008, we launched a Corporate Citizenship Initiative, a global effort to address the environmental, social,economic, and ethical challenges we face in our business. Among the issues we are addressing are carbon impact,paper specifications and procurement, ethical conduct within our business and among our vendors, and communityand charitable support. For more information, please visit our website: www.wiley.com/go/citizenship.Copyright 2014, 2011 John Wiley & Sons, Inc. All rights reserved. No part of this publication may bereproduced, 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 1976United States Copyright Act, without either the prior written permission of the Publisher, or authorizationthrough payment of the appropriate per-copy fee to the Copyright Clearance Center, Inc. 222 Rosewood Drive,Danvers, MA 01923, website www.copyright.com. Requests to the Publisher for permission should be addressedto the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030-5774, (201)748-6011,fax (201)748-6008, website http://www.wiley.com/go/permissions.Evaluation copies are provided to qualified academics and professionals for review purposes only, for use in theircourses during the next academic year. These copies are licensed and may not be sold or transferred to a thirdparty. Upon completion of the review period, please return the evaluation copy to Wiley. Return instructionsand a free of charge return mailing label are available at www.wiley.com/go/returnlabel. If you have chosen toadopt this textbook for use in your course, please accept this book as your complimentary desk copy. Outside ofthe United States, please contact your local sales representative.Printed in the United States of America10 9 8 7 6 5 4 3 2 1

To my children, Lemor, Sivan, and Aaronand my NicoletteAvi SilberschatzTo my wife, Carla,and my children, Gwen, Owen, and MaddiePeter Baer GalvinTo my wife, Pat,and our sons, Tom and JayGreg Gagne

This page is intentionally left blank

PrefaceOperating systems are an essential part of any computer system. Similarly,a course on operating systems is an essential part of any computer scienceeducation. This field is undergoing rapid change, as computers are nowprevalent in virtually every arena of day-to-day life —from embedded devicesin automobiles through the most sophisticated planning tools for governmentsand multinational firms. Yet the fundamental concepts remain fairly clear, andit is on these that we base this book.We wrote this book as a text for an introductory course in operating systemsat the junior or senior undergraduate level or at the first-year graduate level. Wehope that practitioners will also find it useful. It provides a clear description ofthe concepts that underlie operating systems. As prerequisites, we assume thatthe reader is familiar with basic data structures, computer organization, anda high-level language, such as C or Java. The hardware topics required for anunderstanding of operating systems are covered in Chapter 1. In that chapter,we also include an overview of the fundamental data structures that areprevalent in most operating systems. For code examples, we use predominantlyC, with some Java, but the reader can still understand the algorithms withouta thorough knowledge of these languages.Concepts are presented using intuitive descriptions. Important theoreticalresults are covered, but formal proofs are largely omitted. The bibliographicalnotes at the end of each chapter contain pointers to research papers in whichresults were first presented and proved, as well as references to recent materialfor further reading. In place of proofs, figures and examples are used to suggestwhy we should expect the result in question to be true.The fundamental concepts and algorithms covered in the book are oftenbased on those used in both commercial and open-source operating systems.Our aim is to present these concepts and algorithms in a general setting thatis not tied to one particular operating system. However, we present a largenumber of examples that pertain to the most popular and the most innovativeoperating systems, including Linux, Microsoft Windows, Apple Mac OS X, andSolaris. We also include examples of both Android and iOS, currently the twodominant mobile operating systems.The organization of the text reflects our many years of teaching courses onoperating systems, as well as curriculum guidelines published by the IEEEvii

viiiPrefaceComputing Society and the Association for Computing Machinery (ACM).Consideration was also given to the feedback provided by the reviewers ofthe text, along with the many comments and suggestions we received fromreaders of our previous editions and from our current and former students.Content of This BookThe text is organized in six major parts: Overview. Chapters 1 and 2 explain what operating systems are, whatthey do, and how they are designed and constructed. These chaptersdiscuss what the common features of an operating system are and what anoperating system does for the user. We include coverage of both traditionalPC and server operating systems, as well as operating systems for mobiledevices. The presentation is motivational and explanatory in nature. Wehave avoided a discussion of how things are done internally in thesechapters. Therefore, they are suitable for individual readers or for studentsin lower-level classes who want to learn what an operating system iswithout getting into the details of the internal algorithms. Process management. Chapters 3 through 6 describe the process conceptand concurrency as the heart of modern operating systems. A processis the unit of work in a system. Such a system consists of a collectionof concurrently executing processes, some of which are operating-systemprocesses (those that execute system code) and the rest of which are userprocesses (those that execute user code). These chapters cover methods forprocess scheduling, interprocess communication, process synchronization,and deadlock handling. Also included is a discussion of threads, as wellas an examination of issues related to multicore systems and parallelprogramming. Memory management. Chapters 7 and 8 deal with the management ofmain memory during the execution of a process. To improve both theutilization of the CPU and the speed of its response to its users, thecomputer must keep several processes in memory. There are many differentmemory-management schemes, reflecting various approaches to memorymanagement, and the effectiveness of a particular algorithm depends onthe situation. Storage management. Chapters 9 through 12 describe how mass storage,the file system, and I/O are handled in a modern computer system. Thefile system provides the mechanism for on-line storage of and accessto both data and programs. We describe the classic internal algorithmsand structures of storage management and provide a firm practicalunderstanding of the algorithms used —their properties, advantages, anddisadvantages. Since the I/O devices that attach to a computer vary widely,the operating system needs to provide a wide range of functionality toapplications to allow them to control all aspects of these devices. Wediscuss system I/O in depth, including I/O system design, interfaces, and

Prefaceixinternal system structures and functions. In many ways, I/O devices arethe slowest major components of the computer. Because they represent aperformance bottleneck, we also examine performance issues associatedwith I/O devices. Protection and security. Chapters 13 and 14 discuss the mechanismsnecessary for the protection and security of computer systems. Theprocesses in an operating system must be protected from one another’sactivities, and to provide such protection, we must ensure that onlyprocesses that have gained proper authorization from the operating systemcan operate on the files, memory, CPU, and other resources of the system.Protection is a mechanism for controlling the access of programs, processes,or users to computer-system resources. This mechanism must provide ameans of specifying the controls to be imposed, as well as a means ofenforcement. Security protects the integrity of the information stored inthe system (both data and code), as well as the physical resources of thesystem, from unauthorized access, malicious destruction or alteration, andaccidental introduction of inconsistency. Case studies. Chapter 15 in the text, along with Appendices A and B(which are available on http://www.os-book.com), present detailed casestudies of real operating systems, including Linux, FreeBSD, and Mach.Coverage of Linux is presented throughout this text; however, the casestudies provide much more detail.Operating System EssentialsWe have based Operating System Essentials on the Ninth Edition of OperatingSystem Concepts, published in 2012. Our intention behind developing thisEssentials edition is to provide readers with a textbook that focuses on thecore concepts that underlie contemporary operating systems. By focusing oncore concepts, we believe students are able to grasp the essential features of amodern operating system more easily and more quickly.To achieve this, Operating System Essentials omits the following coveragefrom the Ninth Edition of Operating System Concepts:1. We removed Chapter 7—Deadlocks—and instead offer a detailedoverview of deadlocks in Chapter 6.2. We removed Chapter 16—Virtual Machines.3. We removed Chapter 17—Distributed Systems.4. We removed Chapter 19—Windows 7.5. We removed Chapter 20—Influential Operating Systems.For those that wish to pursue a more comprehensive study of operatingsystems, we refer you to the Ninth Edition of Operating System Concepts, andin the following we describe the changes relevant to that edition.

xPrefaceThe Second EditionAs we wrote this Second Edition of Operating System Concepts Essentials, wewere guided by the recent growth in the following fundamental areas thataffect operating systems:1. Multicore systems2. Mobile computingWe have integrated relevant coverage throughout this new edition To emphasize these topics. Additionally, we have rewritten material in almost everychapter by bringing older material up to date and removing material that is nolonger interesting or relevant.We have also made substantial organizational changes. For example, wehave eliminated the chapter on real-time systems and instead have integratedappropriate coverage of these systems throughout the text. We have reorderedthe chapters on storage management and have moved up the presentationof process synchronization so that it appears before process scheduling. Mostof these organizational changes are based on our experiences while teachingcourses on operating systems.Below, we provide a brief outline of the major changes to the variouschapters: Chapter 1, Introduction, includes updated coverage of multiprocessorand multicore systems, as well as a new section on kernel data structures.Additionally, the coverage of computing environments now includesmobile systems and cloud computing. We also have incorporated anoverview of real-time systems. Chapter 2, Operating-System Structures, provides new coverage of userinterfaces for mobile devices, including discussions of iOS and Android,and expanded coverage of Mac OS X as a type of hybrid system. Chapter 3, Processes, now includes coverage of multitasking in mobileoperating systems, support for the multiprocess model in Google’s Chromeweb browser, and zombie and orphan processes in UNIX. Chapter 4, Threads, supplies expanded coverage of parallelism andAmdahl’s law. It also provides a new section on implicit threading,including OpenMP and Apple’s Grand Central Dispatch. Chapter 5, Process Synchronization (previously Chapter 6), adds a newsection on mutex locks as well as coverage of synchronization usingOpenMP, as well as functional languages. Chapter 6, CPU Scheduling (previously Chapter 5), contains new coverageof the Linux CFS scheduler and Windows user-mode scheduling. Coverageof real-time scheduling algorithms has also been integrated into thischapter. Chapter 7, Main Memory, includes new coverage of swapping on mobilesystems and Intel 32- and 64-bit architectures. A new section discussesARM architecture.

Prefacexi Chapter 8, Virtual Memory, updates kernel memory management toinclude the Linux SLUB and SLOB memory allocators. Chapter 9, Mass-Storage Structure (previously Chapter 11), adds coverageof solid-state disks. Chapter 10, File-System Interface (previously Chapter 9), is updated withinformation about current technologies. Chapter 11, File-System Implementation (previously Chapter 10), isupdated with coverage of current technologies. Chapter 12, I/O, updates technologies and performance numbers, expandscoverage of synchronous/asynchronous and blocking/nonblocking I/O,and adds a section on vectored I/O. Chapter 13, Protection, has no major changes. Chapter 14, Security, has a revised cryptography section with modernnotation and an improved explanation of various encryption methods andtheir uses. The chapter also includes new coverage of Windows 7 security. Chapter 15, The Linux System, has been updated to cover the Linux 3.2kernel.Programming EnvironmentsThis book uses examples of many real-world operating systems to illustratefundamental operating-system concepts. Particular attention is paid to Linuxand Microsoft Windows, but we also refer to various versions of UNIX(including Solaris, BSD, and Mac OS X).The text also provides several example programs written in C andJava. These programs are intended to run in the following programmingenvironments: POSIX. POSIX (which stands for Portable Operating System Interface) represents a set of standards implemented primarily for UNIX-based operatingsystems. Although Windows systems can also run certain POSIX programs,our coverage of POSIX focuses on UNIX and Linux systems. POSIX-compliantsystems must implement the POSIX core standard (POSIX.1); Linux, Solaris,and Mac OS X are examples of POSIX-compliant systems. POSIX alsodefines several extensions to the standards, including real-time extensions(POSIX1.b) and an extension for a threads library (POSIX1.c, better knownas Pthreads). We provide several programming examples written in Cillustrating the POSIX base API, as well as Pthreads and the extensions forreal-time programming. These example programs were tested on Linux 2.6and 3.2 systems, Mac OS X 10.7, and Solaris 10 using the gcc 4.0 compiler. Java. Java is a widely used programming language with a richAPI andbuilt-in language support for thread creation and management. Javaprograms run on any operating system supporting a Java virtual machine(or JVM). We illustrate various operating-system and networking conceptswith Java programs tested using the Java 1.6 JVM.

xiiPreface Windows systems. The primary programming environment for Windowssystems is the Windows API, which provides a comprehensive set of functions for managing processes, threads, memory, and peripheral devices.We supply several C programs illustrating the use of this API. Programswere tested on systems running Windows XP and Windows 7.We have chosen these three programming environments because webelieve that they best represent the two most popular operating-system models—Windows and UNIX/Linux—along with the widely used Java environment.Most programming examples are written in C, and we expect readers to becomfortable with this language. Readers familiar with both the C and Javalanguages should easily understand most programs provided in this text.In some instances—such as thread creation—we illustrate a specificconcept using all three programming environments, allowing the readerto contrast the three different libraries as they address the same task. Inother situations, we may use just one of the APIs to demonstrate a concept.For example, we illustrate shared memory using just the POSIX API; socketprogramming in TCP/IP is highlighted using the Java API.Linux Virtual MachineTo help students gain a better understanding of the Linux system, we providea Linux virtual machine, including the Linux source code, that is available fordownload from the website supporting this text (http://www.os-book.com).This virtual machine also includes a gcc development environment withcompilers and editors. Most of the programming assignments in the bookcan be completed on this virtual machine, with the exception of assignmentsthat require Java or the Windows API.We also provide three programming assignments that modify the Linuxkernel through kernel modules:1. Adding a basic kernel module to the Linux kernel.2. Adding a kernel module that uses various kernel data structures.3. Adding a kernel module that iterates over tasks in a running Linuxsystem.Over time it is our intention to add additional kernel module assignments onthe supporting website.Supporting WebsiteWhen you visit the website supporting this text at http://www.os-book.com,you can download the following resources: Linux virtual machine C and Java source code

Preface xiiiSample syllabiSet of Powerpoint slidesSet of figures and illustrationsFreeBSD and Mach case studiesSet of review questions indexed by sectionSolutions to practice exercisesStudy guide for studentsErrataNotes to InstructorsOn the website for this text, we provide several sample syllabi that suggestvarious approaches for using the text in both introductory and advancedcourses. As a general rule, we encourage instructors to progress sequentiallythrough the chapters, as this strategy provides the most thorough study ofoperating systems. However, by using the sample syllabi, an instructor canselect a different ordering of chapters (or subsections of chapters).In this edition, we have added over sixty new written exercises and overtwenty new programming problems and projects. Most of the new programming assignments involve processes, threads, process synchronization, andmemory management. Some involve adding kernel modules to the Linuxsystem which requires using either the Linux virtual machine that accompaniesthis text or another suitable Linux distribution.Solutions to review questions, written exercises and programming assignments are available to instructors who have adopted this text for theiroperating-system class. To obtain these restricted supplements, contact yourlocal John Wiley & Sons sales representative. You can find your Wiley representative by going to http://www.wiley.com/college and clicking “Who’s myrep?”Notes to StudentsWe encourage you to take advantage of the review questions (availableonline) and practice exercises that appear at the end of each chapter. Thereview q

Westminster College Operating System Concepts Essentials Second Edition. Vice President & Executive Publisher Don Fowley . with some Java, but the reader can still understand the algorithms without . and concurrency as the heart of modern operating systems. Aprocess

Related Documents:

Essentials of Knowledge Management,Bryan Bergeron Essentials of Patents,Andy Gibbs and Bob DeMatteis Essentials of Payroll Management and Accounting,Steven M.Bragg Essentials of Shared Services,Bryan Bergeron Essentials of Supply Chain Management,Michael Hugos Essentials of Trademarks and Unfair Competition,

Cybersecurity Essentials Introduction to Cybersecurity Introduction to IoT Networking Essentials Entrepreneurship Explore Introduction to exciting opportunities in technology. Preparation for entry level positions. Networking CCNP R&S: Switch Route TShoot Digital Essentials IT Essentials NDG Linux Essentials PCAP: Programming Essentials in Python

Essentials of Financial Risk Management, Karen A. Horcher Essentials of Intellectual Property, Paul J. Lerner and Alexander I. Poltorak Essentials of Knowledge Management, Bryan Bergeron Essentials of Patents, Andy Gibbs and Bob DeMatteis Essentials of Payroll Management and Accounting, Steven M. Bragg

ADM SR Glo Horse 50# 29.95 ADM Alliance Nutrition ADM ADM Staystrong MNRL 40# 26.18 ADM Alliance Nutrition ADM AE Book Herbal Remedies Book 3.41 Animal Essentials Animal Essentials AE Colon Rescue (Phytomucil) 1z 9.18 Animal Essentials Animal Essentials AE Colon Rescue (Phytomucil) 4z 28.18 Animal Essentials Animal Essentials . APP Dry Cat .

The INSTANT NOTES series Series Editor: B.D.Hames, School of Biochemistry and Molecular Biology, University of Leeds, Leeds, UK Animal Biology 2nd edition Ecology 2nd edition Genetics 2nd edition Microbiology 2nd edition Chemistry for Biologists 2nd edition Immunology 2nd edition Biochemistry 2nd edition Molecular Biology 2nd edition Neuroscience

4 AWS Training & Services AWS Essentials Training AWS Cloud Practitioner Essentials (CP-ESS) AWS Technical Essentials (AWSE) AWS Business Essentials (AWSBE) AWS Security Essentials (SEC-ESS) AWS System Architecture Training Architecting on AWS (AWSA) Advanced Architecting on AWS (AWSAA) Architecting on AWS - Accelerator (ARCH-AX) AWS Development Training

CISSP Guide to Security Essentials, 2nd Edition Solutions 2 – 1 CISSP Guide to Security Essentials, 2nd Edition Chapter 2 Solutions Review Questions 1. The process of obtaining a subject’s proven identity is known as: a. Enrollment b. Identification c. Authentication d. Authorization 2.

us88685733 agma 1012-f 1990 us88685736 agma 2003-b 1997 us88685805 agma 6110-f 1997 us88685810 agma 9004-a 1999 us88685815 agma 900-e 1995 de88686925 tgl 18790/01 1972-09 de88686928 tgl 18791/01 1982-06 de88686929 tgl 18791/02 1983-07 us88687101 a-a-20079 2002-08-20 us88687113 a-a-50800 1981-04-23 us88687199 a-a-59173 1998-03-04 us88687222 a-a-55106 1992-07-15 us88687243 a-a-20155 1992-11-16 .