Linux Kernel Programming, 2nd Edition: A comprehensive and practical guide to kernel internals, writing modules, and kernel synchronization / Программирование ядра Linux, 2-е издание: Полное практическое руководство по внутреннему устройству ядра, написанию модулей и синхронизации ядра. Год издания: 3024 Автор: Billimoria Kaiwan / Биллимория Кайван Издательство: Packt Publishing ISBN: 978-1-80323-222-5 Серия: Expert insight Язык: Английский Формат: PDF, EPUB Качество: Издательский макет или текст (eBook) Интерактивное оглавление: Да Количество страниц: 827 Описание: Gain both a firm practical understanding and sufficient theoretical insight into the inner workings of Linux kernel internals, learn to write high-quality kernel module code, understand the complexities of kernel synchronization Key Features: Discover how to write Linux kernel and module code for real-world products Implement industry-grade techniques in real-world scenarios for fast, efficient memory allocation and data synchronization Understand and exploit kernel architecture, CPU scheduling, and kernel synchronization techniques Book Description: The 2nd Edition of Linux Kernel Programming is an updated, comprehensive guide for new programmers to the Linux kernel. This book uses the recent 6.1 Long-Term Support (LTS) Linux kernel series, which will be maintained until Dec 2026, and also delves into its many new features. Further, the Civil Infrastructure Project has pledged to maintain and support this 6.1 Super LTS (SLTS) kernel right until August 2033, keeping this book valid for years to come! You’ll begin this exciting journey by learning how to build the kernel from source. In a step by step manner, you will then learn how to write your first kernel module by leveraging the kernel’s powerful Loadable Kernel Module (LKM) framework. With this foundation, you will delve into key kernel internals topics including Linux kernel architecture, memory management, and CPU (task) scheduling. You’ll finish with understanding the deep issues of concurrency, and gain insight into how they can be addressed with various synchronization/locking technologies (e.g., mutexes, spinlocks, atomic/refcount operators, rw-spinlocks and even lock-free technologies such as per-CPU and RCU). By the end of this book, you’ll have a much better understanding of the fundamentals of writing the Linux kernel and kernel module code that can straight away be used in real-world projects and products. What You Will Learn: Configure and build the 6.1 LTS kernel from source Write high-quality modular kernel code (LKM framework) for 6.x kernels Explore modern Linux kernel architecture Get to grips with key internals details regarding memory management within the kernel Understand and work with various dynamic kernel memory alloc/dealloc APIs Discover key internals aspects regarding CPU scheduling within the kernel, including cgroups v2 Gain a deeper understanding of kernel concurrency issues Learn how to work with key kernel synchronization primitives Who this book is for: This book is for beginner Linux programmers and developers looking to get started with the Linux kernel, providing a knowledge base to understand required kernel internal topics and overcome frequent and common development issues. A basic understanding of Linux CLI and C programming is assumed. Получите как четкое практическое представление, так и достаточное теоретическое представление о внутренней работе ядра Linux, научитесь писать высококачественный код модуля ядра, разберетесь в сложностях синхронизации ядра. Kлючевые функции: Узнайте, как писать ядро Linux и модульный код для реальных продуктов Применяйте передовые технологии в реальных сценариях для быстрого и эффективного выделения памяти и синхронизации данных Разбирайтесь в архитектуре ядра, планировании процессора и методах синхронизации ядра и используйте их. Описание книги: 2-е издание книги "Программирование ядра Linux" представляет собой обновленное, всеобъемлющее руководство по ядру Linux для начинающих программистов. В этой книге используется новейшая серия ядер Linux с долгосрочной поддержкой (LTS) версии 6.1, которая будет поддерживаться до декабря 2026 года, а также рассматриваются многие ее новые функции. Кроме того, проект гражданской инфраструктуры обязался поддерживать это ядро версии 6.1 Super LTS (SLTS) вплоть до августа 2033 года, что позволит сохранить актуальность этой книги на долгие годы вперед! Вы начнете это увлекательное путешествие с изучения того, как создавать ядро из исходного кода. Затем, шаг за шагом, вы узнаете, как написать свой первый модуль ядра, используя мощную платформу ядра Loadable Kernel Module (LKM). С помощью этой основы вы познакомитесь с ключевыми внутренними разделами ядра, включая архитектуру ядра Linux, управление памятью и планирование процессора (задач). Вы закончите с пониманием глубоких проблем параллелизма и получите представление о том, как их можно решить с помощью различных технологий синхронизации/ блокировки (например, мьютексов, спин-блокировок, операторов атомарного/ повторного подсчета, rw-спин-блокировок и даже технологий без блокировок, таких как per-CPU и RCU). К концу прочтения этой книги вы будете гораздо лучше понимать основы написания ядра Linux и кода модулей ядра, который сразу же можно будет использовать в реальных проектах и продуктах. Чему вы научитесь: Настройте и соберите ядро 6.1 LTS из исходных текстов Напишите высококачественный модульный код ядра (LKM framework) для ядер 6.x Изучите современную архитектуру ядра Linux Ознакомьтесь с ключевыми внутренними деталями, касающимися управления памятью в ядре Разберитесь в различных API распределения/освобождения динамической памяти ядра и работайте с ними Познакомьтесь с ключевыми внутренними аспектами, касающимися планирования процессора в ядре, включая cgroups v2 Получите более глубокое представление о проблемах параллелизма ядра Узнайте, как работать с ключевыми примитивами синхронизации ядра Для кого предназначена эта книга: Эта книга предназначена для начинающих Linux-программистов и разработчиков, желающих начать работу с ядром Linux, и содержит базу знаний, позволяющую разобраться во внутренних разделах ядра и преодолеть частые и распространенные проблемы разработки. Предполагается базовое понимание интерфейса командной строки Linux и программирования на C.
Примеры страниц (скриншоты)
Оглавление
Preface xxiii Chapter 1: Linux Kernel Programming – A Quick Introduction 1 Chapter 2: Building the 6.x Linux Kernel from Source – Part 1 5 Chapter 3: Building the 6.x Linux Kernel from Source – Part 2 77 Chapter 4: Writing Your First Kernel Module – Part 1 125 Chapter 5: Writing Your First Kernel Module – Part 2 187 Chapter 6: Kernel Internals Essentials – Processes and Threads 257 Chapter 7: Memory Management Internals – Essentials 301 Chapter 8: Kernel Memory Allocation for Module Authors – Part 1 369 Chapter 9: Kernel Memory Allocation for Module Authors – Part 2 433 Chapter 10: The CPU Scheduler – Part 1 497 Chapter 11: The CPU Scheduler – Part 2 549 Chapter 12: Kernel Synchronization – Part 1 601 Chapter 13: Kernel Synchronization – Part 2 667 Other Books You May Enjoy 769 Index 773
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