Linux Device Drivers Development

Learn to develop customized device drivers for your embedded Linux system
Preview in Mapt

Linux Device Drivers Development

John Madieu

17 customer reviews
Learn to develop customized device drivers for your embedded Linux system
Mapt Subscription
FREE
$29.99/m after trial
eBook
$18.00
RRP $35.99
Save 49%
Print + eBook
$44.99
RRP $44.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$18.00
$44.99
$29.99 p/m after trial
RRP $35.99
RRP $44.99
Subscription
eBook
Print + eBook
Start 14 Day Trial

Frequently bought together


Linux Device Drivers Development Book Cover
Linux Device Drivers Development
$ 35.99
$ 18.00
Mastering Linux Kernel Development Book Cover
Mastering Linux Kernel Development
$ 39.99
$ 20.00
Buy 2 for $35.00
Save $40.98
Add to Cart

Book Details

ISBN 139781785280009
Paperback586 pages

Book Description

Linux kernel is a complex, portable, modular and widely used piece of software, running on around 80% of servers and embedded systems in more than half of devices throughout the World. Device drivers play a critical role in how well a Linux system performs. As Linux has turned out to be one of the most popular operating systems used, the interest in developing proprietary device drivers is also increasing steadily.

This book will initially help you understand the basics of drivers as well as prepare for the long journey through the Linux Kernel. This book then covers drivers development based on various Linux subsystems such as memory management, PWM, RTC, IIO, IRQ management, and so on. The book also offers a practical approach on direct memory access and network device drivers.

By the end of this book, you will be comfortable with the concept of device driver development and will be in a position to write any device driver from scratch using the latest kernel version (v4.13 at the time of writing this book).

Table of Contents

Chapter 1: Introduction to Kernel Development
Environment setup
Kernel habits
Summary
Chapter 2: Device Driver Basis
User space and kernel space
Driver skeletons
Errors and message printing
Module parameters
Building your first module
Summary
Chapter 3: Kernel Facilities and Helper Functions
Understanding container_of macro
Linked lists
Kernel sleeping mechanism
Delay and timer management
Kernel locking mechanism
Work deferring mechanism
Kernel interruption mechanism
Threaded IRQs
Invoking user-space applications from the kernel
Summary
Chapter 4: Character Device Drivers
The concept behind major and minor
Introduction to device file operations
Allocating and registering a character device
Writing file operations
Summary
Chapter 5: Platform Device Drivers
Platform drivers
Platform devices
Devices, drivers, and bus matching
Summary
Chapter 6: The Concept of Device Tree
Device tree mechanism
Representing and addressing devices
Handling resources
Platform drivers and DT
Summary
Chapter 7: I2C Client Drivers
The driver architecture
Accessing the client
I2C and the device tree
Summary
Chapter 8: SPI Device Drivers
The driver architecture
Accessing and talking to the client
Putting it all together
SPI user mode driver
Summary
Chapter 9: Regmap API – A Register Map Abstraction
Programming with the regmap API
Summary
Chapter 10: IIO Framework
IIO data structures
Triggered buffer support
IIO data access
IIO tools
Summary
Chapter 11: Kernel Memory Management
System memory layout - kernel space and user space
Address translation and MMU
Memory allocation mechanism
Work with I/O memory to talk with hardware
Memory (re)mapping
Linux caching system
Device-managed resources – Devres
Summary
Chapter 12: DMA – Direct Memory Access
Setting up DMA mappings
Concept of completion
DMA engine API
Putting it all together – NXP SDMA (i.MX6)
DMA DT binding
Summary
Chapter 13: Linux Device Model
LDM data structures
Deep inside LDM
Device model and sysfs
Summary
Chapter 14: Pin Control and GPIO Subsystem
Pin control subsystem
The GPIO subsystem
Summary
Chapter 15: GPIO Controller Drivers – gpio_chip
Driver architecture and data structures
Pin controller guideline
Sysfs interface for GPIO controller
GPIO controllers and DT
Summary
Chapter 16: Advanced IRQ Management
Multiplexing interrupts and interrupt controllers
Advanced peripheral IRQs management
Interrupt request and propagation
Summary
Chapter 17: Input Devices Drivers
Input device structures
Allocating and registering an input device
Generating and reporting an input event
User space interface
Putting it all together
Summary
Chapter 18: RTC Drivers
RTC framework data structures
RTCs and user space
Summary
Chapter 19: PWM Drivers
PWM controller driver
PWM consumer interface
Using PWMs with the sysfs interface
Summary
Chapter 20: Regulator Framework
PMIC/producer driver interface
Regulators consumer interface
Regulator binding
Summary
Chapter 21: Framebuffer Drivers
Driver data structures
Device methods
Driver methods
Framebuffer from user space
Summary
Chapter 22: Network Interface Card Drivers
Driver data structures
The device methods
Driver methods
Summary

