Skip to product information
Learning the Structure and Principles of the Linux Kernel Through Debugging 1
Learning the Structure and Principles of the Linux Kernel Through Debugging 1
Description
Book Introduction
What a new Linux system developer to a 5-year developer needs to know to get started
Major subsystems of the Linux kernel!


This book explains the Linux kernel in an easy and friendly way, just like a friendly senior developer sitting next to a new employee in a real-world development situation and explaining the Linux kernel in detail.
『Learning the Structure and Principles of the Linux Kernel through Debugging 1』 analyzes the latest version (LTS: 4.19) of the Linux kernel source in detail by following the function flow and explains the operating principles of the kernel by utilizing debugging tools such as ftrace and TRACE32.
It also covers how to modify the source code of the Linux kernel directly on the Raspberry Pi, install it, and then debug the kernel.
The kernel debugging methods introduced in each chapter can be directly applied to practical development.
  • You can preview some of the book's contents.
    Preview
","
index
▣ Chapter 1: Introduction and Outlook for Linux
1.1 Why should I learn Linux and the Linux kernel?
__1.1.1 Why should I learn Linux?
__1.1.2 Why should I learn the Linux kernel?
1.2 The Future of Linux
__1.2.1 What is an operating system?
__1.2.2 What operating system are we using?
1.3 History of Linux
__1.3.1 The Birth of Unix
__1.3.2 1991: The Rise of Linus Torvalds
__1.3.3 Why is Linux so popular?
1.4 Where is Linux used?
__1.4.1 Android
__1.4.2 Automobile
__1.4.3 Internet of Things (IoT) devices
1.5 Embedded Linux Development Group
__1.5.1 Linux Kernel Community
__1.5.2 CPU Vendor
__1.5.3 SoC Vendor
__1.5.4 Board Vendors and OEMs
1.6 What do I need to know to be good at embedded Linux development?
__1.6.1 device driver
__1.6.2 Linux Kernel
__1.6.3 CPU Architecture
__1.6.4 Build Script and Git
1.7 Raspberry Pi and the Linux Kernel
__1.7.1 Raspberry Pi Lab Board
__1.7.2 Linux kernel version
__1.7.3 Raspbian version
__1.7.4 ARM architecture
1.8 Summary

▣ Chapter 2: Raspberry Pi Setup
2.1 What is Raspberry Pi?
2.2 Setting up the Raspberry Pi
__2.2.1 Preparation for Raspberry Pi practice
__2.2.2 Raspberry Pi Installation
__2.2.3 Raspberry Pi Basic Settings
2.3 Building the Raspberry Pi Kernel
__2.3.1 Raspbian version and kernel source version
__2.3.2 Download the Raspbian kernel source code
__2.3.3 Raspbian Linux Kernel Build
__2.3.4 Installing the Raspbian Linux Kernel
__2.3.5 Generating preprocessing code
__2.3.6 Structure of the Linux kernel source
2.4 objdump binary utility
2.5 Precautions when using Raspberry Pi
2.6 Summary

▣ Chapter 3: Kernel Debugging and Code Learning
3.1 What is debugging?
__3.1.1 Debugging is a shortcut to problem-solving skills
__3.1.2 Debugging and Code Learning Skills
3.2 printk
3.3 dump_stack() function
3.4 ftrace
__3.4.1 What is ftrace?
__3.4.2 How to set up ftrace?
__3.4.3 How to analyze ftrace messages?
__3.4.4 How to extract ftrace logs?
__3.4.5 ftrace is a guide to kernel code analysis
3.5 The Legend of Embedded Debuggers: TRACE32
3.6 Debugfs driver code for kernel debugging
3.7 Summary

▣ Chapter 4: Process
4.1 Process Introduction
__4.1.1 What is a process?
__4.1.2 What is a task?
__4.1.3 What is a thread?
4.2 Checking the process
__4.2.1 Checking the process list with the ps command
__4.2.2 Checking processes in ftrace
4.3 How to create a process?
__4.3.1 Introduction to the _do_fork() function
__4.3.2 Processing flow of the _do_fork() function when creating a user-level process
__4.3.3 Flow of _do_fork() function when creating a kernel process
4.4 User-level process execution practice
__4.4.1 Basic user-level process execution practice and ftrace log analysis
__4.4.2 Process termination with exit() function and ftrace log analysis
4.5 Kernel Threads
__4.5.1 What is a kernel thread?
__4.5.2 Types of kernel threads
__4.5.3 How to create a kernel thread?
4.6 Creation process of kernel internal processes
__4.6.1 _do_fork() function
__4.6.2 Analysis of the copy_process() function
__4.6.3 Analysis of the wake_up_new_task() function
4.7 Analysis of the process termination process
__4.7.1 Understanding the process termination flow
__4.7.2 Analysis of the do_exit() function
__4.7.3 Analysis of the do_task_dead() function
__4.7.4 Behavior after calling the do_task_dead() function
4.8 Task Descriptor (task_struct structure)
__4.8.1 Fields that identify the process
__4.8.2 Saving process state
__4.8.3 Relationships between processes
__4.8.4 Process Linked List
__4.8.5 Process execution time information
4.9 Thread Information: thread_info Structure
__4.9.1 What is the thread_info structure?
__4.9.2 Analyzing the thread_info structure
__4.9.3 Where is the address of the thread_info structure?
__4.9.4 Detailed analysis of context information
__4.9.5 Detailed analysis of the cpu field
__4.9.6 Analysis of thread_info structure initialization code
4.10 Macro functions for accessing the task descriptor of a process
__4.10.1 What is the current macro?
__4.10.2 Analysis of the current_thread_info() macro function
4.11 Process Debugging
__4.11.1 Debugging glibc's fork() function with gdb
__4.11.2 Execution Tracing Using Linux Utility Programs
4.12 Summary

