




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





























































































As always,
for my loving and brilliant wife A.
and her constant companion Geoffroi
The Web site at WilliamStallings.com/OS/OS6e.html provides support for instructors and students using the book. It includes the following elements.
Course Support Materials The course support materials include
T
C.6 Writing Assignments 782 C.7 Documentation Projects 783 C.8 BACI and Nachos 783
Chapter 17 Networking
17.1 The Need for a Protocol Architecture 17.2 The TCP/IP Protocol Architecture 17.3 Sockets 17.4 Linux Networking 17.5 Summary 17.6 Recommended Reading and Web Sites 17.7 Key Terms, Review Questions, and Problems Appendix 17A The Trivial File Transfer Protocol
Chapter 18 Distributed Process Management
18.1 Process Migration 18.2 Distributed Global States 18.3 Distributed Mutual Exclusion 18.4 Distributed Deadlock 18.5 Summary 18.6 Recommended Reading 18.7 Key Terms, Review Questions, and Problems
Appendix D The Complexity of Algorithms
Appendix E Standards Organizations
E.1 The Importance of Standards E.2 Standards and Regulation E.3 Standards-Setting Organizations
Appendix F Cryptographic Algorithms
F.1 Symmetric Encryption F.2 Public-Key Cryptography F.3 Secure Hash Functions
Appendix G The International Reference Alphabet
Appendix H BACI: The Ben-Ari Concurrent Programming System
H.1 Introduction H.2 BACI H.3 Examples of BACI Programs H.4 BACI Projects H.5 Enhancements to the BACK System
Appendix I Sockets: A Programmer’s Introduction
I.1 Versions of Sockets I.2 Sockets, Socket Descriptors, Ports, and Connections
PREFACE
OBJECTIVES
This book is about the concepts, structure, and mechanisms of operating systems. Its purpose is to present, as clearly and completely as possible, the nature and characteristics of modern- day operating systems. This task is challenging for several reasons. First, there is a tremendous range and vari- ety of computer systems for which operating systems are designed. These include single-user workstations and personal computers, medium-sized shared systems, large mainframe and supercomputers, and specialized machines such as real-time systems. The variety is not just in the capacity and speed of machines, but in applications and system support requirements. Second, the rapid pace of change that has always characterized computer systems continues with no letup. A number of key areas in operating system design are of recent origin, and re- search into these and other new areas continues. In spite of this variety and pace of change, certain fundamental concepts apply consis- tently throughout. To be sure, the application of these concepts depends on the current state of technology and the particular application requirements. The intent of this book is to pro- vide a thorough discussion of the fundamentals of operating system design and to relate these to contemporary design issues and to current directions in the development of operat- ing systems.
EXAMPLE SYSTEMS
This text is intended to acquaint the reader with the design principles and implementation is- sues of contemporary operating systems. Accordingly, a purely conceptual or theoretical treatment would be inadequate.To illustrate the concepts and to tie them to real-world design choices that must be made, three operating systems have been chosen as running examples:
Windows Vista: A multitasking operating system for personal computers, workstations, and servers. This operating system incorporates many of the latest developments in op- erating system technology. In addition, Windows is one of the first important commer- cial operating systems to rely heavily on object-oriented design principles. This book covers the technology used in the most recent versions of Windows, known as Vista. UNIX: A multiuser operating system, originally intended for minicomputers, but im- plemented on a wide range of machines from powerful microcomputers to supercom- puters. Several flavors of UNIX are included. FreeBSD is a widely used system that incorporates many state-of-the-art features. Solaris is a widely used commercial ver- sion of UNIX. Linux: An open-source version of UNIX that is now widely used. These systems were chosen because of their relevance and representativeness. The dis- cussion of the example systems is distributed throughout the text rather than assembled as a single chapter or appendix. Thus, during the discussion of concurrency, the concurrency
designed to minimize student frustration while providing an interactive teaching expe- rience outside the classroom. With GOAL’s immediate feedback, hints, and pointers that map back to the textbook, students will have a more efficient and effective learn- ing experience. GOAL delivers immediate assessment and feedback via two kinds of assignments: multiple choice Homework exercises and interactive Lab work. All of these support materials are available at the Instructor Resource Center (IRC) for this textbook. To gain access to the IRC, please contact your local Prentice Hall sales repre- sentative via prenhall.com/replocator or call Prentice Hall Faculty Services at 1-800-526-0485.
INTERNET SERVICES FOR INSTRUCTORS AND STUDENTS
There is a Web site for this book that provides support for students and instructors. The site includes links to other relevant sites and a set of useful documents. See the section, “Web Site for Operating Systems: Internals and Design Principles,” preceding this Preface, for more information. The Web page is at http://williamstallings.com/OS/OS6e.html New to this edition is a set of homework problems with solutions publicly available at this Web site. Students can enhance their understanding of the material by working out the solutions to these problems and then checking their answers. An Internet mailing list has been set up so that instructors using this book can ex- change information, suggestions, and questions with each other and with the author. As soon as typos or other errors are discovered, an errata list for this book will be available at WilliamStallings.com. Finally, I maintain the Computer Science Student Resource Site at WilliamStallings.com/StudentSupport.html.
PROJECTS AND OTHER STUDENT EXERCISES
For many instructors, an important component of an OS course is a project or set of projects by which the student gets hands-on experience to reinforce concepts from the text. This book provides an unparalleled degree of support for including a projects component in the course. In the body of the text, two major programming projects are defined. The instructor’s support materials available through Prentice Hall not only includes guidance on how to as- sign and structure the projects but also includes a set of user’s manuals for various project types plus specific assignments, all written especially for this book. Instructors can assign work in the following areas:
In addition, information is provided on two software packages that serve as frameworks for project implementation: Nachos for developing components of an OS, and BACI for study- ing concurrency mechanisms. This diverse set of projects and other student exercises enables the instructor to use the book as one component in a rich and varied learning experience and to tailor a course plan to meet the specific needs of the instructor and students. See Appendix C in this book for details.
ANIMATIONS AND SIMULATIONS
New to this edition is the incorporation of animations and simulations. The animations are set off by this icon. Animations provide a powerful tool for understanding the complex mechanisms of a modern OS. A total of 16 animations are used to illustrate key functions and algorithms in OS design. At the relevant point in the book, an icon indicates that a rele- vant animation is available online for student use. The IRC also provides support for assigning projects based on a set of seven simulations that cover key areas of OS design. The student can use a set of simulation packages to analyze OS design features. The simulators are all written in Java and can be run either locally as a Java application or online through a browser. The IRC includes spe- cific assignments to give to students, telling them specifically what they are to do and what results are expected.
PROGRAMMING PROJECTS
This new edition provides expanded support for programming projects. Two major pro- gramming projects, one to build a shell, or command line interpreter, and one to build a process dispatcher are described in the textbook, after Chapter 3 and after Chapter 9. The IRC provides further information and step-by-step exercises for developing the pro- grams. As an alternative, the instructor can assign a more extensive series of projects that cover many of the principles in the book. The student is provided with detailed instructions for doing each of the projects. In addition, there is a set of homework problems, which in- volve questions related to each project for the student to answer. Finally, the project manual provided at the IRC includes a series of programming pro- jects that cover a broad range of topics and that can be implemented in any suitable lan- guage on any platform.
WHAT’S NEW IN THE SIXTH EDITION
In the four years since the fifth edition of this book was published, the field has seen contin- ued innovations and improvements. In this new edition, I try to capture these changes while maintaining a broad and comprehensive coverage of the entire field. To begin the process of revision, the fifth edition of this book was extensively reviewed by a number of professors who teach the subject and by professionals working in the field. The result is that, in many
Mathias (Utah State University), Shavakant Mishra (University of Colorado), and Richard Reese (Tarleton State University), all of whom reviewed most or all of the book. Thanks also to the people who provided detailed reviews of a one or more chapters: Vijay Nyalpelli, John Traenky, James Hartley, Ajay Kumar (Symantec), Juergen Gross, Ma- neesh Singhal (Unix Kernel Professional in India), Yao Qi, Xie Yubo, Victor Cionca, Nikhil Bhargava, and Marcos Nagamura. I would also like to thank Dave Probert, Architect in the Windows Core Kernel & Archi- tecture team at Microsoft, for the review of the material on Windows Vista and for providing the comparisons of Linux and Vista; Tigran Aivazian, author of the Linux Kernel Internals document, which is part of the Linux Documentation Project, for the review of the material on Linux 2.6; Nick Garnett of eCosCentric, for the review of the material on eCos; and Philip Levis, one of the developers of TinyOS, for the review of the material on TinyOS. Brandon Ardiente and Tina Kouri, both at the Colorado School of Mines, developed the exercises that accompany the animations referenced in the book. Adam Critchley (Universi- ty of Texas at San Antonio) developed the simulation exercises. Matt Sparks (University of Illinois at Urbana-Champaign) adapted a set of programming problems for use with this textbook. Lawrie Brown of the Australian Defence Force Academy produced the material on buffer overflow attacks. Ching-Kuang Shene (Michigan Tech University) provided the ex- amples used in the section on race conditions and reviewed the section. Tracy Camp and Keith Hellman, both at the Colorado School of Mines, developed a new set of homework problems. In addition, Fernando Ariel Gont contributed a number of homework problems; he also pro- vided detailed reviews of all of the chapters. I would also like to thank Bill Bynum (College of William and Mary) and Tracy Camp (Colorado School of Mines) for contributing Appendix G; Steve Taylor (Worcester Poly- technic Institute) for contributing the programming projects and reading/report assignments in the instructor’s manual; and Professor Tan N. Nguyen (George Mason University) for con- tributing the research projects in the instruction manual. Ian G Graham (Griffith University) contributed the two programming projects in the textbook. Oskars Rieksts (Kutztown Uni- versity) generously allowed me to make use of his lecture notes, quizzes, and projects. Finally, I would like to thank the many people responsible for the publication of the book, all of whom did their usual excellent job. This includes my editor Tracy Dunkelberger, her assistant Melinda Hagerty, production manager Rose Kernan, and supplements manager ReeAnne Davies. Also, Jake Warde of Warde Publishers managed the reviews; and Patricia M. Daly did the copy editing.
READER ’S GUIDE
0.1 Outline of This Book
0.2 A Roadmap for Readers and Instructors
0.3 Internet and Web Resources Web Sites for This Book Other Web Sites USENET Newsgroups
CHAPTER