当前位置:首页 > 工业技术
UNIX系统内幕
UNIX系统内幕

UNIX系统内幕PDF电子书下载

工业技术

  • 电子书积分:18 积分如何计算积分?
  • 作 者:(美)瓦哈兰(Vahalia,U.)著
  • 出 版 社:北京:人民邮电出版社
  • 出版年份:2003
  • ISBN:7115113009
  • 页数:601 页
图书介绍:本书提供了最新和最全面的UNIX系统技术内幕资料。
《UNIX系统内幕》目录
标签:内幕 系统

1 INTRODUCTION 1

1.1 Introduction 1

1.1.2 The Beginning 2

1.1.1 A Brief History 2

1.1.3 Proliferation 3

1.1.4 BSD 4

1.1.6 Commercialization 5

1.1.5 System Ⅴ 5

1.1.8 Standards 6

1.1.7 Mach 6

1.1.9 OSF and UI 7

1.2 The Mandate for Change 8

1.1.10 SVR4 and Beyond 8

1.2.2 Networking 9

1.2.1 Functionality 9

1.2.4 Hardware Changes 10

1.2.3 Performance 10

1.2.6 Paradigm Shifts 11

1.2.5 Quality Improvement 11

1.2.8 Smallis Beautiful 12

1.2.7 Other Application Domains 12

1.2.9 Flexibility 13

1.3.1 What was Good about UNIX? 14

1.3 Looking Back,Looking Forward 14

1.3.2 What is Wrong with UNIX? 15

1.4 The Scope of this Book 16

1.5 References 17

2.1 Introduction 19

2 THE PROCESS AND THE KERNEL 19

2.2 Mode,Space,and Context 22

2.3 The Process Abstraction 24

2.3.1 Process State 25

2.3.2 Process Context 26

2.3.3 User Credentials 27

2.3.4 The u Area and the proc Structure 28

2.4 Executing in Kernel Mode 30

2.4.2 Interrupt Handling 31

2.4.1 The System Call Interface 31

2.5 Synchronization 33

2.5.2 Interrupts 35

2.5.1 Blocking Operations 35

2.6 Process Scheduling 37

2.5.3 Multiprocessors 37

2.7 Signals 38

2.8.1 forkand exec 39

2.8 New Processes and Programs 39

2.8.3 fork Optimization 41

2.8.2 Process Creation 41

2.8.4 Invoking aNew Program 42

2.8.5 Process Termination 43

2.8.6 Awaiting Process Termination 44

2.10 Exercises 45

2.9 Summary 45

2.8.7 Zombie Processes 45

2.11 References 46

3.1 Introduction 48

3 THREADS AND LIGHTWEIGHT PROCESSES 48

3.1.2 Multiple Threads and Processors 49

3.1.1 Motivation 49

3.2 Fundamental Abstractions 52

3.1.3 Concurrency and Parallelism 52

3.2.2 Lightweight Processes 53

3.2.1 Kernel Threads 53

3.2.3 User Threads 55

3.3.1 Semantics offork 58

3.3 Lightweight Process Design—Issues to Consider 58

3.3.2 Other System Calls 59

3.3.3 Signal Delivery and Handling 60

3.3.5 Stack Growth 61

3.3.4 Visibility 61

3.4.2 Implementing Threads Libraries 62

3.4.1 The Programming Interface 62

3.4 User-Level Threads Libraries 62

3.5 Scheduler Activations 64

3.6.1 Kernel Threads 65

3.6 Multithreading in Solaris and SVR4 65

3.6.2 Lightweight Process Implementation 66

3.6.3 User Threads 67

3.6.5 Interrupt Handling 68

3.6.4 User Thread Implementation 68

3.7.1 The Mach Abstractions—Tasks and Threads 70

3.7 Threads in Mach 70

3.6.6 System Call Handling 70

3.7.2 Mach C-threads 71

3.8.1 The UNIX Interface 72

3.8 Digital UNIX 72

3.8.2 System Calls and Signals 74

3.8.3 The pthreads Library 75

3.9.1 Programming Models 76

3.9 Mach 3.0 Continuations 76

3.9.2 Using Continuations 77

3.9.3 Optimizations 78

3.10 Summary 79

3.9.4 Analysis 79

3.12 References 80

3.11 Exercises 80

4.1 Introduction 83

4 SIGNALS AND SESSION MANAGEMENT 83

4.2.1 Signal Handling 84

4.2 Signal Generation and Handling 84

4.2.3 Typical Scenarios 87

4.2.2 Signal Generation 87

4.2.4 Sleep and Signals 88

4.3 Unreliable Signals 89

4.4.1 Primary Features 90

4.4 Reliable Signals 90

4.4.2 The SVR3 Implementation 91

4.4.3 BSD Signal Management 92

4.5 Signals in SVR4 93

4.6 Signals Implementation 94

4.7 Exceptions 95

4.6.2 Delivery and Handling 95

4.6.1 Signal Generation 95

4.8 Mach Exception Handling 96

4.8.1 Exception Ports 97

4.8.3 Debugger Interactions 98

4.8.2 Error Handling 98

4.9.1 Common Concepts 99

4.9 Process Groups and Terminal Management 99

4.8.4 Analysis 99

4.9.2 The SVR3 Model 100

4.9.3 Limitations 102

4.9.4 4.3BSD Groups and Terminals 103

4.9.5 Drawbacks 104

4.10.1 Motivation 105

4.10 The SVR4 Sessions Architecture 105

4.10.2 Sessions and Process Groups 106

4.10.4 Controlling Terminals 107

4.10.3 Data Structures 107

4.10.5 The 4.4BSD Sessions Implementation 109

4.12 Exercises 110

4.11 Summary 110

4.13 References 111

5.1 Introduction 112

5 PROCESS SCHEDULING 112

5.2 Clock Interrupt Handling 113

5.2.1 Caliouts 114

5.2.2 Alarms 115

5.3 Scheduler Goals 116

5.4 Traditional UNIX Scheduling 117

5.4.1 Process Priorities 118

5.4.2 Scheduler Implementation 119

5.4.3 Run Queue Manipulation 120

5.4.4 Analysis 121

5.5.1 The Class-Independent Layer 122

5.5 The SVR4 Scheduler 122

5.5.2 Interface to the Scheduling Classes 124

5.5.3 The Time-Sharing Class 126

5.5.4 The Real-Time Class 127

5.5.6 Analysis 129

5.5.5 The priocntl System Call 129

5.6 Solaris 2.x Scheduling Enhancements 130

5.6.2 Multiprocessor Support 131

5.6.1 Preemptive Kernel 131

5.6.4 Priority Inversion 133

5.6.3 Hidden Scheduling 133

5.6.5 Implementation of Priority Inheritance 135

5.6.6 Limitations of Priority Inheritance 137

5.6.7 Turnstiles 138

5.7 Scheduling in Mach 139

5.6.8 Analysis 139

5.7.1 Multiprocessor Support 140

5.8 The Digital UNIX Real-Time Scheduler 142

5.9 Other Scheduling Implementations 143

5.8.1 Multiprocessor Support 143

5.9.2 Deadline-Driven Scheduling 144

5.9.1 Fair-Share Scheduling 144

5.9.3 A Three-Level Scheduler 145

5.11 Exercises 146

5.10 Summary 146

5.12 References 147

6.1 Introduction 149

6 INTERPROCESS COMMUNICATIONS 149

6.2.1 Signals 150

6.2 Universal IPC Facilities 150

6.2.2 Pipes 151

6.2.3 SVR4Pipes 152

6.2.4 Process Tracing 153

6.3.1 Common Elements 155

6.3 System Ⅴ IPC 155

6.3.2 Semaphores 156