▣ Chapter 5: Interrupts
5.1 Introduction to Interrupts
__5.1.1 What is an interrupt?
__5.1.2 Key Concepts of Linux Kernel Interrupts
__5.1.3 Why you need to know interrupts
__5.1.4 Interrupt processing flow in the Linux kernel
5.2 Interrupt Context
__5.2.1 What is interrupt context?
__5.2.2 Checking interrupt context with ftrace and kernel log
__5.2.3 What is the in_interrupt() function?
__5.2.4 What happens when scheduling in interrupt context?
5.3 When is an interrupt handler called?
__5.3.1 Interrupt Vector Analysis
__5.3.2.
Check stack push from interrupt vector
__5.3.3.
Analyzing the call flow of an interrupt handler
5.4 How to register an interrupt handler?
__5.4.1 Analysis of the interrupt handler registration process
__5.4.2 Debugging the initialization process of an interrupt handler
__5.4.3 Setting flags when registering an interrupt handler
5.5 Interrupt Descriptor
__5.5.1 What is an interrupt descriptor?
__5.5.2 How to store the number of interrupt occurrences?
5.6 When should interrupts be disabled?
5.7 Interrupt Debugging
__5.7.1 /proc/interrupts
__5.7.2 ftrace interrupt event
__5.7.3 Identifying interrupt handler functions with ftrace
5.8 Summary

▣ Chapter 6: Interrupt Second Half Processing
6.1 What is the second half of the interrupt technique?
__6.1.1 Reasons for applying the latter half of the interrupt technique
__6.1.2 What happens if you do a lot of work in interrupt context?
__6.1.3 What is Top Half/Bottom Half?
__6.1.4 Types of techniques for handling the latter half of interrupts
__6.1.5 Which interrupt second half processing technique should I apply?
6.2 Threaded IRQ
__6.2.1 What is IRQ?
__6.2.2 Check IRQ thread
6.3 How to create an IRQ thread?
__6.3.1 When is an IRQ thread created?
__6.3.2 Debugging IRQ thread creation process on Raspberry Pi
6.4 Who will run the IRQ thread and when?
__6.4.1 Analysis of the code that wakes up the IRQ thread
__6.4.2 Analysis of the irq_thread() function, the IRQ thread handler
__6.4.3 Summary of the entire execution flow of the IRQ thread
6.5 IRQ Thread Debugging Practice
__6.5.1 Checking IRQ thread operation using ftrace
__6.5.2 IRQ thread creation practice
__6.5.3 IRQ thread handling function execution time measurement
6.6 Introduction to Soft IRQ
__6.6.1 What is Soft IRQ Service?
__6.6.2 Overall flow of Soft IRQ
__6.6.3 When to use Soft IRQ as a second half technique?
__6.6.4 Why should I know about Soft IRQ?
6.7 Soft IRQ Service
__6.7.1 Soft IRQ Service
__6.7.2 When should a soft IRQ service handler be registered?
__6.7.3 Practice registering a soft IRQ service handler
6.8 When to request Soft IRQ service?
__6.8.1 Overall Flow of Soft IRQ Service Request
__6.8.2 Analysis of the raise_softirq() function
__6.8.3 Analysis of the irq_stat global variable
__6.8.4 How and who checks whether a soft IRQ service has been requested?
6.9 Who handles Soft IRQ service and when?
__6.9.1 Where is the Soft IRQ service execution entry point?
__6.9.2 Check Soft IRQ Service Request
__6.9.3 Running Soft IRQ Service
__6.9.4 Waking up the ksoftirqd thread
6.10 ksoftirqd thread
__6.10.1 What is a ksoftirqd thread?
__6.10.2 When will the ksoftirqd thread be woken up?
__6.10.3 Analysis of the ksoftirqd handler run_ksoftirqd() function
6.11 About Soft IRQ Contexts
__6.11.1 Where does the soft IRQ context start?
__6.11.2 When does a soft IRQ context start?
__6.11.3 Check Soft IRQ Context
6.12 Tasklet
__6.12.1 What is a tasklet?
__6.12.2 Tasklet data structure
__6.12.3 How do I register a tasklet?
__6.12.4 Understanding the entire execution flow of a tasklet
__6.12.5 How do I request a tasklet execution?
__6.12.6 When should a tasklet be executed?
6.13 Soft IRQ Debugging
__6.13.1 Introducing ftrace's Soft IRQ Event
__6.13.2 Checking the number of Soft IRQ service executions using /proc/softirqs
6.14 Summary

