Linux Kernel Programming: A comprehensive guide to kernel internals, writing kernel modules, and kernel synchronization (Paperback)

Billimoria, Kaiwan N.

買這商品的人也買了...

相關主題

商品描述

Learn how to write high-quality kernel module code, solve common Linux kernel programming issues, and understand the fundamentals of Linux kernel internals

 

Key Features

  • Discover how to write kernel code using the Loadable Kernel Module framework
  • Explore industry-grade techniques to perform efficient memory allocation and data synchronization within the kernel
  • Understand the essentials of key internals topics such as kernel architecture, memory management, CPU scheduling, and kernel synchronization

 

Book Description

Linux Kernel Programming is a comprehensive introduction for those new to Linux kernel and module development. This easy-to-follow guide will have you up and running with writing kernel code in next-to-no time. This book uses the latest 5.4 Long-Term Support (LTS) Linux kernel, which will be maintained from November 2019 through to December 2025. By working with the 5.4 LTS kernel throughout the book, you can be confident that your knowledge will continue to be valid for years to come.

This Linux book begins by showing you how to build the kernel from the source. Next, you'll learn how to write your first kernel module using the powerful Loadable Kernel Module (LKM) framework. The book then covers key kernel internals topics including Linux kernel architecture, memory management, and CPU scheduling. Next, you'll delve into the fairly complex topic of concurrency within the kernel, understand the issues it can cause, and learn how they can be addressed with various locking technologies (mutexes, spinlocks, atomic, and refcount operators). You'll also benefit from more advanced material on cache effects, a primer on lock-free techniques within the kernel, deadlock avoidance (with lockdep), and kernel lock debugging techniques.

By the end of this kernel book, you'll have a detailed understanding of the fundamentals of writing Linux kernel module code for real-world projects and products.

 

What You Will Learn

  • Write high-quality modular kernel code (LKM framework) for 5.x kernels
  • Configure and build a kernel from source
  • Explore the Linux kernel architecture
  • Get to grips with key internals 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
  • Gain an understanding of kernel concurrency issues
  • Find out how to work with key kernel synchronization primitives

 

Who this book is for

This book is for Linux programmers beginning to find their way with Linux kernel development. Linux kernel and driver developers looking to overcome frequent and common kernel development issues, as well as understand kernel internals, will benefit from this book. A basic understanding of Linux CLI and C programming is required.

商品描述(中文翻譯)

學習如何撰寫高品質的核心模組程式碼,解決常見的Linux核心程式設計問題,並了解Linux核心內部的基礎知識。

主要特點:
- 探索如何使用可載入核心模組框架編寫核心程式碼
- 探索在核心內部進行有效的記憶體配置和資料同步的行業級技術
- 了解核心架構、記憶體管理、CPU排程和核心同步等關鍵內部主題的基礎知識

書籍描述:
《Linux核心程式設計》是一本針對新手介紹Linux核心和模組開發的全面指南。這本易於理解的指南將讓您在短時間內開始撰寫核心程式碼。本書使用最新的5.4長期支援(LTS)Linux核心,該核心將從2019年11月維護到2025年12月。通過在整本書中使用5.4 LTS核心,您可以確信您的知識將在未來多年內持續有效。

本書首先展示了如何從源碼構建核心。接下來,您將學習如何使用強大的可載入核心模組(LKM)框架撰寫第一個核心模組。然後,本書涵蓋了關於Linux核心架構、記憶體管理和CPU排程的關鍵內部主題。接著,您將深入研究核心內部相對複雜的並發性問題,了解它可能引起的問題,以及如何使用各種鎖定技術(互斥鎖、自旋鎖、原子和引用計數運算符)解決這些問題。您還將受益於關於快取效應的更高級材料,以及關於核心內無鎖技術、死結避免(使用lockdep)和核心鎖定調試技術的入門知識。

通過閱讀本書,您將詳細了解撰寫Linux核心模組程式碼的基礎知識,以應用於實際項目和產品。

您將學到什麼:
- 為5.x核心撰寫高品質的模組化核心程式碼(LKM框架)
- 從源碼配置和構建核心
- 探索Linux核心架構
- 掌握核心內部關於記憶體管理的關鍵知識
- 了解並使用各種動態核心記憶體配置/釋放API
- 了解核心內部關於CPU排程的關鍵知識
- 理解核心並發性問題
- 了解如何使用核心同步原語

本書適合對Linux程式設計初步了解並希望進行Linux核心開發的程式設計師。希望克服常見核心開發問題並了解核心內部的Linux核心和驅動程式開發人員也會從本書中受益。需要基本的Linux命令列介面和C程式設計知識。