6.3.3 Message Queues 160

6.3.4 Shared Memory 162

6.3.5 Discussion 164

6.4 Mach IPC 165

6.4.1 Basic Concepts 166

6.5.1 Message Data Structures 167

6.5 Messages 167

6.5.2 Message Passing Interface 169

6.6.2 The Port Data Structure 170

6.6.1 The Port Name Space 170

6.6 Ports 170

6.6.3 Port Translations 171

6.7 Message Passing 172

6.7.1 Transferring Port Rights 173

6.7.2 Out-of-Line Memory 175

6.8 Port Operations 177

6.7.4 Notifications 177

6.7.3 Control Flow 177

6.8.2 Backup Ports 178

6.8.1 Destroying a Port 178

6.8.3 Port Sets 179

6.8.4 Port Interpolation 180

6.9 Extensibility 181

6.10 Mach 3.0 Enhancements 182

6.10.3 User-Reference Counting of Send Rights 183

6.10.2 Mach 3.0 Notifications 183

6.10.1 Send-Once Rights 183

6.11 Discussion 184

6.13 Exercises 185

6.12 Summary 185

6.14 References 186

7.1 Introduction 187

7 SYNCHRONIZATION AND MULTIPROCESSING 187

7.2 Synchronization in Traditional UNIX Kernels 188

7.2.2 Sleep and Wakeup 189

7.2.1 Interrupt Masking 189

7.2.3 Limitations of Traditional Approach 190

7.3.1 Memory Model 191

7.3 Multiprocessor Systems 191

7.3.2 Synchronization Support 193

7.4 Multiprocessor Synchronization Issues 195

7.3.3 Software Architecture 195

7.4.2 The Thundering Herd Problem 196

7.4.1 The Lost Wakeup Problem 196

7.5 Semaphores 197

7.5.2 Event-Wait Using Semaphores 198

7.5.1 Semaphores to Provide Mutual Exclusion 198

7.5.4 Drawbacks of Semaphores 199

7.5.3 Semaphores to Control Countable Resources 199

7.5.5 Convoys 200

7.6 Spin Locks 201

7.6.1 Use of Spin Locks 202

7.7 Condition Variables 203

7.7.1 Implementation Issues 204

7.7.3 Blocking Locks 205

7.7.2 Events 205

7.8.1 Design Considerations 206

7.8 Read-Write Locks 206

7.8.2 Implementation 207

7.10.1 Deadlock Avoidance 209

7.10 Other Considerations 209

7.9 Reference Counts 209

7.10.3 To Block or to Spin 211

7.10.2 Recursive Locks 211

7.10.5 Granularity and Duration 212

7.10.4 What to Lock 212

7.11.1 SVR4.2/MP 213

7.11 Case Studies 213

7.11.2 Digitel UNIX 214

7.11.3 Other Implementations 216

7.13 Exercises 217

7.12 Summary 217

7.14 References 218

8.1 Introduction 220

8 FILE SYSTEM INTERFACE AND FRAMEWORK 220

8.2.1 Files and Directories 221

8.2 The User Interface to Files 221

8.2.2 File Attributes 223

8.2.3 File Descriptors 225

8.2.4 File I/O 227

8.2.6 File Locking 228

8.2.5 Scatter-GatherI/O 228

8.3 File Systems 229

8.3.1 Logical Disks 230

8.4.1 Symbolic Links 231

8.4 Special Files 231

8.5 File System Framework 233

8.4.2 Pipes and FIFOs 233

8.6.1 Objectives 234

8.6 The Vnode/Vfs Architecture 234

8.6.2 Lessons from DeviceI/O 235

8.6.3 Overview ofthe Vnode/Vfs Interface 238

8.7.2 Vnodes and Open Files 240

8.7.1 Objectives 240

8.7 Implementation Overview 240

8.7.3 The Vnode 241

8.7.4 Vnode Reference Count 242

