Jump to ratings and reviews
Rate this book

Linux Kernel Programming: A comprehensive and practical guide to kernel internals, writing modules, and kernel synchronization

Rate this book
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

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 productsImplement 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 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 learnConfigure and build the 6.1 LTS kernel from sourceWrite high-quality modular kernel code (LKM framework) for 6.x kernelsExplore modern Linux kernel architectureGet to grips with key internals details regarding memory management within the kernelUnderstand 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

1453 pages, Kindle Edition

Published February 29, 2024

8 people are currently reading
16 people want to read

About the author

Kaiwan Billimoria

1 book1 follower

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
1 (25%)
4 stars
2 (50%)
3 stars
0 (0%)
2 stars
1 (25%)
1 star
0 (0%)
Displaying 1 of 1 review
Profile Image for Tereza.
1 review
November 1, 2025
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.
Displaying 1 of 1 review

Can't find what you're looking for?

Get help and learn more about the design.