Linux Device Driver Programming
Summary
The course aims at teaching the basics of device driver programming for the Linux kernel. The course includes char driver development, PCI driver development and network driver development. The course is taught with very simple devices like the parallel port, serial port, mouse and LCD devices, so that the student can focus better on learning the kernel interface, while still programming real hardware.
Pre-requisite
-
C Programming
-
Programming in GNU/Linux
-
Microprocessors
Duration
-
Duration: 42 hours
-
Span for Weekdays: 3.5 weeks
-
Span for Weekends: 5 weeks
Syllabus
Introduction to Devices
-
Device Interfacing
-
Parallel Port LED Userspace Access
-
Parallel Port LCD Userspace Access
Using Qemu and Using Kernel Modules
-
Qemu Usage
-
Disk Images
-
Host System Access
-
Device Simulation
-
Kernel Modules
-
Kernel Version Numbering
Writing Kernel Modules
-
Module Programming vs Application Programming
-
Hello World Module
-
Module Programming Basics
-
Compiling
-
Loading and Unloading
-
Module Parameters
-
Char Drivers
-
Major and Minor Numbers
-
Data Structures
-
File Operations Structure
-
File Structure
-
-
Registering Char Driver
-
Parallel Port LCD Driver
Device Model and Device Access
-
Linux Device Model
-
Bus Model
-
Writing PCI Drivers
Debugging Techniques
-
Debugging by Printing
-
Kernel Log Mechanism
-
Turning on/off Debug Messages
-
Rate Limiting
-
-
Debugging by Querying
-
debugfs
-
-
Debugging by Watching
-
strace
-
-
Debugging System Faults
-
Decoding Oops
-
Recovering from a System Hang
-
Interrupts and Concurrency
-
Interrupts
-
Installing Interrupt Handlers
-
Sources of Concurrency
-
Semaphores
-
Spinlocks
-
Common Locking Problems
-
Atomic Variables
Advanced Character I/O
-
Char driver to transmit and receive serial data
-
Blocking I/O
-
Implementing poll
-
Implementing ioctl
