Contents
Introduction
What This Book Covers
Chapter 1: Introduction and Overview
1.1 Tasks of the Kernel
1.2 Implementation Strategies
1.3 Elements of the Kernel
1.4 Why the Kernel Is Special
1.5 Some Notes on Presentation
1.6 Summary
Chapter 2: Process Management and Scheduling
2.1 Process Priorities
2.2 Process Life Cycle
2.3 Process Representation
2.4 Process Management System Calls
2.5 Implementation of the Scheduler
2.6 The Completely Fair Scheduling Class
2.7 The Real-Time Scheduling Class
2.8 Scheduler Enhancements
2.9 Summary
Chapter 3: Memory Management
3.1 Overview
3.2 Organization in the (N)UMA Model
3.3 Page Tables
3.4 Initialization of Memory Management
3.5 Management of Physical Memory
3.6 The Slab Allocator
3.7 Processor Cache and TLB Control
3.8 Summary
Chapter 4: Virtual Process Memory
4.1 Introduction
4.2 Virtual Process Address Space
4.3 Principle of Memory Mappings
4.4 Data Structures
4.5 Operations on Regions
4.6 Address Spaces
4.7 Memory Mappings
4.8 Reverse Mapping
4.9 Managing the Heap
4.10 Handling of Page Faults
4.11 Correction of Userspace Page Faults
4.12 Kernel Page Faults
4.13 Copying Data between Kernel and Userspace
4.14 Summary
Chapter 5: Locking and Interprocess Communication
5.1 Control Mechanisms
5.2 Kernel Locking Mechanisms
5.3 System V Interprocess Communication
5.4 Other IPC Mechanisms
5.5 Summary
Chapter 6: Device Drivers
6.1 I/O Architecture
6.2 Access to Devices
6.3 Association with the Filesystem
6.4 Character Device Operations
6.5 Block Device Operations
6.6 Resource Reservation
6.7 Bus Systems
6.8 Summary
Chapter 7: Modules
7.1 Overview
7.2 Using Modules
7.3 Inserting and Deleting Modules
7.4 Automation and Hotplugging
7.5 Version Control
7.6 Summary
Chapter 8: The Virtual Filesystem
8.1 Filesystem Types
8.2 The Common File Model
8.3 Structure of the VFS
8.4 Working with VFS Objects
8.5 Standard Functions
8.6 Summary
Chapter 9: The Extended Filesystem Family
9.1 Introduction
9.2 Second Extended Filesystem
9.3 Third Extended Filesystem
9.4 Summary
Chapter 10: Filesystems without Persistent Storage
10.1 The proc Filesystem
10.2 Simple Filesystems
10.3 Sysfs
10.4 Summary
Chapter 11: Extended Attributes and Access Control Lists
11.1 Extended Attributes
11.2 Access Control Lists
11.3 Summary
Chapter 12: Networks
12.1 Linked Computers
12.2 ISO/OSI and TCP/IP Reference Model
12.3 Communication via Sockets
12.4 The Layer Model of Network Implementation
12.5 Networking Namespaces
12.6 Socket Buffers
12.7 Network Access Layer
12.8 Network Layer
12.9 Transport Layer
12.10 Application Layer
12.11 Networking from within the Kernel
12.12 Summary
Chapter 13: System Calls
13.1 Basics of System Programming
13.2 Available System Calls
13.3 Implementation of System Calls
13.4 Summary
Chapter 14: Kernel Activities
14.1 Interrupts
14.2 Software Interrupts
14.3 Tasklets
14.4 Wait Queues and Completions
14.5 Summary
Chapter 15: Time Management
15.1 Overview
15.2 Implementation of Low-Resolution Timers
15.3 Generic Time Subsystem
15.4 High-Resolution Timers
15.5 Dynamic Ticks
15.6 Broadcast Mode
15.7 Implementing Timer-Related System Calls
15.8 Managing Process Times
15.9 Summary
Chapter 16: Page and Buffer Cache
16.1 Structure of the Page Cache
16.2 Structure of the Buffer Cache
16.3 Address Spaces
16.4 Implementation of the Page Cache
16.5 Implementation of the Buffer Cache
16.6 Summary
Chapter 17: Data Synchronization
17.1 Overview
17.2 The pdflush Mechanism
17.3 Starting a New Thread
17.4 Thread Initialization
17.5 Performing Actual Work
17.6 Periodic Flushing
17.7 Associated Data Structures
17.8 Central Control
17.9 Superblock Synchronization
17.10 Inode Synchronization
17.11 Congestion
17.12 Forced Writeback
17.13 Laptop Mode
17.14 System Calls for Synchronization Control
17.15 Full Synchronization
17.16 Summary
Chapter 18: Page Reclaim and Swapping
18.1 Overview
18.2 Page Reclaim and Swapping in the Linux Kernel
18.3 Managing Swap Areas
18.4 The Swap Cache
18.5 Writing Data Back
18.6 Page Reclaim
18.7 The Swap Token
18.8 Handling Swap-Page Faults
18.9 Initiating Memory Reclaim
18.10 Shrinking Other Caches
18.11 Summary
Chapter 19: Auditing
19.1 Overview
19.2 Audit Rules
19.3 Implementation
19.4 Summary
Appendix A: Architecture Specifics
A.1 Overview
A.2 Data Types
A.3 Alignment
A.4 Memory Pages
A.5 System Calls
A.6 String Processing
A.7 Thread Representation
A.8 Bit Operations and Endianness
A.9 Page Tables
A.10 Miscellaneous
A.11 Summary
Appendix B: Working with the Source Code
B.1 Organization of the Kernel Sources
B.2 Configuration with Kconfig
B.3 Compiling the Kernel with Kbuild
B.4 Useful Tools
B.5 Debugging and Analyzing the Kernel
B.6 User-Mode Linux
B.7 Summary
Appendix C: Notes on C
C.1 How the GNU C Compiler Works
C.2 Standard Data Structures and Techniques of the Kernel
C.3 Summary
Appendix D: System Startup
D.1 Architecture-Specific Setup on IA-32 Systems
D.2 High-Level Initialization
D.3 Summary
Appendix E: The ELF Binary Format
E.1 Layout and Structure
E.2 Data Structures in the Kernel
E.3 Summary
Appendix F: The Kernel Development Process
F.1 Introduction
F.2 Kernel Trees and the Structure of Development
F.3 The Structure of Patches
F.4 Linux and Academia
F.5 Summary
References
Index