Training
Linux Driver Development for Embedded Systems
Description
This four-day course provides the skills needed to develop device drivers on Linux systems. The fourth day is dedicated to drivers for I2C and SPI peripherals, which are typical of embedded systems.
Each lesson alternates theory with hands-on exercises on PCs assigned to the participants, during which sample drivers are developed to put what has been learned into practice straight away. To ensure good interaction between students and instructor, classes have no more than 5 participants.
- Duration
- 4 days
- Audience
- Companies and independent professionals
- Prerequisites
- C programming experience; familiarity with Linux systems
- Class size
- Up to 5 students
Detailed syllabus
- Introduction
- Peripheral abstraction in Linux
- Device classes: character, block, network
- The Linux VFS and device files
- Structure and organisation of a driver
- Linux kernel modules
- Writing and building a simple module
- Managing modules from the command line
- Module parameters and licence
- Debugging kernel modules
- Character drivers
- Major and minor numbers
- Registering a character device file
- The file operations table
- Transferring data between user space and kernel
- The open, close, read and write methods
- Time management
- Timekeeping
- Introducing delays
- Wait queues
- Deferred work
- Kernel execution contexts and their restrictions
- Legacy and high-resolution timers
- Tasklets
- Workqueues
- Concurrency management
- Kernel preemption
- When synchronisation is needed
- Per-CPU variables
- Atomic operations
- Memory barriers
- Identifying critical sections
- Spinlocks
- Semaphores and mutexes
- Enabling and disabling interrupts
- Memory allocation
- Introduction to memory management in Linux
- Page frame allocation
kmallocand its variantskvmalloc
- Device discovery and bus support
- Linux support for the PCI bus
- Linux support for the USB bus
- Talking to the hardware
- I/O ports
- I/O memory
- Allocating and mapping I/O regions
- Functions to read and write I/O ports and memory
- Interrupt handling
- Legacy IRQs, MSI and MSI-X
- Registering an interrupt handler
- Writing an interrupt handler
- Splitting top half and bottom half
- Advanced file operations
mmapioctl- Blocking and non-blocking I/O
- Drivers for I2C devices
- Introduction to the I2C bus
- The Linux kernel I2C subsystem
- I/O operations on the I2C bus
- Drivers for SPI devices
- Introduction to the SPI bus
- The Linux kernel SPI subsystem
- I/O operations on the SPI bus
Format
The course is held at our offices in Rome, Via Edoardo D'Onofrio, 304 – 00155 Roma, Italy, or, on request, at the client's premises.