Understanding the Linux kernel

Explains the operating system's hidden processes, covering memory management, the Virtual File System, process creation and scheduling, signals, essential interfaces, timing, and synchronization in the kernel.

Detalles Bibliográficos
Otros Autores: Bovet, Daniel P. author (author), Cesati, Marco, author
Formato: Libro electrónico
Idioma:Inglés
Publicado: Beijing ; Cambridge, Mass. : O'Reilly 2001.
Edición:1st edition
Materias:
Ver en Biblioteca Universitat Ramon Llull:https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009627184106719
Tabla de Contenidos:
  • Intro
  • Table of Contents
  • Preface
  • The Audience for This Book
  • Organization of the Material
  • Level of Description
  • Overview of the Book
  • Background Information
  • Conventions in This Book
  • How to Contact Us
  • Safari® Enabled
  • Acknowledgments
  • Introduction
  • Linux Versus Other Unix-Like Kernels
  • Hardware Dependency
  • Linux Versions
  • Basic Operating System Concepts
  • Multiuser Systems
  • Users and Groups
  • Processes
  • Kernel Architecture
  • An Overview of the Unix Filesystem
  • Files
  • Hard and Soft Links
  • File Types
  • File Descriptor and Inode
  • Access Rights and File Mode
  • File-Handling System Calls
  • Opening a file
  • Accessing an opened file
  • Closing a file
  • Renaming and deleting a file
  • An Overview of Unix Kernels
  • The Process/Kernel Model
  • Process Implementation
  • Reentrant Kernels
  • Process Address Space
  • Synchronization and Critical Regions
  • Kernel preemption disabling
  • Interrupt disabling
  • Semaphores
  • Spin locks
  • Avoiding deadlocks
  • Signals and Interprocess Communication
  • Process Management
  • Zombie processes
  • Process groups and login sessions
  • Memory Management
  • Virtual memory
  • Random access memory usage
  • Kernel Memory Allocator
  • Process virtual address space handling
  • Caching
  • Device Drivers
  • Memory Addressing
  • Memory Addresses
  • Segmentation in Hardware
  • Segment Selectors and Segmentation Registers
  • Segment Descriptors
  • Fast Access to Segment Descriptors
  • Segmentation Unit
  • Segmentation in Linux
  • The Linux GDT
  • The Linux LDTs
  • Paging in Hardware
  • Regular Paging
  • Extended Paging
  • Hardware Protection Scheme
  • An Example of Regular Paging
  • The Physical Address Extension (PAE) Paging Mechanism
  • Paging for 64-bit Architectures
  • Hardware Cache
  • Translation Lookaside Buffers (TLB)
  • Paging in Linux.
  • The Linear Address Fields
  • Page Table Handling
  • Physical Memory Layout
  • Process Page Tables
  • Kernel Page Tables
  • Provisional kernel Page Tables
  • Final kernel Page Table when RAM size is less than 896 MB
  • Final kernel Page Table when RAM size is between 896 MB and 4096 MB
  • Final kernel Page Table when RAM size is more than 4096 MB
  • Fix-Mapped Linear Addresses
  • Handling the Hardware Cache and the TLB
  • Handling the hardware cache
  • Handling the TLB
  • Processes
  • Processes, Lightweight Processes, and Threads
  • Process Descriptor
  • Process State
  • Identifying a Process
  • Process descriptors handling
  • Identifying the current process
  • Doubly linked lists
  • The process list
  • The lists of TASK_RUNNING processes
  • Relationships Among Processes
  • The pidhash table and chained lists
  • How Processes Are Organized
  • Wait queues
  • Handling wait queues
  • Process Resource Limits
  • Process Switch
  • Hardware Context
  • Task State Segment
  • The thread field
  • Performing the Process Switch
  • The switch_to macro
  • The _ _switch_to ( ) function
  • Saving and Loading the FPU, MMX, and XMM Registers
  • Saving the FPU registers
  • Loading the FPU registers
  • Using the FPU, MMX, and SSE/SSE2 units in Kernel Mode
  • Creating Processes
  • The clone( ), fork( ), and vfork( ) System Calls
  • The do_fork( ) function
  • The copy_process( ) function
  • Kernel Threads
  • Creating a kernel thread
  • Process 0
  • Process 1
  • Other kernel threads
  • Destroying Processes
  • Process Termination
  • The do_group_exit( ) function
  • The do_exit( ) function
  • Process Removal
  • Interrupts and Exceptions
  • The Role of Interrupt Signals
  • Interrupts and Exceptions
  • IRQs and Interrupts
  • The Advanced Programmable Interrupt Controller (APIC)
  • Exceptions
  • Interrupt Descriptor Table.
  • Hardware Handling of Interrupts and Exceptions
  • Nested Execution of Exception and Interrupt Handlers
  • Initializing the Interrupt Descriptor Table
  • Interrupt, Trap, and System Gates
  • Preliminary Initialization of the IDT
  • Exception Handling
  • Saving the Registers for the Exception Handler
  • Entering and Leaving the Exception Handler
  • Interrupt Handling
  • I/O Interrupt Handling
  • Interrupt vectors
  • IRQ data structures
  • IRQ distribution in multiprocessor systems
  • Multiple Kernel Mode stacks
  • Saving the registers for the interrupt handler
  • The do_IRQ( ) function
  • The _ _do_IRQ( ) function
  • Reviving a lost interrupt
  • Interrupt service routines
  • Dynamic allocation of IRQ lines
  • Interprocessor Interrupt Handling
  • Softirqs and Tasklets
  • Softirqs
  • Data structures used for softirqs
  • Handling softirqs
  • The do_softirq( ) function
  • The _ _do_softirq( ) function
  • The ksoftirqd kernel threads
  • Tasklets
  • Work Queues
  • Work queue data structures
  • Work queue functions
  • The predefined work queue
  • Returning from Interrupts and Exceptions
  • The entry points
  • Resuming a kernel control path
  • Checking for kernel preemption
  • Resuming a User Mode program
  • Checking for rescheduling
  • Handling pending signals, virtual-8086 mode, and single stepping
  • Kernel Synchronization
  • How the Kernel Services Requests
  • Kernel Preemption
  • When Synchronization Is Necessary
  • When Synchronization Is Not Necessary
  • Synchronization Primitives
  • Per-CPU Variables
  • Atomic Operations
  • Optimization and Memory Barriers
  • Spin Locks
  • The spin_lock macro with kernel preemption
  • The spin_lock macro without kernel preemption
  • The spin_unlock macro
  • Read/Write Spin Locks
  • Getting and releasing a lock for reading
  • Getting and releasing a lock for writing
  • Seqlocks
  • Read-Copy Update (RCU)
  • Semaphores.
  • Getting and releasing semaphores
  • Read/Write Semaphores
  • Completions
  • Local Interrupt Disabling
  • Disabling and Enabling Deferrable Functions
  • Synchronizing Accesses to Kernel Data Structures
  • Choosing Among Spin Locks, Semaphores, and Interrupt Disabling
  • Protecting a data structure accessed by exceptions
  • Protecting a data structure accessed by interrupts
  • Protecting a data structure accessed by deferrable functions
  • Protecting a data structure accessed by exceptions and interrupts
  • Protecting a data structure accessed by exceptions and deferrable functions
  • Protecting a data structure accessed by interrupts and deferrable functions
  • Protecting a data structure accessed by exceptions, interrupts, and deferrable functions
  • Examples of Race Condition Prevention
  • Reference Counters
  • The Big Kernel Lock
  • Memory Descriptor Read/Write Semaphore
  • Slab Cache List Semaphore
  • Inode Semaphore
  • Timing Measurements
  • Clock and Timer Circuits
  • Real Time Clock (RTC)
  • Time Stamp Counter (TSC)
  • Programmable Interval Timer (PIT)
  • CPU Local Timer
  • High Precision Event Timer (HPET)
  • ACPI Power Management Timer
  • The Linux Timekeeping Architecture
  • Data Structures of the Timekeeping Architecture
  • The timer object
  • The jiffies variable
  • The xtime variable
  • Timekeeping Architecture in Uniprocessor Systems
  • Initialization phase
  • The timer interrupt handler
  • Timekeeping Architecture in Multiprocessor Systems
  • Initialization phase
  • The global timer interrupt handler
  • The local timer interrupt handler
  • Updating the Time and Date
  • Updating System Statistics
  • Updating Local CPU Statistics
  • Keeping Track of System Load
  • Profiling the Kernel Code
  • Checking the NMI Watchdogs
  • Software Timers and Delay Functions
  • Dynamic Timers
  • Dynamic timers and race conditions.
  • Data structures for dynamic timers
  • Dynamic timer handling
  • An Application of Dynamic Timers: the nanosleep( ) System Call
  • Delay Functions
  • System Calls Related to Timing Measurements
  • The time( ) and gettimeofday( ) System Calls
  • The adjtimex( ) System Call
  • The setitimer( ) and alarm( ) System Calls
  • System Calls for POSIX Timers
  • Process Scheduling
  • Scheduling Policy
  • Process Preemption
  • How Long Must a Quantum Last?
  • The Scheduling Algorithm
  • Scheduling of Conventional Processes
  • Base time quantum
  • Dynamic priority and average sleep time
  • Active and expired processes
  • Scheduling of Real-Time Processes
  • Data Structures Used by the Scheduler
  • The runqueue Data Structure
  • Process Descriptor
  • Functions Used by the Scheduler
  • The scheduler_tick( ) Function
  • Updating the time slice of a real-time process
  • Updating the time slice of a conventional process
  • The try_to_wake_up( ) Function
  • The recalc_task_prio( ) Function
  • The schedule( ) Function
  • Direct invocation
  • Lazy invocation
  • Actions performed by schedule( ) before a process switch
  • Actions performed by schedule( ) to make the process switch
  • Actions performed by schedule( ) after a process switch
  • Runqueue Balancing in Multiprocessor Systems
  • Scheduling Domains
  • The rebalance_tick( ) Function
  • The load_balance( ) Function
  • The move_tasks( ) Function
  • System Calls Related to Scheduling
  • The nice( ) System Call
  • The getpriority( ) and setpriority( ) System Calls
  • The sched_getaffinity( ) and sched_setaffinity( ) System Calls
  • System Calls Related to Real-Time Processes
  • The sched_getscheduler( ) and sched_setscheduler( ) system calls
  • The sched_ getparam( ) and sched_setparam( ) system calls
  • The sched_ yield( ) system call.
  • The sched_ get_priority_min( ) and sched_ get_priority_max( ) system calls.