Linux – Embedded Driver and Kernel Development (LNXKRN1)

Unix-like systems, Linux - programming

Many simple drivers run as applications in user space, but sometimes you must run code inside the kernel or modify existing kernel sources to meet project needs. Set up a virtual machine or real target hardware to begin practical experiments.

Linux evolved since 1991 and provides an object-like driver model to work with memory and I/O controllers and dedicated buses such as I2C, SPI, USB or PCI Express. The course covers implementations in C, with optional Rust or C++ tracks and targets x86-64 or ARM64.

THIS TRAINING COURSE WILL HELP YOU:

  • Understand how code runs inside the kernel and the driver model
  • Write drivers and work with buses and devices in Linux
  • Implement synchronization across CPU cores and interrupt code

WHO SHOULD ATTEND?

  • Developers of embedded products based on Linux platforms
  • Engineers writing device drivers for custom hardware
  • Teams porting embedded projects to Linux-based systems
  • Anyone curious about Linux kernel and driver internals

COURSE LOCATION AND AVAILABLE DATES



Public courses are usually delivered in Czech, but this course is also available in English. We can arrange private training for your team online, at your premises or in our classrooms, and tailor the content to your needs.

For groups of around 4 or more participants, private training can already be comparable in price to booking individual places on a public course. Send us your requirements and we’ll recommend the best format and provide an exact quote.

Request training in English

Course content:

Hide details
  • Kernel initialization
    1. Kernel boot image and the device tree
    2. Root filesystem and the init process
    3. Loadable modules and initramfs
  • Setting up the lab environment
    1. Virtual machine environment
    2. Build environment and tooling
    3. Running your first kernel code
  • Constraints and specifics of kernel code
    1. No stable driver API guarantees
    2. Long-term maintenance of kernel code
    3. Design specifics for kernel-space code
  • User-space alternatives
    1. Device drivers running in user space
    2. More stable APIs toward user space
    3. Wider choice of programming languages
  • Building kernel modules
    1. Initialization and cleanup
    2. Acquiring and releasing resources
    3. Registering operation structures
  • Creating user-space interfaces
    1. Virtual filesystem interfaces
    2. Read, write and ioctl operations
    3. Roles of procfs, sysfs and debugfs
  • Exposing character devices
    1. Global character device numbering
    2. Dynamic miscdev allocation
    3. Publishing devices via devtmpfs
  • Hardware driver mechanics
    1. Linux device driver model
    2. Initialization and teardown flows
    3. Resource acquisition and release
  • Representing hardware buses
    1. Devices accessed by CPU instructions
    2. Buses without enumeration (I2C, SPI, …)
    3. Smart buses with enumeration (USB, PCI, …)
  • Connecting user space with hardware
    1. Presenting hardware devices to applications
    2. Character devices and the block layer
    3. Integration with specialized subsystems
  • Kernel module design patterns
    1. Rollback on failed initialization
    2. Callbacks using container_of
    3. Preallocated buffers and FIFOs
  • Dynamic module loading infrastructure
    1. Module loading and unloading steps
    2. Symbol dependencies between modules
    3. Resource management and blocked removal
  • Locking and waiting mechanisms
    1. Mutexes and working with kernel threads
    2. Spinlocks, interrupts and synchronization
    3. Timers and wait queues
  • Support for ARM boards
    1. Device and board files
    2. Binary device tree
    3. Pinctrl, GPIO and interrupts
  • Discussion about kernel development
    1. Differences vs. bare-metal programming
    2. Real-time and performance considerations
    3. Legal, community and PR aspects
Prerequisites:
Good knowledge of C programming.
Schedule:
5 days (9:00-17:00)

Training and learning environment