The Complete Reference to Linux Kernel APIs (2nd Edition) cover

The Complete Reference to Linux Kernel APIs (2nd Edition)

No rating yet
Word count
360 words
Chapters
10
Series
Linux/Unix Technology Series
ISBN
9787111548775

Tags

Summary

This is the second edition of The Complete Reference to Linux Kernel APIs, written based on Linux kernel source code version 3.19.3. It systematically summarizes the API interfaces most commonly used in kernel development and provides typical verification programs for these interfaces, allowing theoretical analysis and practical programming to corroborate each other. The book is organized by kernel functional modules, covering in ten chapters the kernel module mechanism API, process management kernel API, process scheduling kernel API, interrupt and exception mechanism kernel API, time and timer mechanism kernel API, memory management kernel API, kernel synchronization mechanism API, file system kernel API, and device driver and device management module kernel API. Each chapter first explains the module's position and role in the kernel, then introduces each interface in alphabetical order by function name, giving the prototype, parameters, return value, and usage scenarios, along with a small compilable and runnable example for reference and experimentation. Compared with the first edition (based on the 2.6.30 kernel), this edition rewrites and adds a large number of interfaces as the kernel version has advanced, supplementing new usage patterns such as interrupt threading, tasklets, wait queues, completions, and slab and mempool allocation. The book is suitable as a desk reference to consult as needed, or for chapter-by-chapter practice alongside reading kernel source code.

Editor's review

内核编程的难点,一半在于理解内核的运行机制,另一半在于找对接口。市面上的内核书大多讲原理,真要动手写模块时,还得回到源码里翻 grep 结果。这本书做的正是「把散的接口收拢成册」这件事:按模块分章,章内按函数名排序,每个函数给出原型、参数含义、返回值和一段可运行的验证代码,查一个函数只需要几十秒。第2版把内核基线从2.6.30推到了3.19.3,等待队列、完成量、tasklet、中断线程化这些日常高频接口都换成了新写法,旧版里过时的示例不再误导人。它更像一本字典而不是教程,配上源码与实验环境使用效率最高。入门读者可以从第1章的编译模板和 printk 起步,把第一个模块跑起来,再按章节顺序做验证程序;有经验的驱动开发者则可以直接跳到对应模块查函数。放在书桌边随手翻,比每次开电脑搜源码更省心。

Who it's for

A good fit for

  • 需要频繁查阅内核接口原型的驱动与内核模块开发者
  • 正在学习操作系统课程、想做内核实验的本科生与研究生
  • 从用户态编程转向内核态编程、需要系统性补齐 API 认知的工程师
  • 嵌入式 Linux 开发者,需在特定硬件平台上快速验证内核接口

Not a good fit for

  • 完全没有 C 语言与操作系统基础、只想了解 Linux 使用技巧的初学者
  • 期待系统讲解内核调度器、内存管理算法原理的读者,本书偏接口手册而非原理教材
  • 需要针对 5.x/6.x 新内核对齐接口的开发者,需另行查阅最新源码与文档

Reading tips

  1. 先按第1章把模块编译模板与 printk 调试跑通,准备一台可编译内核的虚拟机或实验板,再进入后续章节。
  2. 把本书当字典用:按项目需要用哪个模块就查哪一章,每个函数跟着敲一遍验证程序,比通读更有效。
  3. 读函数说明时对照同版本内核源码(3.19.3)看实现,注意本书接口与当前内核版本的差异,遇到变更以源码和官方文档为准。
  4. 每章末尾的参考文献可作延伸阅读,配合 LWN、内核文档与源码注释理解设计动机。

About the publisher

China Machine Press China · Founded in 1950

In addition to science and technology and professional publishing, the books in our catalog from China Machine Press also reflect a sustained focus on psychology, computing, management, finance and economics, and social sciences. In psychology, the catalog includes works by C. G. Jung and introductions to analytical psychology, as well as applied topics such as stress and health, and addiction and healing. In computing, it features Structure and Interpretation of Computer Programs (JavaScript Edition). Management and finance titles include Administrative Behavior (4th Edition), The Price of Inequality (Collector's Edition), and This Time Is Different: Eight Centuries of Financial Folly (Commemorative Edition). In the philosophy and history of science, there is The Worldview: The Third Edition. Relevant authors include C. G. Jung, William McGuire, Sonu Shamdasani, and Gabor Maté. Public information is limited; the above summarizes the publisher's profile based solely on the books in our catalog.

Contents

  1. Chapter 1 Essential Knowledge for Linux Kernel API Analysis (Precautions for Linux Kernel Programming, Module Compilation Makefile Template, Kernel Debugging Function printk, Kernel Compilation and Customization)
  2. Chapter 2 Kernel Module Mechanism API
  3. Chapter 3 Linux Process Management Kernel API
  4. Chapter 4 Linux Process Scheduling Kernel API
  5. Chapter 5 Linux Interrupt Mechanism Kernel API
  6. Chapter 6 Linux Memory Management Kernel API
  7. Chapter 7 Linux Kernel Timer Mechanism API
  8. Chapter 8 Linux Kernel Synchronization Mechanism API
  9. Chapter 9 Linux File System Kernel API
  10. Chapter 10 Linux Device Drivers and Device Management API

FAQ

这本书第2版和第1版有什么区别?
第1版2011年出版,基于内核2.6.30,作者为邱铁、周玉、邓莹莹;第2版2016年出版,基于内核3.19.3,作者为邱铁、周玉、陈晨,接口与示例按新内核重写,并归入「Linux/Unix技术丛书」。
书里的示例能在新内核上直接编译吗?
本书基于3.19.3。多年之后的内核在部分函数签名、头文件与接口上已有变化,直接编译可能报错。建议在对应版本的源码树或虚拟机上验证,移植到新内核时以官方文档和源码为准。
这本书适合当教材系统学习内核吗?
它更偏接口参考手册和实验指南,原理推导较少。适合配合操作系统教材、内核源码阅读一起用;若要系统理解调度、内存管理机制,还需另找原理类著作。
阅读前需要哪些基础?
需要扎实的C语言功底,了解进程、内存、中断、文件系统等操作系统基本概念,并会使用 make、GCC 与基本的 Linux 命令行;有驱动或嵌入式开发经验会更顺畅。

Comments

Find this book

This site is an index: you start “Search all sources” in your browser, and the entries it lists all point to third-party sites; please judge their availability yourself.

About the author

Chen Chen Author · China · 1985

Chen Chen, born in 1985, holds a PhD from Nankai University and is an associate professor at the School of History and Culture of Tianjin Normal University, where he also directs the Museum and Art Appreciation Research Center. A former curator at the Tianjin Museum, he has been a speaker on CCTV's Lecture Room. His research covers museum exhibition planning and the authentication of ancient painting and calligraphy, and he has published more than twenty monographs, including How to Understand a Museum and The Seven Prisms of Ancient Painting. Seven of his works are held in the library, spanning a wide range of subjects: The Roots of Brazil in world history; studies on migrant populations in China's urbanization, social psychology, and health prevention; documentary and political works such as No. 6 Xinyuyangli: The Starting Point of the Communist Youth League of China; and titles such as For Your Own Good that reflect on social realities. His writing combines scholarship with public communication, turning specialized knowledge into clear narratives for general readers.

More by the same author

Top rated in the same category