操作系统实用教程 螺旋方法 本书采用螺旋方法和深度导向方法讲解操作系统原理。首先介绍一些基本的背景和定义,然后描述一个非常简单的操作系统,之后将它演化为具有更多特性的更复杂的操作系统。这样循序渐进、逐步深入,可以使学生更透彻地理解操作系统的本质。 本书分为六个部分:第一部分介绍一些总体背景信息;第二部分采用螺旋方法,按照复杂度递增的次序,介绍五类操作系统;第三部分到第五部分采用深度导向方法详细地探讨操作系统的各个主题:从进程到内存管理,再到文件系统;第六部分通过三个实例更深入地研究这些系统的特性是如何实现的。 本书特色 对于所讨论的操作系统,书中适当介绍一些当时的行业历史,有时还涉及关键的企业或个人,这样能帮助学生更好地理解操作系统。 涵盖在设备中的现代操作系统,而不仅仅是通常的计算机中的操作系统。 讨论算法级解决方案,而没有列出实际代码,便于使用不同编程语言实现。 每章末都有一些练习题,便于学生巩固所学知识。 作者简介 Ramez Elmasri 得克萨斯大学阿灵顿分校教授。他于1980年在美国斯坦福大学获得计算机科学硕士和博士学位。其研究兴趣是传感器网络和RFID、生物信息介质、查询个性化和系统集成。 A. Gil Carrick 曾执教于得克萨斯大学阿灵顿分校。他是计算机科学荣誉协会Upsilon Pi Epsilon的成员。 David Levine 一直讲授操作系统、软件工程、网络和计算体系结构等课程。他的研究兴趣包括移动计算、移动对象和分布式计算。
Preface viii Par t 1 Operating Systems Overview and Background 1 Chapter 1 Getting Started 3 1.1 Introduction 4 1.2 What Are Operating Systems All about? 5 1.3 User versus System View of an OS 6 1.4 Some OS Terms, Basic Concepts, and Illustrations 10 1.5 A Small Historical Diversion 15 1.6 Summary 17 Chapter 2 Operating System Concepts, Components, and Architectures 19 2.1 Introduction: What Does the OS Do? 20 2.2 Resources Managed by the OS and Major OS Modules 22 2.3 The Process Concept and OS Process Information 25 2.4 Functional Classes of OSs 29 2.5 Architectural Approaches to Building an OS 33 2.6 Some OS Implementation Techniques and Issues 35 2.7 Minimalist versus Maximalist Approaches to OS Functionality and Backward Compatibility 40 2.8 Summary 42 Par t 2 Building Operating Systems Incrementally: A Breadth-Oriented Spiral Approach 45 Chapter 3 A Simple, Single-Process Operating System 47 3.1 Introduction: Monitors and CP/M 48 3.2 Characteristics of a Simple PC System 50 3.3 Input/Output Management 52 3.4 Disk Management and the File System 54 3.5 Process and Memory Management 58 3.6 Summary 63 Chapter 4 A Single-User Multitasking Operating System 67 4.1 Introduction: A Simple Multitasking System 69 4.2 The Palm OS Environment and System Layout 71 4.3 Process Scheduling 73 4.4 Memory Management 75 4.5 File Support 80 4.6 Basic Input and Output 82 elm49810_fm_i-xiv.indd ielm49810_iv 12/17/08 7:45:09 AM Confirming Pages Table of Contents v 4.7 Display Management 82 4.8 Event-Driven Programs 84 4.9 Summary 86 Chapter 5 A Single-User Multitasking/Multithreading Operating System 89 5.1 Introduction 89 5.2 The Origin of the Macintosh Computer 90 5.3 The Macintosh OS-System 1 91 5.4 System 2 96 5.5 System 3 98 5.6 System 4 98 5.7 System 5 100 5.8 System 6 101 5.9 System 7 101 5.10 System 8 105 5.11 System 9 107 5.12 Mac OS X 109 5.13 Summary 111 Chapter 6 A Multiple-User Operating System 113 6.1 Introduction 113 6.2 The Multiuser OS Environment 121 6.3 Processes and Threads 123 6.4 Summary 125 Chapter 7 Parallel and Distributed Computing, Clusters, and Grids 127 7.1 Introduction 127 7.2 Key Concepts 128 7.3 Parallel and Distributed Processing 128 7.4 Distributed System Architectures 132 7.5 How Operating System Concepts Differ in SMPs, Clusters, and Grids 138 7.6 Examples 142 7.7 Summary 147 Par t 3 CPU and Memory Management 149 Chapter 8 Process Management: Concepts, Threads, and Scheduling 151 8.1 Introduction to Processes 152 8.2 Process Descriptor-Process Control Block 152 8.3 Process States and Transitions 154 8.4 Process Scheduling 156 8.5 One Good Process Deserves Another 164 8.6 Threads 166 8.7 Case Studies 173 8.7 Summary 178 Chapter 9 More Process Management: Interprocess Communication, Synchronization, and Deadlocks 181 9.1 Why Have Cooperating Processes? 182 9.2 Interprocess Communication 184 9.3 Synchronization 190 9.4 Deadlocks 197 9.5 Summary 206 Chapter 10 Basic Memory Management 209 10.1 Introduction: Why Manage Primary Memory? 209 10.2 Binding Model: Steps in Development Cycle 210 elm49810_fm_i-xiv.indd v 12/17/08 7:45:10 AM Confirming Pages 10.3 A Single Process 211 10.4 Multiple Processes with a Fixed Number of Processes 216 10.5 Multiple Processes with a Variable Number of Processes 218 10.6 Summary 223 Chapter 11 Advanced Memory Management 225 11.1 Why Do We Need Hardware Help? 225 11.2 Paging 226 11.3 Segmentation 233 11.4 Segmentation with Paging 236 11.5 Demand Paging 238 11.6 Special Memory Management Topics 248 11.7 Summary 252 Par t 4 A Depth-Oriented Presentation of OS Concepts: Files Systems and Input/Output 255 Chapter 12 File Systems-Basics 257 12.1 Introduction 258 12.2 Directories 259 12.3 Access Methods 265 12.4 Free Space Tracking 269 12.5 File Allocation 273 12.6 Summary 280 Chapter 13 File Systems-Examples and More Features 283 13.1 Introduction 283 13.2 Case Studies 284 13.3 Mounting 288 13.4 Multiple File Systems and Redirection 290 13.5 Memory Mapped Files 292 13.6 File System Utilities 293 13.7 Log-Based File Systems 294 13.8 Summary 295 Chapter 14 Disk Scheduling and Input/Output Management 297 14.1 Introduction 297 14.2 Device Characteristics 298 14.3 I/O Technology 299 14.4 Physical Disk Organization 302 14.5 Logical Disk Organization 305 14.6 RAID 309 14.7 Disk Operation Scheduling 314 14.8 DMA and Disk Hardware Features 322 14.9 Summary 325 Par t 5 Networks, Distributed Systems, and Security 329 Chapter 15 Introduction to Computer Networks 331 15.1 Why Do We Want to Network Computers? 332 15.2 The Basics 333 15.3 Application Layer Protocols 338 15.4 TCP/IP 341 15.5 The Data Link Layer 345 15.6 WANs 350 15.7 The Physical Layer 352 15.8 Network Management 354 15.9 Summary 356 Chapter 16 Protection and Security 359 16.1 Introduction: Problems and Threats 360 16.2 OS Protection 366 vi Table of Contents elm49810_fm_i-xiv.indd velm49810_vi 12/17/08 7:45:10 AM