Developing Linux Device Drivers (LFD430)

Learn how to develop device drivers for Linux systems. This course will teach you about the different types of Linux device drivers as well as the appropriate APIs and methods through which devices interface with the kernel.

$3150 Enroll Get A Quote

Course Overview

This course will teach you how to develop device drivers for Linux systems, grounded with a basic familiarity and understanding of the underlying Linux kernel.

Show More

You’ll learn:

  • The different kinds of device drivers used in Linux
  • The appropriate APIs through which devices (both hardware and software) interface with the kernel.
  • Necessary modules and techniques for developing and debugging Linux drivers
  • And more.

The information in this course will work with any major Linux distribution.

Schedule

Instructor-Led
7/29/2019 - 8/1/2019
VIRTUAL
GuaranteedThis course has reached its minimum class size and is guaranteed to run on the scheduled date.
$3150 Add to cart Generate A Quote
Instructor-Led
9/16/2019 - 9/19/2019
VIRTUAL
$3150 Add to cart Generate A Quote
Instructor-Led
11/11/2019 - 11/14/2019
VIRTUAL
$3150 Add to cart Generate A Quote
If none of these fits your schedule, check out our Partner offerings >

Course Outline

  1. Introduction
    • Objectives
    • Who You Are
    • The Linux Foundation
    • Linux Foundation Training
    • Certification Programs and Digital Badging
    • Linux Distributions
    • Platforms
    • Preparing Your System
    • Using and Downloading a Virtual Machine
    • Things change in Linux
    • Documentation and Links
    • Course Registration
  2. Preliminaries
    • Procedures
    • Kernel Versions
    • Kernel Sources and Use of git
    • Rolling Your Own Kernel
    • Hardware
    • Staging Tree
  3. How to Work in OSS Projects **
    • Overview on How to Contribute Properly
    • Stay Close to Mainline for Security and Quality
    • Study and Understand the Project DNA
    • Figure Out What Itch You Want to Scratch
    • Identify Maintainers and Their Work Flows and Methods
    • Get Early Input and Work in the Open
    • Contribute Incremental Bits, Not Large Code Dumps
    • Leave Your Ego at the Door: Don’t Be Thin-Skinned
    • Be Patient, Develop Long Term Relationships, Be Helpful
  4. Device Drivers
    • Types of Devices
    • Mechanism vs. Policy
    • Avoiding Binary Blobs
    • Power Management
    • How Applications Use Device Drivers
    • Walking Through a System Call Accessing a Device
    • Error Numbers
    • printk()
    • devres: Managed Device Resources
    • Labs
  5. Modules and Device Drivers
    • The module_driver() Macros
    • Modules and Hot Plug
    • Labs
  6. Memory Management and Allocation
    • Virtual and Physical Memory
    • Memory Zones
    • Page Tables
    • kmalloc()
    • __get_free_pages()
    • vmalloc()
    • Slabs and Cache Allocations
    • Labs
  7. Character Devices
    • Device Nodes
    • Major and Minor Numbers
    • Reserving Major/Minor Numbers
    • Accessing the Device Node
    • Registering the Device
    • udev
    • dev_printk() and Associates
    • file_operations Structure
    • Driver Entry Points
    • The file and inode Structures
    • Miscellaneous Character Drivers
    • Labs
  8. Kernel Features
    • Components of the Kernel
    • User-Space vs. Kernel-Space
    • What are System Calls?
    • Available System Calls
    • Scheduling Algorithms and Task Structures
    • Process Context
    • Labs
  9. Transferring Between User and Kernel Space
    • Transferring Between Spaces
    • put(get)_user() and copy_to(from)_user()
    • Direct Transfer: Kernel I/O and Memory Mapping
    • Kernel I/O
    • Mapping User Pages
    • Memory Mapping
    • User-Space Functions for mmap()
    • Driver Entry Point for mmap()
    • Accessing Files from the Kernel
    • Labs
  10. Interrupts and Exceptions
    • What are Interrupts and Exceptions?
    • Exceptions
    • Asynchronous Interrupts
    • MSI
    • Enabling/Disabling Interrupts
    • What You Cannot Do at Interrupt Time
    • IRQ Data Structures
    • Installing an Interrupt Handler
    • Labs
  11. Timing Measurements
    • Kinds of Timing Measurements
    • Jiffies
    • Getting the Current Time
    • Clock Sources
    • Real Time Clock
    • Programmable Interval Timer
    • Time Stamp Counter
    • HPET
    • Going Tickless
    • Labs
  12. Kernel Timers
    • Inserting Delays
    • What are Kernel Timers?
    • Low Resolution Timer Functions
    • Low Resolution Timer Implementation
    • High Resolution Timers
    • Using High Resolution Timers
    • Labs
  13. ioctls
    • What are ioctls?
    • Driver Entry point for ioctls
    • Defining ioctls
    • Labs
  14. Unified Device Model and sysfs
    • Unified Device Model
    • Basic Structures
    • Real Devices
    • sysfs
    • kset and kobject examples
    • Labs
  15. Firmware
    • What is Firmware?
    • Loading Firmware
    • Labs
  16. Sleeping and Wait Queues
    • What are Wait Queues?
    • Going to Sleep and Waking Up
    • Going to Sleep Details
    • Exclusive Sleeping
    • Waking Up Details
    • Polling
    • Labs
  17. Interrupt Handling: Deferrable Functions and User Drivers
    • Top and Bottom Halves
    • Softirqs
    • Tasklets
    • Work Queues
    • New Work Queue API
    • Creating Kernel Threads
    • Threaded Interrupt Handlers
    • Interrupt Handling in User-Space
    • Labs
  18. Hardware I/O
    • Buses and Ports
    • Memory Barriers
    • Registering I/O Ports
    • Reading and Writing Data from I/O Registers
    • Allocating and Mapping I/O Memory
    • Accessing I/O Memory
    • Access by User – ioperm(), iopl(), /dev/port
    • Labs
  19. PCI
    • What is PCI?
    • PCI Device Drivers
    • Locating PCI Devices
    • Accessing Configuration Space
    • Accessing I/O and Memory Spaces
    • PCI Express
    • Labs
  20. Platform Drivers**
    • What are Platform Drivers?
    • Main Data Structures
    • Registering Platform Devices
    • An Example
    • Hardcoded Platform Data
    • The New Way: Device Trees
    • Labs
  21. Direct Memory Access (DMA)
    • What is DMA?
    • DMA Directly to User
    • DMA and Interrupts
    • DMA Memory Constraints
    • DMA Masks
    • DMA API
    • DMA Pools
    • Scatter/Gather Mappings
    • Labs
  22. Network Drivers I: Basics
    • Network Layers and Data Encapsulation
    • Datalink Layer
    • Network Device Drivers
    • Loading/Unloading
    • Opening and Closing
    • Labs
  23. Network Drivers II: Data Structures
    • net_device Structure
    • net_device_ops Structure
    • sk_buff Structure
    • Socket Buffer Functions
    • netdev_printk() and Associates
    • Labs
  24. Network Drivers III: Transmission and Reception
    • Transmitting Data and Timeouts
    • Receiving Data
    • Statistics
    • Labs
  25. Network Drivers IV: Selected Topics
    • Multicasting **
    • Changes in Link State
    • ioctls
    • NAPI and Interrupt Mitigation
    • NAPI Details
    • TSO and TOE
    • MII and ethtool **
  26. USB Drivers
    • What is USB?
    • USB Topology
    • Terminology
    • Endpoints
    • Descriptors
    • USB Device Classes
    • USB Support in Linux
    • Registering USB Device Drivers
    • Moving Data
    • Example of a USB Driver
    • Labs
  27. Power Management
    • Power Management
    • ACPI and APM
    • System Power States
    • Callback Functions
    • Labs
  28. Block Drivers
    • What are Block Drivers?
    • Buffering
    • Registering a Block Driver
    • gendisk Structure
    • Request Handling
    • Labs
  29. Closing and Evaluation Survey
    • Evaluation Survey

