Linux Kernel Programming

4.2 (5 reviews total)
By Kaiwan Billimoria
    What do you get with a Packt Subscription?

  • Instant access to this title and 7,500+ eBooks & Videos
  • Constantly updated with 100+ new titles each month
  • Breadth and depth in over 1,000+ technologies
  1. Free Chapter
    Kernel Workspace Setup
About this book

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.

You’ll start the journey by learning how to build the kernel from the source. Next, you’ll write your first kernel module using the powerful Loadable Kernel Module (LKM) framework. The following chapters will cover key kernel internals topics including Linux kernel architecture, memory management, and CPU scheduling.

During the course of this book, 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.

Publication date:
March 2021

Section 1: The Basics

Here, you will learn how to perform basic kernel development tasks. You will set up a kernel development workspace, build a Linux kernel from source, learn about the LKM framework, and write a "Hello, world" kernel module.

This section comprises the following chapters:

  • Chapter 1, Kernel Workspace Setup
  • Chapter 2Building the 5.x Linux Kernel from Source, Part 1
  • Chapter 3Building the 5.x Linux Kernel from Source, Part 2
  • Chapter 4Writing Your First Kernel Module – LKMs Part 1
  • Chapter 5, Writing Your First Kernel Module – LKMs Part 2

We highly recommend you also make use of this book's companion guide, Linux Kernel Programming (Part 2).

It's an excellent industry-aligned beginner's guide to writing misc character drivers, performing I/O on peripheral chip memory and handling...

About the Author
  • Kaiwan 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.

    Browse publications by this author
Latest Reviews (5 reviews total)
This survey ***** with the lock in before you can exit.
Excellent livre, bien écrit, il comble une lacune en la matière. Je retire une étoile en raison de la typographie trop petite des commentaires (Info et TIP), liens hypertextes et commandes.
Sehr guter Content, benutze die Bücher zur Unterstützung bei der Entwicklung von Treibern und Erweiterung des Verständnis des Linux - Kernels, konkret bei Elementaty OS ( Odin )
Linux Kernel Programming
Unlock this book and the full library FREE for 7 days
Start now