This instructor-led Linux device driver 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.
Developing Linux Device Drivers (LFD430)
- Who You Are
- The Linux Foundation{
- Copyright and No Confidential Information
- The Linux Foundation{ Training
- Certification Programs and Digital Badging
- Linux Distributions
- Platforms
- Preparing Your System
- Using and Downloading a Virtual Machine
- Things Change in Linux and Open Source Projects
- Documentation and Links
- Kernel Versions
- Kernel Sources and Use of git
- Rolling Your Own Kernel
- Hardware
- Staging Tree
- Labs
- Know Where the Code is Coming From: DCO and CLA
- 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
- 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
- Modules and Hot Plug
- Labs
- Memory Zones
- Page Tables
- kmalloc()
- __get_free_pages()
- vmalloc()
- Slabs and Cache Allocations
- Labs
- Major and Minor Numbers
- Reserving Major/Minor Numbers
- Accessing the Device Node
- Registering the Device
- udev
- texttt {dev_printk() and Associates
- file_operations Structure
- Driver Entry Points
- The file and inode Structures
- Miscellaneous Character Drivers
- Labs
- User-Space vs. Kernel-Space
- What are System Calls?
- Available System Calls
- Scheduling Algorithms and Task Structures
- Process Context
- Labs
- 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
- Exceptions
- Asynchronous Interrupts
- MSI
- Enabling/Disabling Interrupts
- What You Cannot Do at Interrupt Time
- IRQ Data Structures
- Installing an Interrupt Handler
- Labs
- Jiffies
- Getting the Current Time
- Clock Sources
- Real Time Clock
- Programmable Interval Timer
- Time Stamp Counter
- HPET
- Going Tickless
- Labs
- What are Kernel Timers?
- Low Resolution Timer Functions
- Low Resolution Timer Implementation
- High Resolution Timers
- Using High Resolution Timers
- Labs
- Driver Entry point for ioctls
- Defining ioctls
- Labs
- Basic Structures
- Real Devices
- sysfs
- kset and kobject examples
- Labs
- Loading Firmware
- Labs
- Going to Sleep and Waking Up
- Going to Sleep Details
- Exclusive Sleeping
- Waking Up Details
- Polling
- Labs
- Softirqs
- Tasklets
- Work Queues
- New Work Queue API
- Creating Kernel Threads
- Threaded Interrupt Handlers
- Interrupt Handling in User-Space
- Labs
- 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
- PCI Device Drivers
- Locating PCI Devices
- Accessing Configuration Space
- Accessing I/O and Memory Spaces
- PCI Express
- Labs
- Main Data Structures
- Registering Platform Devices
- An Example
- Hardcoded Platform Data
- The New Way: Device Trees
- Labs
- DMA Directly to User
- DMA and Interrupts
- DMA Memory Constraints
- DMA Masks
- DMA API
- Labs
- Datalink Layer
- Network Device Drivers
- Loading/Unloading
- Opening and Closing
- Labs
- net_device_ops Structure
- sk_buff Structure
- Socket Buffer Functions
- texttt {netdev_printk() and Associates
- Labs
- Receiving Data
- Statistics
- Labs
- Changes in Link State
- ioctls
- NAPI and Interrupt Mitigation
- NAPI Details
- TSO and TOE
- MII and ethtool **
- USB Topology
- Terminology
- Endpoints
- Descriptors
- USB Device Classes
- USB Support in Linux
- Registering USB Device Drivers
- Moving Data
- Example of a USB Driver
- Labs
- ACPI and APM
- System Power States
- Callback Functions
- Labs
- Buffering
- Registering a Block Driver
- gendisk Structure
- Request Handling
- Labs
- Monolithic and Micro Kernels
- Object-Oriented Methods
- Main Kernel Components
- User-Space and Kernel-Space
- Memory Allocation
- Transferring Data between User and Kernel Spaces
- Object-Oriented Inheritance - Sort Of
- Linked Lists
- Jiffies
- Labs
- A Trivial Example
- Compiling Modules
- Modules vs Built-in
- Module Utilities
- Automatic Module Loading
- Module Usage Count
- Module Licensing
- Exporting Symbols
- Resolving Symbols **
- Labs
- Kernel Preemption
- Real Time Preemption Patch
- Labs
- Kernel Browsers
- Kernel Configuration Files
- Kernel Building and Makefiles
- initrd and initramfs
- Labs
- 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
- Labs
- Atomic Operations
- Bit Operations
- Spinlocks
- Seqlocks
- Disabling Preemption
- Mutexes
- Semaphores
- Completion Functions
- Read-Copy-Update (RCU)
- Reference Counts
- Labs
- 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
- Labs
- 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.
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.