Appendices

  1. Kernel Architecture I
    • UNIX and Linux **
    • Monolithic and Micro Kernels
    • Object-Oriented Methods
    • Main Kernel Tasks
    • User-Space and Kernel-Space
  2. Kernel Programming Preview
    • Task Structure
    • Memory Allocation
    • Transferring Data between User and Kernel Spaces
    • Linked Lists
    • Jiffies
    • Labs
  3. Modules
    • What are Modules?
    • A Trivial Example
    • Compiling Modules
    • Modules vs Built-in
    • Module Utilities
    • Automatic Loading/Unloading of Modules
    • Module Usage Count
    • Module Licensing
    • Exporting Symbols
    • Resolving Symbols **
    • {C.11Labs
  4. Kernel Architecture II
    • Processes, Threads, and Tasks
    • Kernel Preemption
    • Real Time Preemption Patch
    • Labs
  5. Kernel Configuration and Compilation
    • Installation and Layout of the Kernel Source
    • Kernel Browsers
    • Kernel Configuration Files
    • Kernel Building and Makefiles
    • initrd and initramfs
    • Labs
  6. Kernel Style and General Considerations
    • Coding Style
    • Using Generic Kernel Routines and Methods
    • Making a Kernel Patch
    • sparse
    • Using likely() and unlikely()
    • Writing Portable Code, CPU, 32/64-bit, Endianness
    • Writing for SMP
    • Writing for High Memory Systems
    • Power Management
    • Keeping Security in Mind
    • {F.11Labs
  7. Race Conditions and Synchronization Methods
    • Concurrency and Synchronization Methods
    • Atomic Operations
    • Bit Operations
    • Spinlocks
    • Seqlocks
    • Disabling Preemption
    • Mutexes
    • Semaphores
    • Completion Functions
    • Read-Copy-Update (RCU)
    • {G.11Reference Counts
    • {G.12Labs
  8. Memory Addressing
    • Virtual Memory Management
    • Systems With and Without MMU and the TLB
    • Memory Addresses
    • High and Low Memory
    • Memory Zones
    • Special Device Nodes
    • NUMA
    • Paging
    • Page Tables
    • page structure
    • {H.11Labs
  9. Memory Allocation
    • Requesting and Releasing Pages
    • Buddy System
    • Slabs and Cache Allocations
    • Memory Pools
    • kmalloc()
    • vmalloc()
    • Early Allocations and bootmem()
    • Memory Defragmentation
    • Labs

** These sections may be considered in part or in whole as optional. They contain either background reference material, specialized topics, or advanced subjects. The instructor may choose to cover or not cover them depending on classroom experience and time constraints.

Prerequisites

Knowledge of basic kernel interfaces and methods such as how to write, compile, load and unload modules, use synchronization primitives, and the basics of memory allocation and management, such as is provided by LFD420 Linux Kernel Internals and Development. Pre-class preparation material will be provided before class.

At a Glance

Delivery Method

Live Online (Virtual)

Delivery Method

Live (Classroom)

Includes

  • 4 days of Instructor-led class time
  • Hands-on Labs & Assignments
  • Resources & Course Manual
  • Certificate of Completion
  • Free Chromebook

Experience Level

   Intermediate

Course Rating

   

Pro-Tip

Training 5 or more individuals?
Get a Corporate Quote >

chromebook

Get training and a free Chromebook.

When you train with The Linux Foundation you’re already getting the best open source training straight from the source. And now, we are including a free Chromebook with the purchase of select Linux Foundation instructor-led training courses to help you get the most out of your training experience.

Learn More