8.7.5 The Vfs Object 243

8.8.1 The Per-File Private Data 244

8.8 File-System-Dependent Objects 244

8.8.2 The vnodeops Vector 245

8.8.3 File-System-Dependent Parts of the Vfs Layer 246

8.9.1 The Virtual File System Switch 247

8.9 Mounting a File System 247

8.9.2 mount Implementation 248

8.10.1 Pathname Traversal 249

8.10 Operations on Files 249

8.9.3 VFS_MOUNT Processing 249

8.10.2 Directory Lookup Cache 250

8.10.3 The VOP_LOOKUP Operation 251

8.10.4 Opening a File 252

8.10.7 User Credentials 253

8.10.6 File Attributes 253

8.10.5 File I/O 253

8.11 Analysis 254

8.11.1 Drawbacks ofthe SVR4 Implementation 255

8.11.2 The 4.4BSD Model 256

8.12 Summary 257

8.11.3 The OSF/1 Approach 257

8.13 Exercises 258

8.14 References 259

9.1 Introduction 261

9 FILE SYSTEM IMPLEMENTATIONS 261

9.2 The System Ⅴ File System(s5fs) 262

9.2.2 Inodes 263

9.2.1 Directories 263

9.2.3 The Superblock 266

9.3.2 Inode Lookup 267

9.3.1 In-Core Inodes 267

9.3 S5fs Kernel Organization 267

9.3.3 File I/O 268

9.3.4 Allocating and Reclaiming Inodes 270

9.4 Analysis of s5fs 271

9.6 Hard Disk Structure 272

9.5 The Berkeley Fast File System 272

9.7.1 Blocks and Fragments 273

9.7 On-Disk Organization 273

9.7.2 Allocation Policies 274

9.8 FFS Functionality Enhancements 275

9.9 Analysis 276

9.10.1 The Memory File System 278

9.10 Temporary File Systems 278

9.10.2 The tmpfs File System 279

9.11.1 The Specfs File System 280

9.11 Special-Purpose File Systems 280

9.11.2 The/proc File System 281

9.11.4 The Translucent File System 283

9.11.3 The Processor File System 283

9.12 The Old Buffer Cache 284

9.12.1 Basic Operation 285

9.12.3 Advantages 286

9.12.2 Buffer Headers 286

9.12.5 Ensuring File System Consistency 287

9.12.4 Disadvantages 287

9.14 Exercises 288

9.13 Summary 288

9.15 References 289

10.1 Introduction 291

10 DISTRIBUTED FILE SYSTEMS 291

10.2.1 Design Considerations 292

10.2 GeneraI Characteristics of Distributed File Systems 292

10.3 Network File System(NFS) 293

10.3.2 Design Goals 294

10.3.1 User Perspective 294

10.3.3 NFS Components 295

10.3.4 Statelessness 297

10.4.1 Extended Data Representation(XDR) 298

10.4 The Protocol Suite 298

10.4.2 Remote Procedure Calls(RPC) 300

10.5 NFS Implementation 301

10.5.2 File Handles 302

10.5.1 Control Flow 302

10.5.4 Pathname Lookup 303

10.5.3 The Mount Operation 303

10.6.1 Open File Permissions 304

10.6 UNIX Semantics 304

10.6.3 Reads and Writes 305

10.6.2 Deletion of Open Files 305

10.7.2 Client-Side Caching 306

10.7.1 Performance Bottlenecks 306

10.7 NFS Performance 306

10.7.3 Deferral ofWrites 307

10.7.4 The Retransmissions Cache 308

10.8.1 The Auspex Functional Multiprocessor Architecture 309

10.8 Dedicated NFS Servers 309

10.8.2 IBM's HA-NFS Server 310

10.9.1 NFS Access Control 312

10.9 NFS Security 312

10.9.3 Root Remapping 313

10.9.2 UID Remapping 313

10.10 NFS Version 3 314

10.12 RFS Architecture 315

