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

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

Linux Kernel Programming: A comprehensive guide to kernel sale internals, writing kernel online sale modules, and kernel synchronization online
Linux Kernel Programming: A comprehensive guide to kernel sale internals, writing kernel online sale modules, and kernel synchronization online__right

Description

Product Description

Learn how to write high-quality kernel module code, solve common Linux kernel programming issues, and understand the fundamentals of Linux kernel internals

Key Features

  • Discover how to write kernel code using the Loadable Kernel Module framework
  • Explore industry-grade techniques to perform efficient memory allocation and data synchronization within the kernel
  • Understand the essentials of key internals topics such as kernel architecture, memory management, CPU scheduling, and kernel synchronization

Book Description

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 Linux book begins by showing you how to build the kernel from the source. Next, you''ll learn how to write your first kernel module using the powerful Loadable Kernel Module (LKM) framework. The book then covers key kernel internals topics including Linux kernel architecture, memory management, and CPU scheduling. Next, 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.

What you will learn

  • Write high-quality modular kernel code (LKM framework) for 5.x kernels
  • Configure and build a kernel from source
  • Explore the Linux kernel architecture
  • Get to grips with key internals regarding memory management within the kernel
  • Understand and work with various dynamic kernel memory alloc/dealloc APIs
  • Discover key internals aspects regarding CPU scheduling within the kernel
  • Gain an understanding of kernel concurrency issues
  • Find out how to work with key kernel synchronization primitives

Who this book is for

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.

Table of Contents

  1. Kernel Workspace Setup
  2. Building the 5.0 Linux kernel from Source, Part 1
  3. Building the 5.0 Linux kernel from Source, Part 2
  4. Writing your First Kernel Module, Part 1
  5. Writing your First Kernel Module - Part 2
  6. Kernel Internals Essentials - Processes and Threads
  7. Memory Management Internals - Essentials
  8. Kernel Memory Allocation for Module Authors, Part 1
  9. Kernel Memory Allocation for Module Authors - Part 2
  10. The CPU Scheduler - Part 1
  11. The CPU Scheduler - Part 2
  12. Kernel Synchronization - Part 1
  13. Kernel Synchronization - Part 2

About the Author

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.

Product information

Brief content visible, double tap to read full content.
Full content visible, double tap to read brief content.

Videos

Help others learn more about this product by uploading a video!
Upload video
Brief content visible, double tap to read full content.
Full content visible, double tap to read brief content.

Customers who bought this item also bought

Customer reviews

4.8 out of 54.8 out of 5
22 global ratings

Top reviews from the United States

Donald A. Tevault
5.0 out of 5 stars
Lots of good info, easy to read
Reviewed in the United States on March 31, 2021
Okay, I do need to disclose that I was one of the technical reviewers for this book, and that I''m also a fellow Packt Publishing author. Reviewing the book was a fun project, which I really enjoyed. There''s a lot of good information here, and lots of hands-on projects for... See more
Okay, I do need to disclose that I was one of the technical reviewers for this book, and that I''m also a fellow Packt Publishing author. Reviewing the book was a fun project, which I really enjoyed. There''s a lot of good information here, and lots of hands-on projects for both x86_64 and Raspberry Pi. The author writes in a clear, concise, and conversational style that makes the material really easy to digest.

If you have a good foundation of C programming knowledge and want to get into Linux kernel programming, you''ll definitely want to check this book out.
6 people found this helpful
Helpful
Report
Ravi
5.0 out of 5 stars
Deep dive into Linux Kernel Architecture
Reviewed in the United States on March 23, 2021
Have you been wanting to figure out the innards of the Linux kernel without getting overwhelmed or have been working without enough context to actually understanding it, here is a fantastic book. If you are fascinated with operating systems and new to it, if you... See more
Have you been wanting to figure out the innards of the Linux kernel without getting overwhelmed or have been working without enough context to actually understanding it, here is a fantastic book.

If you are fascinated with operating systems and new to it, if you have wondered what terms like system calls, timers, threads mean and how they are developed? This book is for you.

Major subsystems and features of the Linux kernel like System calls, Memory Management, Loadable Kernel Module framework, Kernel config, Virtual Address Space, Page Cache and Kernel build(for x86 and ARM) are detailed very well in the book. The delivery through both practical and theoretical focus, can meet the expectations of both professional and academic needs.

When used along with Linux kernel documentation, this book is bound to provide a deeper, well structured understanding of Linux kernel architecture.

Yet to complete reading the entire book and I''m sure that it will keep me interested.
One person found this helpful
Helpful
Report
Anil Kumar
5.0 out of 5 stars
Comprehensive guide to Linux internals , LKM and kernel synchronization
Reviewed in the United States on March 22, 2021
If you are looking for a comprehensive guide to Linux kernel and it’s configuration for a custom platform, I highly recommend this book. The book is very detailed and comes with the Github source base with a lot of sample codes to assist you. Disclaimer: I have... See more
If you are looking for a comprehensive guide to Linux kernel and it’s configuration for a custom platform, I highly recommend this book. The book is very detailed and comes with the Github source base with a lot of sample codes to assist you.

Disclaimer: I have helped with the technical review of this book.
One person found this helpful
Helpful
Report
_Jayakumar
5.0 out of 5 stars
Excellent start for Linux Kernel Programming
Reviewed in the United States on August 18, 2021
Good book for beginners trying to get into Linux Kernel programming, the requirement is to know foundations of C Programming. Author slowly progresses from the basic setup, resource utilization, makefiles to writing scheduling programs. Overall a great book to start with... See more
Good book for beginners trying to get into Linux Kernel programming, the requirement is to know foundations of C Programming. Author slowly progresses from the basic setup, resource utilization, makefiles to writing scheduling programs. Overall a great book to start with and definitely will understand a lot of Linux kernel intricacies.
One person found this helpful
Helpful
Report

Top reviews from other countries

Andreas Hecht
5.0 out of 5 starsVerified Purchase
Excellent book on Linux Kernel Programming
Reviewed in Germany on May 30, 2021
This book covers the vast field that is Linux Kernel Programming with sufficient amount of detail needed for module/driver development. The book is a hands-on guide as each chapter features example code, designed to illustrate the presented topics, which you can try out for...See more
This book covers the vast field that is Linux Kernel Programming with sufficient amount of detail needed for module/driver development. The book is a hands-on guide as each chapter features example code, designed to illustrate the presented topics, which you can try out for yourself. Along with the code come questions (with solutions), exercises and a very well composed ''Further Reading'' list, all of which you can download from the books GitHub repository. The book starts with fundamentals such as ''Building the Linux Kernel from Source'' and ''Writing Your First Kernel Module'' and leads to advanced topics such as memory management, scheduling and synchronization/concurrency. Thanks to the easy to follow instructions, this book is for anyone with a minimal amount of experience with Linux, C and embedded-/low-level-programming. Aside from the sound technical expertise this book brings to the table, it is written in a style that is inspiring and motivational. This book is actually fun to read and I would recommend it to anyone who would like to learn the skills and knowledge needed to become a Linux Kernel developer.
2 people found this helpful
Report
See all reviews
Brief content visible, double tap to read full content.
Full content visible, double tap to read brief content.

Customers who viewed this item also viewed

Brief content visible, double tap to read full content.
Full content visible, double tap to read brief content.

More items to explore

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

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

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

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

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

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

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

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

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