Foreword |
|
xvii | |
Acknowledgments |
|
xix | |
About the Authors |
|
xxi | |
Preface |
|
xxiii | |
|
|
1 | (28) |
|
|
2 | (2) |
|
Standards and Common Interfaces |
|
|
4 | (1) |
|
Free Software and Open Source |
|
|
5 | (1) |
|
A Quick Survey of Linux Distributions |
|
|
5 | (3) |
|
|
6 | (1) |
|
|
6 | (1) |
|
|
7 | (1) |
|
|
7 | (1) |
|
|
7 | (1) |
|
|
7 | (1) |
|
|
8 | (1) |
|
Kernel Release Information |
|
|
8 | (1) |
|
|
8 | (1) |
|
What Is an Operating System? |
|
|
9 | (2) |
|
|
11 | (1) |
|
Overview of the Linux Kernel |
|
|
11 | (15) |
|
|
12 | (1) |
|
|
13 | (1) |
|
|
13 | (7) |
|
|
20 | (4) |
|
|
24 | (1) |
|
|
24 | (1) |
|
|
25 | (1) |
|
Portability and Architecture Dependence |
|
|
26 | (3) |
|
|
27 | (1) |
|
|
27 | (2) |
|
|
29 | (48) |
|
|
30 | (8) |
|
|
30 | (4) |
|
|
34 | (1) |
|
|
35 | (3) |
|
|
38 | (8) |
|
|
39 | (3) |
|
|
42 | (4) |
|
Assembly Language Example |
|
|
46 | (9) |
|
|
47 | (3) |
|
|
50 | (5) |
|
|
55 | (7) |
|
|
55 | (1) |
|
|
56 | (1) |
|
Clobbered Registers (or Clobber List) |
|
|
56 | (1) |
|
|
56 | (1) |
|
|
56 | (1) |
|
|
57 | (1) |
|
|
57 | (5) |
|
|
62 | (3) |
|
|
62 | (1) |
|
|
63 | (1) |
|
|
63 | (1) |
|
|
64 | (1) |
|
A Quick Tour of Kernel Exploration Tools |
|
|
65 | (2) |
|
|
65 | (1) |
|
|
66 | (1) |
|
|
66 | (1) |
|
|
67 | (1) |
|
|
67 | (1) |
|
Kernel Speak: Listening to Kernel Messages |
|
|
67 | (1) |
|
|
67 | (1) |
|
|
68 | (1) |
|
|
68 | (1) |
|
|
68 | (9) |
|
|
68 | (1) |
|
|
69 | (2) |
|
|
71 | (1) |
|
|
71 | (1) |
|
|
71 | (1) |
|
|
72 | (1) |
|
Step 1: Writing the Linux Module Skeleton |
|
|
72 | (2) |
|
Step 2: Compiling the Module |
|
|
74 | (1) |
|
|
75 | (1) |
|
|
76 | (1) |
|
Processes: The Principal Model of Execution |
|
|
77 | (102) |
|
|
80 | (2) |
|
|
82 | (19) |
|
Process Attribute-Related Fields |
|
|
84 | (3) |
|
Scheduling Related Fields |
|
|
87 | (3) |
|
Process Relations-Related Fields |
|
|
90 | (2) |
|
Process Credentials-Related Fields |
|
|
92 | (2) |
|
Process Capabilities-Related Fields |
|
|
94 | (3) |
|
Process Limitations-Related Fields |
|
|
97 | (2) |
|
Filesystem- and Address Space-Related Fields |
|
|
99 | (2) |
|
Process Creation: fork(), vfork(), and clone() System Calls |
|
|
101 | (8) |
|
|
103 | (1) |
|
|
104 | (1) |
|
|
105 | (1) |
|
|
106 | (3) |
|
|
109 | (7) |
|
|
109 | (2) |
|
Process State Transitions |
|
|
111 | (5) |
|
|
116 | (8) |
|
|
117 | (1) |
|
|
117 | (3) |
|
Parent Notification and sys_wait4() |
|
|
120 | (4) |
|
Keeping Track of Processes: Basic Scheduler Construction |
|
|
124 | (9) |
|
|
125 | (1) |
|
Waking Up From Waiting or Activation |
|
|
126 | (7) |
|
|
133 | (9) |
|
|
136 | (1) |
|
|
137 | (3) |
|
|
140 | (2) |
|
Asynchronous Execution Flow |
|
|
142 | (37) |
|
|
143 | (3) |
|
|
146 | (27) |
|
|
173 | (1) |
|
Project: current System Variable |
|
|
174 | (1) |
|
|
175 | (2) |
|
|
177 | (1) |
|
|
177 | (2) |
|
|
179 | (74) |
|
|
183 | (4) |
|
|
184 | (3) |
|
|
187 | (4) |
|
|
187 | (3) |
|
Memory Zone Helper Functions |
|
|
190 | (1) |
|
|
191 | (9) |
|
Functions for Requesting Page Frames |
|
|
191 | (2) |
|
Functions for Releasing Page Frames |
|
|
193 | (1) |
|
|
194 | (6) |
|
|
200 | (11) |
|
|
203 | (4) |
|
General Purpose Cache Descriptor |
|
|
207 | (1) |
|
|
208 | (3) |
|
Slab Allocator's Lifecycle |
|
|
211 | (13) |
|
Global Variables of the Slab Allocator |
|
|
211 | (2) |
|
|
213 | (6) |
|
Slab Creation and cache_grow() |
|
|
219 | (3) |
|
Slab Destruction: Returning Memory and kmem_cache_destroy() |
|
|
222 | (2) |
|
|
224 | (2) |
|
|
224 | (1) |
|
|
225 | (1) |
|
Linux Process Memory Structures |
|
|
226 | (6) |
|
|
227 | (3) |
|
|
230 | (2) |
|
Process Image Layout and Linear Address Space |
|
|
232 | (4) |
|
|
236 | (1) |
|
|
237 | (16) |
|
|
238 | (1) |
|
|
239 | (10) |
|
PowerPC Page Fault Exception |
|
|
249 | (1) |
|
|
249 | (1) |
|
Project: Process Memory Map |
|
|
250 | (1) |
|
|
251 | (2) |
|
|
253 | (42) |
|
How Hardware Does It: Busses, Bridges, Ports, and Interfaces |
|
|
255 | (5) |
|
|
260 | (35) |
|
|
260 | (3) |
|
Request Queues and Scheduling I/O |
|
|
263 | (11) |
|
Example: ``Generic'' Block Driver |
|
|
274 | (3) |
|
|
277 | (2) |
|
Character Device Overview |
|
|
279 | (1) |
|
A Note on Network Devices |
|
|
280 | (1) |
|
|
280 | (1) |
|
|
280 | (1) |
|
Direct Memory Access (DMA) |
|
|
281 | (1) |
|
|
281 | (1) |
|
Project: Building a Parallel Port Driver |
|
|
282 | (1) |
|
|
282 | (3) |
|
|
285 | (8) |
|
|
293 | (2) |
|
|
295 | (78) |
|
General Filesystem Concepts |
|
|
296 | (6) |
|
|
296 | (1) |
|
|
297 | (1) |
|
Additional File Attributes |
|
|
298 | (1) |
|
Directories and Pathnames |
|
|
298 | (1) |
|
|
299 | (1) |
|
|
300 | (1) |
|
Disk Blocks, Partitions, and Implementation |
|
|
301 | (1) |
|
|
302 | (1) |
|
|
302 | (22) |
|
|
305 | (17) |
|
Global and Local List References |
|
|
322 | (2) |
|
Structures Associated with VFS |
|
|
324 | (6) |
|
|
324 | (2) |
|
|
326 | (4) |
|
|
330 | (6) |
|
|
331 | (3) |
|
|
334 | (2) |
|
VFS System Calls and the Filesystem Layer |
|
|
336 | (37) |
|
|
337 | (8) |
|
|
345 | (3) |
|
|
348 | (21) |
|
|
369 | (2) |
|
|
371 | (1) |
|
|
372 | (1) |
|
Scheduling and Kernel Synchronization |
|
|
373 | (48) |
|
|
375 | (30) |
|
|
376 | (7) |
|
|
383 | (11) |
|
|
394 | (11) |
|
|
405 | (4) |
|
Explicit Kernel Preemption |
|
|
405 | (1) |
|
|
405 | (2) |
|
Implicit Kernel Preemption |
|
|
407 | (2) |
|
|
409 | (2) |
|
System Clock: Of Time and Timers |
|
|
411 | (10) |
|
Real-Time Clock: What Time Is It? |
|
|
412 | (2) |
|
Reading the PPC Real-Time Clock |
|
|
414 | (3) |
|
Reading the x86 Real-Time Clock |
|
|
417 | (1) |
|
|
418 | (1) |
|
|
419 | (2) |
|
|
421 | (104) |
|
|
423 | (1) |
|
|
424 | (7) |
|
|
426 | (3) |
|
|
429 | (1) |
|
|
430 | (1) |
|
Architecture-Dependent Memory Initialization |
|
|
431 | (25) |
|
PowerPC Hardware Memory Management |
|
|
431 | (13) |
|
x86 Intel-Based Hardware Memory Management |
|
|
444 | (11) |
|
PowerPC and x86 Code Convergence |
|
|
455 | (1) |
|
|
456 | (1) |
|
The Beginning: start_kernel() |
|
|
456 | (61) |
|
The Call to lock_kernel() |
|
|
458 | (2) |
|
The Call to page_address_init() |
|
|
460 | (4) |
|
The Call to printk(linux_banner) |
|
|
464 | (1) |
|
|
464 | (5) |
|
The Call to setup_per_cpu_areas() |
|
|
469 | (1) |
|
The Call to smp_prepare_boot_cpu() |
|
|
470 | (1) |
|
|
471 | (3) |
|
The Call to build_all_zonelists() |
|
|
474 | (1) |
|
The Call to page_alloc_init |
|
|
475 | (1) |
|
|
476 | (3) |
|
|
479 | (1) |
|
|
479 | (1) |
|
|
480 | (1) |
|
The Call to softirq_init() |
|
|
481 | (1) |
|
|
482 | (2) |
|
The Call to console_init() |
|
|
484 | (1) |
|
The Call to profile_init() |
|
|
485 | (1) |
|
The Call to local_irq_enable() |
|
|
485 | (1) |
|
|
486 | (1) |
|
|
486 | (7) |
|
The Call to late_time_init() |
|
|
493 | (1) |
|
The Call to calibrate_delay() |
|
|
494 | (1) |
|
The Call to pgtable_cache_init() |
|
|
495 | (2) |
|
The Call to buffer_init() |
|
|
497 | (1) |
|
The Call to security_scaffolding_startup() |
|
|
497 | (1) |
|
The Call to vfs_caches_init() |
|
|
498 | (10) |
|
The Call to radix_tree_init() |
|
|
508 | (1) |
|
The Call to signals_init() |
|
|
509 | (1) |
|
The Call to page_writeback_init() |
|
|
509 | (3) |
|
The Call to proc_root_init() |
|
|
512 | (2) |
|
|
514 | (1) |
|
|
515 | (2) |
|
The init Thread (or Process 1) |
|
|
517 | (8) |
|
|
522 | (1) |
|
|
523 | (2) |
|
Building the Linux Kernel |
|
|
525 | (28) |
|
|
526 | (10) |
|
|
527 | (1) |
|
|
528 | (1) |
|
|
528 | (1) |
|
|
529 | (7) |
|
|
536 | (17) |
|
|
536 | (6) |
|
Building the Kernel Image |
|
|
542 | (9) |
|
|
551 | (1) |
|
|
551 | (2) |
|
Adding Your Code to the Kernel |
|
|
553 | (42) |
|
|
554 | (21) |
|
Getting Familiar with the Filesystem |
|
|
555 | (1) |
|
|
556 | (2) |
|
User Memory and Kernel Memory |
|
|
558 | (1) |
|
|
559 | (5) |
|
Work Queues and Interrupts |
|
|
564 | (3) |
|
|
567 | (1) |
|
|
567 | (5) |
|
|
572 | (3) |
|
|
575 | (15) |
|
|
575 | (3) |
|
|
578 | (1) |
|
|
578 | (4) |
|
|
582 | (4) |
|
|
586 | (2) |
|
Adding Code for a System Call |
|
|
588 | (2) |
|
|
590 | (5) |
|
|
590 | (1) |
|
|
591 | (2) |
|
|
593 | (2) |
Bibliography |
|
595 | (4) |
Index |
|
599 | |