10.11 Remote File Sharing(RFS) 315

10.12.1 Remote Message Protocol 316

10.13.1 Remote Mount 317

10.13 RFS Implementation 317

10.12.2 Stateful Operation 317

10.13.2 RFS Clients and Servers 319

10.13.3 Crash Recovery 320

10.14 Client-Side Caching 321

10.13.4 Other Issues 321

10.14.1 Cache Consistency 322

10.15.1 Scalable Architecture 323

10.15 The Andrew File System 323

10.15.2 Storage and Name Space Organization 324

10.15.3 Session Semantics 325

10.16.1 Caching and Consistency 326

10.16 AFS Implementation 326

10.16.3 Security 327

10.16.2 Pathname Lookup 327

10.17 AFS Shortcomings 328

10.18.1 DFS Architecture 329

10.18 The DCE Distributed File System(DCE DFS) 329

10.18.2 Cache Consistency 330

10.18.4 Other DFS Services 332

10.18.3 The Token Manager 332

10.18.5 Analysis 333

10.20 Exercises 334

10.19 Summary 334

10.21 References 335

11.1 Introduction 338

11 ADVANCED FILE SYSTEMS 338

11.2 Limitations of Traditional File Systems 339

11.2.1 FFS Disk Layout 340

11.2.2 Predominance of Writes 341

11.2.4 Crash Recovery 342

11.2.3 Metadata Updates 342

11.3 File System Clustering(Sun-FFS) 343

11.4.1 Basic Characteristics 344

11.4 The Journaling Approach 344

11.5 Log-Structured File Systems 345

11.6 The 4.4BSD Log-Structured File System 346

11.6.2 Data Retrieval 347

11.6.1 Writing the Log 347

11.6.3 Crash Recovery 348

11.6.5 Analysis 349

11.6.4 The Cleaner Process 349

11.7 Metadata Logging 350

11.7.1 Normal Operation 351

11.7.2 Log Consistency 352

11.7.3 Recovery 353

11.7.4 Analysis 354

11.8 The Episode File System 355

11.8.1 Basic Abstractions 356

11.8.2 Structure 357

11.8.4 Other Features 358

11.8.3 Logging 358

11.9 Watchdogs 359

11.9.2 Message Channels 360

11.9.1 Directory Watchdogs 360

11.9.3 Applications 361

11.10 The 4.4BSD Portal File System 362

11.10.1 Using Portals 363

11.11.1 Framework and Interface 364

11.11 Stackable File System Layers 364

11.11.2 The SunSoft Prototype 366

11.12 The 4.4BSD File System Interface 367

11.14 Exercises 368

11.13 Summary 368

11.12.1 The Nullfs and Union Mount File Systems 368

11.15 References 369

12.1 Introduction 372

12 KERNEL MEMORY ALLOCATION 372

12.2.1 Evaluation Criteria 374

12.2 Functional Requirements 374

12.3 Resource Map Allocator 376

12.3.1 Analysis 377

12.4 Simple Power-of-Two Free Lists 379

12.4.1 Analysis 380

12.5 The McKusick-Karels Allocator 381

12.6 The Buddy System 383

12.5.1 Analysis 383

12.6.1 Analysis 385

12.7.1 Lazy Coalescing 386

12.7 The SVR4 Lazy Buddy Algorithm 386

12.7.2 SVR4 Implementation Details 387

12.8.1 Garbage Collection 388

12.8 The Mach-OSF/1 Zone Allocator 388

12.8.2 Analysis 389

12.9 A Hierarchical Allocator for Multiprocessors 390

12.10.1 Object Reuse 392

12.10 The Solaris 2.4 Slab Allocator 392

12.9.1 Analysis 392

12.10.2 Hardware Cache Utilization 393

12.10.4 Design and Interfaces 394

12.10.3 Allocator Footprint 394

12.10.5 Implementation 395

12.10.6 Analysis 396

