| |
| |
| |
Introduction to the Linux Kernel | |
| |
| |
Along Came Linus: Introduction to Linux | |
| |
| |
Overview of Operating Systems and Kernels | |
| |
| |
Linux Versus Classic Unix Kernels | |
| |
| |
Linux Kernel Versions | |
| |
| |
The Linux Kernel Development Community | |
| |
| |
Before We Begin | |
| |
| |
| |
Getting Started with the Kernel | |
| |
| |
Obtaining the Kernel Source | |
| |
| |
Installing the Kernel Source | |
| |
| |
Using Patches | |
| |
| |
The Kernel Source Tree | |
| |
| |
Building the Kernel | |
| |
| |
Minimizing Build Noise | |
| |
| |
Spawning Multiple Build Jobs | |
| |
| |
Installing the Kernel | |
| |
| |
A Beast of a Different Nature | |
| |
| |
No libc | |
| |
| |
GNU CNo Memory Protection | |
| |
| |
No (Easy) Use of Floating Point | |
| |
| |
Small, Fixed-Size Stack | |
| |
| |
Synchronization and Concurrency | |
| |
| |
Portability Is Important | |
| |
| |
So Here We Are | |
| |
| |
| |
Process Management | |
| |
| |
Process Descriptor and the Task Structure | |
| |
| |
Allocating the Process Descriptor | |
| |
| |
Storing the Process Descriptor | |
| |
| |
Process State | |
| |
| |
Manipulating the Current Process State | |
| |
| |
Process Context | |
| |
| |
The Process Family Tree | |
| |
| |
Process Creation | |
| |
| |
Copy-on-Writefork()vfork() | |
| |
| |
The Linux Implementation of Threads | |
| |
| |
Kernel Threads | |
| |
| |
Process Termination | |
| |
| |
Removal of the Process Descriptor | |
| |
| |
The Dilemma of the Parentless Task | |
| |
| |
Process Wrap Up | |
| |
| |
| |
Process Scheduling | |
| |
| |
PolicyI/O-Bound Versus Processor-Bound Processes | |
| |
| |
Process Priority | |
| |
| |
Timeslice | |
| |
| |
Process Preemption | |
| |
| |
The Scheduling Policy in Action | |
| |
| |
The Linux Scheduling Algorithm | |
| |
| |
Runqueues | |
| |
| |
The Priority Arrays | |
| |
| |
Recalculating Timeslicesschedule() | |
| |
| |
Calculating Priority and Timeslice | |
| |
| |
Sleeping and Waking Up | |
| |
| |
The Load Balancer | |
| |
| |
Preemption and Context Switching | |
| |
| |
User Preemption | |
| |
| |
Kernel Preemption | |
| |
| |
Real-Time | |
| |
| |
Scheduler-Related System Calls | |
| |
| |
Scheduling Policy and Priority-Related System Calls | |
| |
| |
Processor Affinity System Calls | |
| |
| |
Yielding Processor Time | |
| |
| |
Scheduler Finale | |
| |
| |
| |
System Calls | |
| |
| |
APIs, POSIX, and the C Library | |
| |
| |
Syscalls | |
| |
| |
System Call Numbers | |
| |
| |
System Call Performance | |
| |
| |
System Call Handler | |
| |
| |
Denoting the Correct System Call | |
| |
| |
Parameter Passing | |
| |
| |
System Call Implementation | |
| |
| |
Verifying the Parameters | |
| |
| |
System Call Context | |
| |
| |
Final Steps in Binding a System Call | |
| |
| |
Accessing the System Call from User-Space | |
| |
| |
Why Not to Implement a System Call | |
| |
| |
System Calls in Conclusion | |
| |
| |
| |
Interrupts and Interrupt Handlers | |
| |
| |
Interrupts | |
| |
| |
Interrupt Handlers | |
| |
| |
Top Halves Versus Bottom Halves | |
| |
| |
Registering an Interrupt Handler | |
| |
| |
Freeing an Interrupt Handler | |
| |
| |
Writing an Interrupt Handler | |
| |
| |
Shared Handlers | |
| |
| |
A Real-Life Interrupt Handler | |
| |
| |
Interrupt Context | |
| |
| |
Implementation of Interrupt Handling/proc/interrupts | |
| |
| |
Interrupt Control | |
| |
| |
Disabling and Enabling Interrupts | |
| |
| |
Disabling a Specific Interrupt Line | |
| |
| |
Status of the Interrupt System | |
| |
| |
Don't Interrupt Me | |
| |
| |
We're Almost Done! | |
| |
| |
| |
Bottom Halves and Deferring Work | |
| |
| |
Bottom Halves | |
| |
| |
Why Bottom Halves? | |
| |
| |
A World of Bottom Halves | |
| |
| |
Softirqs | |
| |
| |
Implementation of Softirqs | |
| |
| |
Using Softirqs | |
| |
| |
Tasklets | |
| |
| |
Implementation of Tasklets | |
| |
| |
Using Taskletsksoftirqd | |
| |
| |
The Old BH Mechanism | |
| |
| |
Work Queues | |
| |
| |
Implementation of Work Queues | |
| |
| |
Using Work Queues | |
| |
| |
The Old Task Queue Mechanism | |
| |
| |
Which Bottom Half Should I Use? | |
| |
| |
Locking Between the Bottom Halves | |
| |
| |
Disabling Bottom Halves | |
| |
| |
The Bottom of Bottom-Half Processing | |
| |
| |
| |
Kernel Synchronization Introduction | |
| |
| |
Critical Regions and Race Condit | |