Subscribe to Newsletter

Print

Linux Device Drivers Training Course


(This course is offered only on-demand to a private batch and can be customized as per the business requirements)

Overview

Implementing Linux on custom hardware will, in most cases, require you to write device drivers. This course demonstrates how to write code that runs within the Linux kernel to handle hardware events and present a standard interface to applications..

This course presents a detailed view of Linux device drivers with an emphasis on topics specific to embedded environments: cross compilation; remote debugging and real-time.

Objectives

At the end of Linux Device Drivers Training course, participants will learn:

  • How to write kernel modules
  • How to create robust drivers using mutexes and spinlocks to serialise access to shared data
  • How to debug kernel code running on a remote embedded target
  • How to handle interrupts, including deferred processing using tasklets and work queues
  • How to access hardware resources, including devices connected via PCI
  • The details of memory management and memory mapping techniques

Suggested Audience

  • Software engineers who are developing applications for embedded or real-time Linux
  • Engineers wishing to assess the suitability of Linux for their next application

Duration - 5 Days

Prerequisites

  • Good ā€˜C’ programming skills
  • General knowledge of an RTOS or embedded operating systems
  • Knowledge of Linux or Unix is useful, but not essential

Syllabus

1. Writing Kernel Modules
  • Structure of a kernel module
  • Compiling and loading modules
2. Introduction to Character Device Drivers
  • Major and minor numbers
  • Basic operations – open, read, write and release
  • Example driver based on a fifo
3. Debugging Kernel Code and Device Drivers
  • Kernel oops messages
  • Debugging with gdb and kgdb
4. The Linux Driver Model
  • Sysfs and the /sys directory
  • Adding device classes and class attributes
5. Task Synchronisation
  • Putting tasks to sleep using wait queues
  • Re-entrancy issues
  • Mutexes, semaphores and spinlocks
6. Real Time Linux
  • How real-time is Linux?
  • Things that affect real-time behaviour
  • Kernel pre-emption modes
7. Input and Output
  • Interfacing with the real world
  • Accessing memory and i/o mapped resources
8. Time
  • Delays and sleeps
  • Using kernel timers
9. Interrupts
  • Installing an interrupt handler; interrupt context and process context
  • Deferred processing using a bottom half or tasklet
10. Memory management
  • Allocating memory by pages and bytes
  • Slab caches
  • Techniques to map device memory directly into user space using mmap
  • Getting direct access to user buffers
11. Block Device Drivers
  • Anatomy of a block device: example RAM disk driver
12. Devices on a PCI Bus
  • How to access PCI hardware
  • An outline PCI driver
13. Network Device Drivers
  • Anatomy of a network device: example loop-back interface
14. Board Support Packages
  • Customising the Linux configuration menus