12.11 Summary 397

12.12 Exercises 398

12.13 References 399

13.1 Introduction 400

13 VIRTUAL MEMORY 400

13.1.1 Memory Management in the Stone Age 401

13.2.1 Functional Requirements 404

13.2 Demand Paging 404

13.2.2 The Virtual Address Space 406

13.2.4 The Swap Area 407

13.2.3 Initial Access to a Page 407

13.2.5 Translation Maps 408

13.2.6 Page Replacement Policies 409

13.3 Hardware Requirements 410

13.3.1 MMU Caches 412

13.3.2 The Intel 80x86 413

13.3.3 The IBM RS/6000 416

13.3.4 The MIPS R3000 419

13.4.1 Physical Memory 421

13.4 4.3BSD—A Case Study 421

13.4.2 The Address Space 423

13.4.3 Where IsthePage? 424

13.4.4 Swap Space 426

13.5.1 Process Creation 427

13.5 4.3BSD Memory Management Operations 427

13.5.2 Page Fault Handling 428

13.5.3 The Free Page List 431

13.5.4 Swapping 432

13.6 Analysis 433

13.7 Exercises 435

13.8 References 436

14.1 Motivation 437

14 THE SVR4 VM ARCHITECTURE 437

14.2 Memory-Mapped Files 438

14.3 VM Design Principles 440

14.2.1 mmap and Related System Calls 440

14.4 Fundamental Abstractions 441

14.4.1 Physical Memory 442

14.4.2 The Address Space 443

14.4.3 Address Mappings 444

14.4.4 Anonymous Pages 445

14.4.5 Hardware Address Translation 446

14.5.1 seg_vn 448

14.5 Segment Drivers 448

14.5.2 seg_map 449

14.5.5 seg_kp 450

14.5.4 seg_kmem 450

14.5.3 seg_dev 450

14.6 The Swap Layer 451

14.7 VM Operations 452

14.7.2 Anonymous Page Handling 453

14.7.1 Creating a New Mapping 453

14.7.4 Sharing Anonymous Pages 455

14.7.3 Process Creation 455

14.7.5 Page Fault Handling 457

14.7.6 Shared Memory 458

14.7.7 Other Components 459

14.8.1 Vnode Interface Changes 460

14.8 Interaction with the Vnode Subsystem 460

14.8.2 Unifying File Access 461

14.8.3 Miscellaneous Issues 463

14.9.2 Virtual Swap Management 464

14.9.1 Extended Swap Space 464

14.9 Virtual Swap Space in Solaris 464

14.10 Analysis 466

14.9.3 Discussion 466

14.11.1 Causes of High Fault Rates 468

14.11 Performance Improvements 468

14.11.2 SVR4 Enhancements to the SunOS VM Implementation 469

14.12 Summary 470

14.11.3 Results and Discussion 470

14.14 References 471

14.13 Exercises 471

15.2 Mach Memory Management Design 473

15.1 Introduction 473

15 MORE MEMORY MANAGEMENT TOPICS 473

15.2.2 Programming Interface 474

15.2.1 Design Goals 474

15.2.3 Fundamental Abstractions 476

15.3.1 Copy-on-Write Sharing 478

15.3 Memory Sharing Facilities 478

15.3.2 Read-Write Sharing 480

15.4.1 Memory Object Initialization 481

15.4 Memory Objects and Pagers 481

15.4.2 Interface between the Kernel and the Pager 482

15.5 External and Internal Pagers 484

15.4.3 Kernel-Pager Interactions 484

15.5.1 A Network Shared Memory Server 485

15.6 Page Replacement 487

15.7 Analysis 489

15.8 Memory Management in 4.4BSD 490

15.9 Translation Lookaside Buffer(TLB)Consistency 492

15.9.1 TLB Consistency on a Uniprocessor 493

15.10 TLB Shootdown in Mach 494

15.9.2 Multiprocessor Issues 494