▣ Chapter 7: Work Queue
7.1 Introduction to Work Queue
__7.1.1 Key Concepts of Work Queues
__7.1.2 Features of Work Queue
__7.1.3 Comparison of Work Queues with Other Interrupt-Late Techniques
__7.1.4 Process of designing the latter half of the interrupt code using the work queue
__7.1.5 Why you need to know the work queue well
7.2 Types of work queues
__7.2.1 Analysis of the alloc_workqueue() function
__7.2.2 7 Work Queues
7.3 What is Work?
__7.3.1 work_struct structure
__7.3.2 How to initialize a work?
7.4 How to queue work to a work queue?
__7.4.1 Let's look at example code for queuing work to a work queue.
__7.4.2 The process of queuing work into a work queue in the overall work queue flow diagram
__7.4.3 Analysis of the interface function that queues work to the work queue
__7.4.4 __queue_work() function analysis
__7.4.5 Analysis of internal work queue functions called by the __queue_work() function
7.5 Who runs the work and when?
__7.5.1 Analysis of the worker_thread() function, the starting point of work execution
__7.5.2 Analysis of the process_one_work() function
7.6 What is a worker thread?
__7.6.1 Workers and Worker Threads
__7.6.2 worker structure
__7.6.3 Who creates worker threads and when?
__7.6.4 Analysis of the create_worker() function that creates a worker thread
__7.6.5 Analysis of the work queue kernel function called in the create_worker() function
__7.6.6 worker_thread() function analysis
7.7 Workqueue Practice and Debugging
__7.7.1 ftrace workqueue event
__7.7.2 Verifying WorkQ operation using ftrace on Raspberry Pi
__7.7.3 Interrupt second half processing practice and log analysis
7.8 Delay Walk
__7.8.1 What is Delay Walk?
__7.8.2 Overall flow of delay work
__7.8.3 How to initialize delay work?
__7.8.4 Where is the starting point for delayed walk execution?
__7.8.5 Who will queue the delay work and when?
7.9 Creating a Delay Walk on a Raspberry Pi
__7.9.1 Contents and writing method of patch code
__7.9.2 ftrace log settings
__7.9.3 ftrace log analysis
7.10 Summary
","
Detailed image
Detailed Image 1
","
Publisher's Review
Covers the key subsystems of the Linux kernel that anyone from a new Linux system developer to a developer with five years of experience needs to know to get started!

This book explains the Linux kernel in an easy and friendly way, just like a friendly senior developer sitting next to a new employee in a real-world development situation and explaining the Linux kernel in detail.
This book analyzes the Linux kernel source code of the latest version (LTS: 4.19) in detail by following the function flow and explains the kernel's operating principles by utilizing debugging tools such as ftrace and TRACE32.
We also cover how to install the Linux kernel by modifying its source code directly on the Raspberry Pi, and then debugging the kernel.
The kernel debugging methods introduced in each chapter can be directly applied to practical development.

▣ [Part 1] Kernel Debugging (ftrace), Processes, Interrupts, Second Half of Interrupts, Work Queue

First, we will introduce how to use ftrace along with how to debug the kernel.
It covers the process that runs the kernel and the detailed operating principles of how the kernel handles interrupts.
We will discuss the IRQ threads (threaded IRQ) that handle the second half of interrupts, the Soft IRQ technique, and the work queue that handles the second half in the kernel.

▣ [Part 2] Timers, synchronization, scheduling, system calls, signals, virtual file systems, and memory management

Covers the operating principles and synchronization techniques (spin locks, mutexes) of how the kernel manages the flow of time.
It explains the detailed implementation of scheduling, which manages the execution flow of multiple processes, and how system calls and signals are handled in the kernel.
It covers how the kernel manages memory and the virtual file system that allows various file systems to coexist and run.


The appendix details how to utilize the Linux kernel mailing list and how to contribute to the Linux kernel.
"]
GOODS SPECIFICS
- Date of issue: May 12, 2020
- Page count, weight, size: 708 pages | 1,350g | 188*240*29mm
- ISBN13: 9791158391980
- ISBN10: 1158391986

You may also like

카테고리