Reader small image

You're reading from  Linux Kernel Programming - Second Edition

Product typeBook
Published inFeb 2024
PublisherPackt
ISBN-139781803232225
Edition2nd Edition
Tools
Right arrow
Author (1)
Kaiwan N. Billimoria
Kaiwan N. Billimoria
author image
Kaiwan N. Billimoria

Kaiwan N. Billimoria taught himself BASIC programming on his dad's IBM PC back in 1983. He was programming in C and Assembly on DOS until he discovered the joys of Unix, and by around 1997, Linux! Kaiwan has worked on many aspects of the Linux system programming stack, including Bash scripting, system programming in C, kernel internals, device drivers, and embedded Linux work. He has actively worked on several commercial/FOSS projects. His contributions include drivers to the mainline Linux OS and many smaller projects hosted on GitHub. His Linux passion feeds well into his passion for teaching these topics to engineers, which he has done for well over two decades now. He's also the author of Hands-On System Programming with Linux, Linux Kernel Programming (and its Part 2 book) and Linux Kernel Debugging. It doesn't hurt that he is a recreational ultrarunner too.
Read more about Kaiwan N. Billimoria

Right arrow

What’s been added in the second edition?

A pretty huge amount of new material has been added into this, the Second Edition of the Linux Kernel Programming book. As well, being based on the very recent (as of this writing) 6.1 LTS release, its information and even code will remain industry-relevant for many, many years to come.

Here’s a quick chapter-wise summarization of what’s new in this second edition:

  • Materials updated for the 6.1 LTS kernel, maintained until December 2026, and until August 2033 via the CLP (6.1 SLTS)!
  • Updated, new, and working code for the 6.1 LTS kernel
  • Several new info-rich sections added to most chapters, many new diagrams, and new code examples to help explain concepts better
  • Chapter 1, Linux Kernel Programming – A Quick Introduction
    • Introduction to the book
  • Chapter 2, Building the 6.x Linux Kernel from Source – Part 1
    • The new LTS kernel lifetime mandate
    • More details on the kernel’s Kconfig+Kbuild system
    • Updated approaches on configuring the kernel
  • Chapter 3, Building the 6.x Linux Kernel from Source – Part 2
    • More details on the initramfs (initrd) image
    • Cross-compiling the kernel on an x86_64 host to an AArch64 target
  • Chapter 4, Writing Your First Kernel Module – Part 1
    • new-ish printk indexing feature covered
    • Powerful kernel dynamic debug feature introduced
    • Rate-limiting macros updated (deprecated ones not used)
  • Chapter 5, Writing Your First Kernel Module – Part 2
    • A better, ‘better’ Makefile (v0.2)
  • Chapter 6, Kernel Internals Essentials – Processes and Threads
    • New linked list demo module
  • Chapter 7, Memory Management Internals – Essentials
    • New coverage on how address translation works (including diagrams)
  • Chapter 8, Kernel Memory Allocation for Module Authors – Part 1
    • Coverage on using the “exact” page allocator API pair
    • FAQs regarding (slab) memory usage and their answers
    • The graphing demo (via gnuplot) is now automated and even saved to an image file, via a helper script
    • Finding internal fragmentation (wastage) within the kernel
  • Chapter 9, Kernel Memory Allocation for Module Authors – Part 2
    • Extracting useful information regarding slab caches
    • A word on slab shrinkers
    • Better coverage on the OOM killer (and systemd-oomd) and how it’s triggered; includes a flowchart depicting demand-paging and possible OOM killer invocation
    • Better coverage on kernel page reclaim, as well as the new MGLRU and DAMON technologies
  • Chapter 10, The CPU Scheduler – Part 1
    • New coverage on CFS scheduling period and timeslice. Coverage on the thread_info structure as well
    • New: the preempt dynamic feature
    • Enhanced coverage on exactly how and when schedule() is invoked
  • Chapter 11, The CPU Scheduler – Part 2
    • Much more depth in the powerful cgroups (v2) coverage plus an interesting script to let you explore its content
    • Leveraging the cgroups v2 CPU controller via both systemd and manually to perform CPU bandwidth allocation
    • A note on Google’s ghOSt OS
  • Chapter 12, Kernel Synchronization – Part 1
    • A new intro to the LKMM (Linux Kernel Memory Model)
    • More on locking plus deadlock avoidance guidelines
  • Chapter 13, Kernel Synchronization – Part 2
    • Expanded coverage on CPU caching and cache effects
    • New coverage on the powerful lock-free RCU synchronization technology
  • Online Chapter, Kernel Workspace Setup
    • Fixed errors in package names and versions
    • Ubuntu-based helper script that auto-installs all required packages

Most (if not all) earlier code errors, typos, and URLs are now fixed, based on prompt feedback, raising Issues/PRs on the book’s GitHub repo, from you, our wonderful readers!

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Linux Kernel Programming - Second Edition
Published in: Feb 2024Publisher: PacktISBN-13: 9781803232225

Author (1)

author image
Kaiwan N. Billimoria

Kaiwan N. Billimoria taught himself BASIC programming on his dad's IBM PC back in 1983. He was programming in C and Assembly on DOS until he discovered the joys of Unix, and by around 1997, Linux! Kaiwan has worked on many aspects of the Linux system programming stack, including Bash scripting, system programming in C, kernel internals, device drivers, and embedded Linux work. He has actively worked on several commercial/FOSS projects. His contributions include drivers to the mainline Linux OS and many smaller projects hosted on GitHub. His Linux passion feeds well into his passion for teaching these topics to engineers, which he has done for well over two decades now. He's also the author of Hands-On System Programming with Linux, Linux Kernel Programming (and its Part 2 book) and Linux Kernel Debugging. It doesn't hurt that he is a recreational ultrarunner too.
Read more about Kaiwan N. Billimoria