McKusick - Design and Implementation of the 4.4 BSD Operating System - Part 1 [UNIX] (AW, 1996).pdf

(3218 KB) Pobierz
29871001 UNPDF
Contents
Part 1 Overview
1
Chapter 1 History and Goals
1.1 History of the UNIX System
3
3
Origins 3
Research UNIX 4
AT&T UNIX System III and System V
Other Organizations 8
Berkeley Software Distributions
8
UNIX in the World 10
1.2 BSD and Other Systems 10
The Influence of the User Community
1.3 Design Goals of 4BSD
11
12
4.2BSD Design Goals
13
4.3BSD Design Goals
14
4.4BSD Design Goals
15
1.4 Release Engineering
16
References
17
Chapter 2 Design Overview of 4.4BSD
2.1 4.4BSD Facilities and the Kernel
21
21
The Kernel 22
2.2 Kernel Organization
23
2.3 Kernel Services 25
2.4 Process Management
26
Signals 27
Process Groups and Sessions
28
2.5 Memory Management 29
BSD Memory-Management Design Decisions
29
xvii
29871001.002.png
Memory Management Inside the Kernel
31
Resource Limits 70
Filesystem Quotas 70
3.9 System-Operation Services
Accounting
2.6 I/O System 31
Descriptors and I/O
71
32
71
Descriptor Management
33
Exercises
72
Devices 34
Socket IPC 35
Scatter/Gather I/O 35
Multiple Filesystem Support
References
73
36
75
2.7 Filesystems 36
2.8 Filestores 40
2.9 Network Filesystem
Part 2 Processes
41
Chapter 4 Process Management
4. 1 Introduction to Process Management
Multiprogramming
77
2.10 Terminals 42
2.11 Interprocess Communication
43
77
78
2.12 Network Communication
44
Scheduling 79
Process State 80
The Process Structure
2.13 Network Implementation
44
4.2
2.14 System Operation
45
8 1
Exercises
45
The User Structure
85
References
46
4.3
Context Switching
87
Process State 87
Low-Level Context Switching
Voluntary Context Switching
Synchronization 91
Process Scheduling 92
Calculations of Process Priority
Process-Priority Routines 95
Process Run Queues and Context Switching
Process Creation
Chapter 3 Kernel Services
3.1 Kernel Organization
49
88
88
49
System Processes
49
System Entry 50
Run-Time Organization
4.4
93
50
Entry to the Kernel
52
96
Return from the Kernel
53
3.2 System Calls 53
Result Handling 54
Returning from a System Call
4.5
4.6
4.7
98
Process Termination
99
54
Signals 100
Comparison with POSIX Signals
Posting of a Signal 104
Delivering a Signal 106
Process Groups and Sessions
Sessions 109
Job Control 110
Process Debugging
Exercises
103
3.3 Traps and Interrupts
55
Traps 55
I/O Device Interrupts 55
Software Interrupts 56
3.4 Clock Interrupts 57
Statistics and Process Scheduling
4.8
107
58
112
Timeouts 58
3.5 Memory-Management Services
4.9
60
114
3.6 Timing Services
63
References
116
Real Time 63
Adjustment of the Time
63
Chapter 5 Memory Management
5.1 Terminology 117
Processes and Memory
117
External Representation
64
Interval Time 64
3.7 User, Group, and Other Identifiers
65
118
Paging 119
Replacement Algorithms
Host Identifiers 67
Process Groups and Sessions
68
120
Working-Set Model
121
3.8 Resource Services
68
Swapping 121
Advantages of Virtual Memory
Process Priorities
69
122
Resource Utilization
69
29871001.003.png
5.2
5.3
Hardware Requirements for Virtual Memory 122
Overview of the 4.4BSD Virtual-Memory System
Kernel Memory Management
123
191
126
Part 3 I/O System
Chapter 6 I/O System Overview
6.1 I/O Mapping from User to Device
Device Drivers 195
I/O Queueing 195
Interrupt Handling 196
Block Devices 196
Entry Points for Block-Device Drivers
Sorting of Disk I/O Requests
Kernel Maps and Submaps 127
Kernel Address-Space Allocation
Kernel Malloc 129
Per-Process Resources 132
4.4BSD Process Virtual-Address Space
Page-Fault Dispatch
128
193
5.4
193
132
134
Mapping to Objects
134
Objects 136
Objects to Pages
6.2
197
137
5.5
Shared Memory
137
198
Disk Labels 199
Character Devices 200
Raw Devices and Physical I/O 201
Character-Oriented Devices 202
Entry Points for Character-Device Drivers
Descriptor Management and Services
Open File Entries 205
Management of Descriptors
Mmap Model 139
Shared Mapping 141
Private Mapping 142
Collapsing of Shadow Chains
Private Snapshots 145
Creation of a New Process
Reserving Kernel Resources
Duplication of the User Address Space
Creation of a New Process Without Copying
Execution of a File 150
Process Manipulation of Its Address Space
Change of Process Size
6.3
144
203
205
5.6
146
147
6.4
207
148
File-Descriptor Locking 209
Multiplexing I/O on Descriptors
5.7
5.8
149
211
151
Implementation of Select 213
Movement of Data Inside the Kernel
The Virtual-Filesystem Interface
Contents of a Vnode 219
Vnode Operations 220
Pathname Translation 222
Exported Filesystem Services 222
Filesystem-Independent Services
The Name Cache 225
Buffer Management 226
Implementation of Buffer Management
Stackable Filesystems
216
218
151
File Mapping 152
Change of Protection 154
Termination of a Process
6.5
5.9
154
5.10 The Pager Interface
Vnode Pager 157
Device Pager 159
Swap Pager 160
5.11 Paging 162
5.12 Page Replacement
Paging Parameters
The Pageout Daemon
Swapping 171
The Swap-In Process
5.13 Portability 173
The Role of the pmap Module
Initialization and Startup 179
Mapping Allocation and Deallocation 181
Change of Access and Wiring Attributes for Mappings
Management of Page-Usage Information
156
6.6
223
229
166
168
169
6.7
231
Simple Filesystem Layers
234
The Union Mount Filesystem
235
172
Other Filesystems
237
Exercises
238
References
240
176
241
Chapter 7 Local Filesystems
7.1 Hierarchical Filesystem Management
7.2 Structure of an Inode
184
241
185
243
Initialization of Physical Pages 186
Management of Internal Data Structures
Inode Management
245
186
7.3 Naming 247
Directories 247
Finding of Names in Directories
References
187
188
249
Exercises
29871001.004.png
Pathname Translation
249
RPC Transport Issues
322
Links 251
7.4 Quotas 253
7.5 File Locking 257
7.6 Other Filesystem Semantics
Security Issues 324
9.3 Techniques for Improving Performance
325
262
Leases 328
Crash Recovery
332
Large File Sizes
262
Exercises 333
References 334
Chapter 10 Terminal Handling
10.1 Terminal-Processing Modes
File Flags
263
Exercises
264
337
References
264
338
Chapter 8 Local Filestores
8.1 Overview of the Filestore 265
8.2 The Berkeley Fast Filesystem 269
Organization of the Berkeley Fast Filesystem
Optimization of Storage Utilization
265
10.2
10.3
10.4
10.5
10.6
10.7
10.8
Line Disciplines 339
User Interface 340
The tty Structure 342
Process Groups, Sessions, and Terminal Control
C-lists 344
RS-232 and Modem Control
269
343
271
346
Reading and Writing to a File
273
Filesystem Parameterization
275
Terminal Operations
347
Layout Policies 276
Allocation Mechanisms
Open 347
Output Line Discipline
277
347
Block Clustering 281
Synchronous Operations 284
8.3 The Log-Structured Filesystem 285
Organization of the Log-Structured Filesystem
Index File
Output Top Half
349
Output Bottom Half
350
Input Bottom Half
351
288
286
Input Top Half 352
The stop Routine 353
The ioctl Routine 353
Modem Transitions 354
Closing of Terminal Devices
Reading of the Log
Writing to the Log
Block Accounting
The Buffer Cache
Directory Operations
Creation of a File
Reading and Writing to a File
290
291
292
294
295
296
355
10.9
Other Line Disciplines
355
Serial Line IP Discipline
356
Graphics Tablet Discipline
356
297
Exercises
357
Filesystem Cleaning 297
Filesystem Parameterization 300
Filesystem-Crash Recovery 300
8.4 The Memory-Based Filesystem 302
Organization of the Memory-Based Filesystem
Filesystem Performance
References
357
Part 4 Interprocess Communication
359
303
361
305
Chapter 11 Interprocess Communication
Future Work
305
11.1 Interprocess-Communication Model
Use of Sockets 364
11.2 Implementation Structure and Overview
11.3 Memory Management
Exercises
306
References
307
368
Chapter 9 The Network Filesystem
9.1 History and Overview 311
9.2 NFS Structure and Operation
311
369
Mbufs 369
Storage-Management Algorithms
Mbuf Utility Routines
372
314
373
The NFS Protocol 316
The 4.4BSD NFS Implementation
11.4 Data Structures 374
Communication Domains
318
375
Client-Server Interactions
321
Sockets
376
29871001.005.png
Socket Addresses
378
Chapter 13 Network Protocols
435
11.5 Connection Setup
380
11.6 Data Transfer 382
Transmitting Data 383
Receiving Data 385
Passing Access Rights 388
Passing Access Rights in the Local Domain
11.7 Socket Shutdown
13.1 Internet Network Protocols
436
Internet Addresses
437
Subnets 438
Broadcast Addresses 441
Internet Multicast 441
Internet Ports and Associations
390
389
442
Exercises
391
Protocol Control Blocks 442
13.2 User Datagram Protocol (UDP)
References
393
443
Initialization
443
Chapter 12 Network Communication
395
Output 444
Input 445
Control Operations
12.1
Internal Structure
396
446
Data Flow 397
Communication Protocols
13.3 Internet Protocol (IP)
446
398
Output 447
Input 448
Forwarding 449
13.4 Transmission Control Protocol (TCP)
Network Interfaces 400
Socket-to-Protocol Interface
12.2
405
Protocol User-Request Routine
405
451
Internal Requests 409
Protocol Control-Output Routine
409
TCP Connection States
453
Sequence Variables
456
12.3
Protocol-Protocol Interface
410
13.5 TCP Algorithms
457
pr_output 411
pr_input 411
pr_ctlinput 411
Interface between Protocol and Network Interface
Packet Transmission
Timers 459
Estimation of Round-Trip Time
460
12.4
412
Connection Establishment
461
Connection Shutdown
463
412
13.6 TCP Input Processing
464
Packet Reception
413
13.7 TCP Output Processing
468
12.5
Routing 416
Kernel Routing Tables
Sending of Data 468
Avoidance of the Silly-Window Syndrome
417
469
Routing Lookup 420
Routing Redirects 423
Routing-Table Interface 424
User-Level Routing Policies 425
User-Level Routing Interface: Routing Socket
Avoidance of Small Packets 470
Delayed Acknowledgments and Window Updates
471
Retransmit State
472
Slow Start 472
Source-Quench Processing 474
Buffer and Window Sizing 474
Avoidance of Congestion with Slow Start
425
12.6
Buffering and Congestion Control
426
Protocol Buffering Policies
427
475
Queue Limiting 427
428
428
429
429
Additional Network-Subsystem Topics
12.7
Raw Sockets
Control Blocks
Input Processing
Output Processing
Fast Retransmission 476
13.8 Internet Control Message Protocol (ICMP)
477
13.9 OSI Implementation Issues 478
13.10 Summary of Networking and Interprocess Communication
Creation of a Communication Channel
480
481
12.8
429
Sending and Receiving of Data 482
Termination of Data Transmission or Reception
Out-of-Band Data 430
Address Resolution Protocol
430
483
Exercises
484
Exercises
432
References
486
References
433
29871001.001.png
Zgłoś jeśli naruszono regulamin