Linux Kernel Programming: Developing kernel architecture and device drivers for character, block, USB, and network interfaces / Программирование ядра Linux: Разработка архитектуры ядра и драйверов устройств для символьных, блочных, USB- и сетевых интерфейсов Год издания: 2025 Автор: Gayet Thierry / Гайе Тьерри Издательство: BPB Publications ISBN: 978-93-65897-913 Язык: Английский Формат: PDF (Not True)/EPUB Качество: Издательский макет или текст (eBook) Интерактивное оглавление: Да Количество страниц: 550 Описание: Linus Torvald released the first version of a kernel in 1991, inspired at the time by both proprietary Unix and the Minix system. Thirty-four years later, this system has evolved with stability and robustness, making it almost indispensable for the DevSecOps community. The Linux kernel forms the robust core of countless systems, from embedded devices to vast data centers, driving unparalleled power and flexibility. This book is your essential guide to deeply understanding this fundamental component and mastering the art of developing high-performance kernel-level code. This book meticulously details the kernel's history, architectural evolution, and custom build processes. You will master device driver fundamentals, distinguishing user from kernel space, and understanding the Linux Device Model (LDM). It explores Linux Security Modules, intricate kernel memory management, and various vital communication interfaces like I2C, SPI, SERIAL, PCI, and RTC. The guide concludes with task/process management, real-time concepts, and essential kernel debugging and profiling. By the end of this book, you will be well-equipped to confidently develop, optimize, and debug kernel-level code. This empowers you to build custom Linux systems, craft efficient device drivers, and troubleshoot complex issues, ready to tackle advanced Linux system programming challenges. You will also be able to better understand this system and develop your own drivers or low-level developments for it. What you will learn ● GNU/Linux kernel history, feature evolution, and licensing. ● Understand and develop your character and block drivers. ● Develop new file systems. ● Manage your systems by communicating with the USB protocol. ● Debug your drivers, your kernel, or any other module in the kernel space. ● Understand the layout of the Linux device model. ● Memory management in the kernel, as well as via DMA or NUMA. ● Implement Linux Security Modules (LSM) and Netfilter stack hooks. Who this book is for This book is for software engineers looking to understand the Linux kernel’s architecture, modify it, and develop custom modules. It also supports project managers, team leaders, and technical managers seeking a clear view of kernel development and capabilities. CISOs and IT managers will benefit from insights into kernel limitations, vulnerabilities, and security measures, such as Linux Security Modules (LSMs). Линус Торвальд выпустил первую версию ядра в 1991 году, вдохновленный в то время как собственной Unix, так и системой Minix. Тридцать четыре года спустя эта система стала стабильной и надежной, что сделало ее практически незаменимой для сообщества разработчиков. Ядро Linux является надежным ядром бесчисленного множества систем, от встраиваемых устройств до огромных центров обработки данных, обеспечивая непревзойденную мощность и гибкость. Эта книга - ваше основное руководство по глубокому пониманию этого фундаментального компонента и овладению искусством разработки высокопроизводительного кода на уровне ядра. В этой книге подробно описывается история ядра, эволюция архитектуры и процессы пользовательской сборки. Вы освоите основы работы с драйверами устройств, научитесь отличать пространство пользователя от пространства ядра и разберетесь в модели устройств Linux (LDM). В нем рассматриваются модули безопасности Linux, сложное управление памятью ядра и различные важные коммуникационные интерфейсы, такие как I2C, SPI, SERIAL, PCI и RTC. В конце руководства рассказывается об управлении задачами/процессами, концепциях реального времени и основных аспектах отладки и профилирования ядра. К концу прочтения этой книги вы будете хорошо подготовлены для уверенной разработки, оптимизации и отладки кода на уровне ядра. Это позволит вам создавать пользовательские Linux-системы, создавать эффективные драйверы устройств и устранять сложные неполадки, а также быть готовым к решению сложных задач системного программирования Linux. Вы также сможете лучше понять эту систему и разработать для нее свои собственные драйверы или низкоуровневые разработки. Что вы узнаете ● История ядра GNU/Linux, эволюция функций и лицензирование. ● Понять и усовершенствовать свои драйверы персонажей и блоков. ● Разрабатывать новые файловые системы. ● Управляйте своими системами, обмениваясь данными по протоколу USB. ● Отлаживайте свои драйверы, ядро или любой другой модуль в пространстве ядра. ● Разбирайтесь в компоновке модели устройства Linux. ● Управление памятью в ядре, а также с помощью DMA или NUMA. ● Внедрение модулей безопасности Linux (LSM) и подключений к стеку Netfilter. Для кого предназначена эта книга Эта книга предназначена для инженеров-программистов, которые хотят разобраться в архитектуре ядра Linux, модифицировать его и разрабатывать пользовательские модули. Она также предназначена для руководителей проектов, руководителей групп и технических менеджеров, которые хотят получить четкое представление о разработке ядра и его возможностях. Руководители CISO и ИТ-менеджеры получат полезную информацию об ограничениях ядра, уязвимостях и мерах безопасности, таких как модули безопасности Linux (LSM).
Примеры страниц (скриншоты)
Оглавление
1. History of the GNU/Linux Kernel Introduction Structure Objectives Inspirations Linux kernel history Evolutions of the several features by release/milestones Early development (1991-1993) Kernel version 1.0 (1994) Kernel version 2.0 (1996) Kernel version 2.2 (1999) Kernel version 2.4 (2001) Kernel version 2.6 (2003) Kernel version 3.0 (2011) Kernel version 4.0 (2015) Kernel version 5.0 (September 2021) Kernel version 6.0 (October 2022) License of the GNU/Linux Conclusion 2. Introduction to the Linux Kernel Introduction Structure Objectives Preparing the work environment Introduction to the kernel Downloading the GNU/Linux kernel sources to recompile them Using distributions’ packages Downloading official tarball from kernel.org Cloning the official Git repo Configuring a custom kernel and modules Building your own kernel Generating a DEB package for Ubuntu/Debian/Mint Packaging for Fedora Core/Red Hat/SUSE Installation Execution and boot sequence Coding styles Conclusion 3. Introduction to Device Drivers Introduction Structure Objectives User space, kernel space, and syscalls interface Driver’s compilation within or outside the kernel Compilation within the GNU/Linux kernel Compilation outside the GNU/Linux kernel Compilation inside Buildroot project Compilation inside Yocto project Kernel facilities and helper functions Error handling Installing modules Loading and unloading dynamic modules Modules dependencies Modules parameters Modules licensing Modules logging Dynamic kernel module support Installation Configuration Functioning Adding DKMS support for a driver Generation for the current kernel Installing a module managed by DKMS Uninstalling a driver managed by DKMS Removing Conclusion 4. Linux Device Model Introduction Structure Objectives Linux device model data structure The bus model Devices connected to the bus The device models The driver model The classes About procfs About the DTB device tree Purpose Compilation command Using U-Boot to Load DTB Conclusion 5. Character Device Drivers Introduction Structure Objectives Types of drivers The mknod command Communication userspace/kernel The udev daemon and the dynamic files First readonly character’s drivers Second readwrite character’s drivers Third ioctl character’s drivers Loading a driver at boot Conclusion 6. Block Drivers and Virtual Filesystem Introduction Structure Objectives The GNU/Linux storage stack The I/O layer The I/O scheduler Overview of Linux I/O schedulers Considerations and choosing a scheduler The block drivers Block Layer components Core operations The virtual file system layer Implement a new filesystem in user/kernel space Communication Conclusion 7. USB Drivers and libusb Introduction Structures Objectives USB architecture USB features USB standards and specifications USB 2.0 standard USB 3.2 standard USB 3.2 generation 2 USB 3.2 generation 2x2 Thunderbolt 3 standard USB 4 standard Advantages and disadvantages of USB Linux USB subsystem Types of endpoint USB transport (IN) algorithm: USB transport (OUT) algorithm Linux USB data struct Enumeration Class drivers Gadget drivers Write a USB driver in userspace using the libusb Conclusion 8. Network Drivers Introduction Structure Objectives History of the network stack Network architecture Protocols layer Network module Network driver loading The sk_buff Performance and tuning The DPDK project Conclusion 9. Linux Security Modules Introduction Structure Objectives Mandatory access control Anatomy of the usual Linux Security Modules Architecture of a Linux Security Module Develop a custom Linux Security Module Conclusion 10. Kernel Memory and DMA Introduction Structure Objectives From physical to virtual memory Non-uniform memory access Userspace commands Methods of memory allocation Functions for memory-level operations Accessing memory using a DMA Conclusion 11. Navigating Linux Communication Interfaces Introduction Structure Objectives 2-Wire interface architecture Usage Serial Peripheral Interface architecture Usage Serial architecture Usage Peripheral Component Interconnect architecture Usage Conclusion 12. Process Management Introduction Structure Objectives Tasks scheduling GNU/Linux and real-time Kthreads Workqueue Locks Conclusion 13. Debugging GNU/Linux Kernel and Drivers Introduction Structure Objectives GNU/Linux kernel debugging options Magic SysRq key Debugging by printing Dynamic debugging kgdb/kdb kernel debugger KDB KGDB Kernel probes Kprobe KRETPROBE OOPS Profiling Conclusion Index
Gayet Thierry / Гайе Тьерри - Linux Kernel Programming / Программирование ядра Linux [2025, PDF/EPUB, ENG] download torrent for free and without registration
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum