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.

Location, current course term

Contact us

Custom Customized Training (date, location, content, duration)

The course:

Hide detail
  • 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
Assumed knowledge:
Good knowledge of C programming.
Schedule:
5 days (9:00 AM - 5:00 PM )
Language:

Vybrané zákaznické reference

Thermo Fisher Scientific Brno s.r.o., Petr K.
Linux – Embedded Driver and Kernel Development ( LNXKRN1)
"Dobry den, nas skolitel byl velice dobre pripraven a zodpovedel vsechny dotazy."
RETIA, a.s., Michal D.
Linux – Embedded Driver and Kernel Development ( LNXKRN1)
"Dobrá diskuse, se školením jsem spokojen."
ŠKODA DIGITAL s.r.o., Petr H.
Linux – Embedded Driver and Kernel Development ( LNXKRN1)
"Školení bylo směrované přesně na míru tomu, co jsem si od školení sliboval, že se dozvím, takže za mě 100%."