This is the code repository for Linux Kernel Programming, published by Packt.
Linux Kernel Programming, published by Packt
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.
This book covers the following exciting features:
If you feel this book is for you, get your copy today!
<img src="https://raw.githubusercontent.com/PacktPublishing/GitHub/master/GitHub.png" alt="https://www.packtpub.com/" border="5" />
All of the code is organized into folders. For example, ch2.
The code will look like the following:
static int __init miscdrv_init(void)
{
int ret;
struct device *dev;
Following is what you need for this book: This book is for Linux programmers beginning to find their way with Linux kernel development. Linux kernel and driver developers looking to overcome frequent and common kernel development issues, as well as understand kernel internals, will benefit from this book. A basic understanding of Linux CLI and C programming is required.
With the following software and hardware list you can run all code files present in the book (Chapter 1-13).
Chapter | Software required | OS required |
---|---|---|
1-13 | Oracle VirtualBox 6.1 | Windows and Linux (Any) |
We also provide a PDF file that has color images of the screenshots/diagrams used in this book. Click here to download it.
Wrt the PDF doc:
pg 324: in Figure 7.4, the third column 'Addr Bits', last 3 rows have errors; the corrections are shown here:
`AB VM-split`
x86_64: 5 : 56 --> 57 : 64PB:64PB : corrected (allows for total of 128 PB)
Aarch64: 3 : 39 --> 40 : 512G:512G : corrected (allows for total of 1024 GB = 1 TB)
Aarch64: 4 : 48 --> 49 : 256T:256T : corrected (allows for total of 512 T)
pg 385:
pg 388:
pg 656: the line 'In place of atomic64_dec_if_positive(), use atomic64_dec_if_positive()' should be 'In place of atomic_dec_if_positive(), use atomic64_dec_if_positive()' (thanks to @xuhw21)
pg 661:
pg 665:
"The material in this section assumes you have at least a base understanding of accessing
peripheral device (chip) memory and registers; we have covered this in detail in
Chapter 13, Working with Hardware I/O Memory. Please ensure that you understand it before moving forward.
should be
"The material in this section assumes you have at least a base understanding of accessing
peripheral device (chip) memory and registers; we have covered this in detail in
Linux Kernel Programming Part 2 - Chapter 3, Working with Hardware I/O Memory.
Please ensure that you understand it before moving forward."
pg 183 : Wiring to the console should be Writing to the console
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. It doesn't hurt that he is a recreational ultrarunner too.
If you have already purchased a print or Kindle version of this book, you can get a DRM-free PDF version at no cost.
Simply click on the link to claim your free PDF.