What You Will Learn

  • Use kernel facilities to develop powerful drivers
  • Develop drivers for widely used I2C and SPI devices and use the regmap API
  • Write and support devicetree from within your drivers
  • Program advanced drivers for network and frame buffer devices
  • Delve into the Linux irqdomain API and write interrupt controller drivers
  • Enhance your skills with regulator and PWM frameworks
  • Develop measurement system drivers with IIO framework
  • Get the best from memory management and the DMA subsystem
  • Access and manage GPIO subsystems and develop GPIO controller drivers

Authors

Table of Contents

Chapter 1: Introduction to Kernel Development
Environment setup
Kernel habits
Summary
Chapter 2: Device Driver Basis
User space and kernel space
Driver skeletons
Errors and message printing
Module parameters
Building your first module
Summary
Chapter 3: Kernel Facilities and Helper Functions
Understanding container_of macro
Linked lists
Kernel sleeping mechanism
Delay and timer management
Kernel locking mechanism
Work deferring mechanism
Kernel interruption mechanism
Threaded IRQs
Invoking user-space applications from the kernel
Summary
Chapter 4: Character Device Drivers
The concept behind major and minor
Introduction to device file operations
Allocating and registering a character device
Writing file operations
Summary
Chapter 5: Platform Device Drivers
Platform drivers
Platform devices
Devices, drivers, and bus matching
Summary
Chapter 6: The Concept of Device Tree
Device tree mechanism
Representing and addressing devices
Handling resources
Platform drivers and DT
Summary
Chapter 7: I2C Client Drivers
The driver architecture
Accessing the client
I2C and the device tree
Summary
Chapter 8: SPI Device Drivers
The driver architecture
Accessing and talking to the client
Putting it all together
SPI user mode driver
Summary
Chapter 9: Regmap API – A Register Map Abstraction
Programming with the regmap API
Summary
Chapter 10: IIO Framework
IIO data structures
Triggered buffer support
IIO data access
IIO tools
Summary
Chapter 11: Kernel Memory Management
System memory layout - kernel space and user space
Address translation and MMU
Memory allocation mechanism
Work with I/O memory to talk with hardware
Memory (re)mapping
Linux caching system
Device-managed resources – Devres
Summary
Chapter 12: DMA – Direct Memory Access
Setting up DMA mappings
Concept of completion
DMA engine API
Putting it all together – NXP SDMA (i.MX6)
DMA DT binding
Summary
Chapter 13: Linux Device Model
LDM data structures
Deep inside LDM
Device model and sysfs
Summary
Chapter 14: Pin Control and GPIO Subsystem
Pin control subsystem
The GPIO subsystem
Summary
Chapter 15: GPIO Controller Drivers – gpio_chip
Driver architecture and data structures
Pin controller guideline
Sysfs interface for GPIO controller
GPIO controllers and DT
Summary
Chapter 16: Advanced IRQ Management
Multiplexing interrupts and interrupt controllers
Advanced peripheral IRQs management
Interrupt request and propagation
Summary
Chapter 17: Input Devices Drivers
Input device structures
Allocating and registering an input device
Generating and reporting an input event
User space interface
Putting it all together
Summary
Chapter 18: RTC Drivers
RTC framework data structures
RTCs and user space
Summary
Chapter 19: PWM Drivers
PWM controller driver
PWM consumer interface
Using PWMs with the sysfs interface
Summary
Chapter 20: Regulator Framework
PMIC/producer driver interface
Regulators consumer interface
Regulator binding
Summary
Chapter 21: Framebuffer Drivers
Driver data structures
Device methods
Driver methods
Framebuffer from user space
Summary
Chapter 22: Network Interface Card Drivers
Driver data structures
The device methods
Driver methods
Summary

Book Details

ISBN 139781785280009
Paperback586 pages
Read More
From 17 reviews

Read More Reviews

Recommended for You

Mastering Linux Kernel Development Book Cover
Mastering Linux Kernel Development
$ 39.99
$ 20.00
Mastering Embedded Linux Programming - Second Edition Book Cover
Mastering Embedded Linux Programming - Second Edition
$ 39.99
$ 20.00
Mastering Assembly Programming Book Cover
Mastering Assembly Programming
$ 35.99
$ 18.00
Linux: Embedded Development Book Cover
Linux: Embedded Development
$ 69.99
$ 35.00
GNU/Linux Rapid Embedded Programming Book Cover
GNU/Linux Rapid Embedded Programming
$ 47.99
$ 24.00
Embedded Linux Development using Yocto Projects - Second Edition Book Cover
Embedded Linux Development using Yocto Projects - Second Edition
$ 27.99
$ 14.00