15.10.1 Synchronization and Deadlock Avoidance 495

15.10.2 Discussion 496

15.11.1 SVR4/MP 497

15.11 TLB Consistency in SVR4 and SVR4.2 UNIX 497

15.11.2 SVR4.2/MP 498

15.11.3 Lazy Shootdowns 499

15.11.5 Discussion 500

15.11.4 Immediate Shootdowns 500

15.12 Other TLB Consistency Algorithms 501

15.13 Virtually Addressed Caches 502

15.13.1 Mapping Changes 504

15.13.3 DMA Operations 505

15.13.2 Address Aliases 505

15.13.4 Maintaining Cache Consistency 506

15.14 Exercises 507

15.13.5 Analysis 507

15.15 References 508

16.2 Overview 511

16.1 Introduction 511

16 DEVICE DRIVERS AND I/O 511

16.2.1 Hardware Configuration 513

16.2.2 Device Interrupts 514

16.3 Device Driver Framework 516

16.3.1 Classifying Devices and Drivers 516

16.3.2 Invoking Driver Code 517

16.3.3 The Device Switches 518

16.3.4 Driver Entry Points 519

16.4 The I/O Subsystem 520

16.4.1 Major and Minor Device Numbers 521

16.4.2 Device Files 522

16.4.3 The specfs File System 523

16.4.4 The Common snode 524

16.4.5 Device Cloning 526

16.4.6 I/O to a Character Device 526

16.5 The poll System Call 527

16.5.1 poll Implementation 528

16.5.2 The 4.3BSD select System Call 529

16.6 Block I/O 530

16.6.1 The buf Structure 531

16.6.2 Interaction with the Vnode 532

16.6.3 Device Access Methods 533

16.6.4 Raw I/O to a Block Device 535

16.7 The DDI/DKI Specification 535

16.7.1 General Recommendations 537

16.7.2 Section 3 Functions 537

16.7.3 Other Sections 538

16.8 Newer SVR4 Releases 539

16.8.1 Multiprocessor-Safe Drivers 540

16.8.2 SVR4.1/ES Changes 540

16.8.3 Dynamic Loading and Unloading 541

16.9 Future Directions 543

16.10 Summary 544

16.11 Exercises 545

16.12 References 545

17 STREAMS 547

17.1 Motivation 547

17.2 Overview 548

17.3 Messages and Queues 551

17.3.1 Messages 551

17.3.2 Virtual Copying 552

17.3.3 Message Types 553

17.3.4 Queues and Modules 554

17.4 Stream I/O 556

17.4.1 The STREAMS Scheduler 557

17.4.2 Priority Bands 558

17.4.3 Flow Control 558

17.4.4 The Driver End 560

17.4.5 The Stream Head 561

17.5 Configuration and Setup 562

17.5.1 Configuring a Module or Driver 562

17.5.2 Opening a Stream 564

17.5.3 Pushing Modules 565

17.5.4 Clone Devices 566

17.6 STREAMS ioctls 566

17.6.1 I_STR ioctl Processing 567

17.6.2 Transparent ioctls 568

17.7 Memory Allocation 568

17.7.1 Extended STREAMS Buffers 570

17.8 Multiplexing 571

17.8.1 Upper Multiplexors 571

17.8.2 Lower Multiplexors 572

17.8.3 Linking Streams 572

17.8.4 Data Flow 574

17.8.5 Ordinary and Persistent Links 575

17.9 FIFOs and Pipes 576

17.9.1 STREAMS FIFOs 576

17.9.2 STREAMS Pipes 577

17.10 Networking Interfaces 578

17.10.1 Transport Provider Interface(TPI) 579

17.10.2 Transport Layer Interface(TLI) 579

17.10.3 Sockets 580

17.10.4 SVR4 Sockets Implementation 582

17.11 Summary 583

17.12 Exercises 584

17.13 References 585

Index 587

返回顶部