“This book offers a modern and thorough introduction to Linux kernel development for the 6.x series. It includes hard-to-find insights and low-level coverage. It's a strong recommendation for beginners and a helpful refresher for experienced kernel developers.”
Roman Storozhenko, Senior Linux Kernel Developer at Intel Corporation, Linux Kernel Contributor, Firmware Engineer, Intel® Xeon® RDT Expert & Contributor
Gain a solid practical understanding and sufficient theoretical insight into Linux kernel internals while learning to write high-quality kernel module code and understanding the complexities of kernel synchronization
Purchase of the print or Kindle book includes a free eBook in PDF format.
Key FeaturesDiscover how to write Linux kernel and module code for real-world products on the 6.1 LTS kernelImplement industry-grade techniques in real-world scenarios for fast, efficient memory allocation and data synchronizationUnderstand and exploit kernel architecture, CPU scheduling, and kernel synchronization techniquesBook DescriptionThe 2nd Edition of Linux Kernel Programming is an updated, comprehensive guide for those new to Linux kernel development. Built around the latest 6.1 Long-Term Support (LTS) Linux kernel, it explores key features and enhancements. With the Civil Infrastructure Project extending support for the 6.1 Super LTS (SLTS) kernel until August 2033, this book will remain relevant for years to come.
You'll learn how to build the Linux kernel from source and write your first kernel module using the powerful Loadable Kernel Module (LKM) framework. You'll also explore concurrency and synchronization/locking technologies, including mutexes, spinlocks, atomic/refcount operators, rw-spinlocks, per-CPU, and RCU.
By the end, you'll have a strong foundation for writing Linux kernel and kernel module code for real-world projects and products.
What you will learnConfigure and build the 6.1 LTS kernel from sourceWrite high-quality modular kernel code (LKM framework) for 6.x kernelsExplore modern Linux kernel architectureUnderstand and work with various dynamic kernel memory alloc/dealloc APIsDiscover key internals aspects regarding CPU scheduling within the kernel, including cgroups v2Gain a deeper understanding of kernel concurrency issuesLearn how to work with key kernel synchronization primitivesWho this book is forThis 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.
Table of ContentsLinux Kernel Programming – A Quick IntroductionBuilding the 6.x Linux Kernel from Source - Part 1Building the 6.x Linux Kernel from Source - Part 2Writing Your First Kernel Module - Part 1Writing Your First Kernel Module - Part 2Kernel Internals Essentials - Processes and ThreadsMemory Management Internals - EssentialsKernel Memory Allocation for Module Authors - Part 1Kernel Memory Allocation for Module Authors - Part 2The CPU Scheduler - Part 1The CPU Scheduler - Part 2Kernel Synchronization - Part 1Kernel Synchronization - Part 2
Could be summed up with this phrase from a chapter in the second half of the book: “It’s completely pointless to simply repeat the details within the kernel docs (…) So, it´s important to learn how to effectively persue the kernel docs (we talked about this briefly in…)” Well, then what’s the point in writing or buying such a book, I guess? Also, there’s too many advanced topics you would assume to be covered in such a book where the author just gives up, saying: “But this is outside of the scope of this book.” Don’t expect anything related to debugging, networking, USB or pretty much any type of driver subsystem in general. The author has just had ads put there for the other books he has written too. Even synchronization mechanisms are to be covered entirely only in his other book on drivers. Not sure I would be into these after this experience, though.
Overall the book tends to stay on the surface and the information put there is very, very much redundant. For each topic you get two paragraphs summing up what was covered when explaining the last one, then an obligatory paragraph reading: “Interested in knowing more? Do read on!” just to arrive to completely useless sentences like: “Not so quickly, though! This is covered on the next page.” You then discover that the piece of information is presented in an info box, repeated later in a normal paragraph and then re-repeated again just so that you’re really made to remember. Oh and not to mention obligatory ending pages where everything what was learned is summed up just like everything what you WILL learn is summed up upfront on the first page of every chapter, right before the repetition of how to set up your VM to try that on your own (that’s actually covered in each chapter over and over).
Without the filling that made the book an almost 800-page bible, this could have pretty well been a 300-page handbook. The topics are interesting and quite well chosen but, well… Reading through it could have been much less frustrating than that.