Linux 6.12 Character Drivers, Device Tree, gpiod, Concurrency & IRQ/Wait I/O

For: Kernel, embedded Linux and BSP engineers

Build and reason about safe Linux 6.12 character-driver lifetimes, Device Tree resources and event-driven I/O on Cortex-A7.

18 lessons6 labs~12h 55mLinux 6.12C11U-Boot 2025.01Course 4 of 8 · Core Kernel Drivers

What you'll build

lab m0160 min

Loadable Modules, User Copies & MMIO

Build a failure-safe module contract with residual-count copies and masked register updates.

learner@ksa: ~/gl-e04/lab-m01
learner@ksa:~/gl-e04/lab-m01./files/verify alllifecycle: publication=7 busy-unload=rejected reverse=321uaccess: requested=8 copied=3 residual=5 zero=0MMIO: mask=0x8 unrelated-bits=preserved overflow=rejectedlearner@ksa:~/gl-e04/lab-m01
lab m0260 min

Character Device Publication & Lifetime

Publish two character-device instances, recover private state and unwind every failed registration.

learner@ksa: ~/gl-e04/lab-m02
learner@ksa:~/gl-e04/lab-m02./files/verify alldev_t: major=240 minor=7 12+20-bit boundaries=checkedpublish: region cdev class node; teardown=4321 onceprivate_data: embedded-member inversion selects instances 11 and 22learner@ksa:~/gl-e04/lab-m02
lab m0360 min

Flattened Device Tree & OF Resources

Decode a bounded big-endian FDT subset and reject malformed register resources.

learner@ksa: ~/gl-e04/lab-m03
learner@ksa:~/gl-e04/lab-m03./files/verify allFDT: magic=d00dfeed version=17 big-endian bounds=checkedreg: parent cells=1+1 base=0x0209c000 size=0x400properties: bad-name-offset missing-NUL oversized-length=rejectedlearner@ksa:~/gl-e04/lab-m03
lab m0460 min

Pad Routing, GPIO Descriptors & Managed Resources

Validate pin tuples, convert logical polarity and release managed actions in dependency order.

learner@ksa: ~/gl-e04/lab-m04
learner@ksa:~/gl-e04/lab-m04./files/verify allpinctrl: tuple=6 cells aligned offsets and mux-mode=checkedgpiod: active-low logical-off=physical-1 logical-on=physical-0devres: safe-off action=3 precedes GPIO=2 and state=1 releaselearner@ksa:~/gl-e04/lab-m04
lab m0560 min

Concurrency, Interrupt-Safe Locks & Scoped Mutexes

Separate object lifetime, atomic updates, IRQ exclusion and sleeping critical sections.

learner@ksa: ~/gl-e04/lab-m05
learner@ksa:~/gl-e04/lab-m05./files/verify allreferences: final-put=once zero-resurrection=blocked saturation=pinnedspinlock: same-CPU recursive IRQ=forbidden saved-disabled=preservedmutex: two C11 threads count=20000 hardirq/spin sleep=rejectedlearner@ksa:~/gl-e04/lab-m05
lab m0660 min

Timers, IRQ Events & Blocking Character I/O

Debounce events, preserve FIFO data on failed copies and unify read, poll and asynchronous notification.

learner@ksa: ~/gl-e04/lab-m06
learner@ksa:~/gl-e04/lab-m06./files/verify alltimer: wrap deadline=4 bounce-rearm=20 shutdown blocks rearmIRQ: publish-before-wake SIGIO=1 failed-copy retains eventwait: empty nonblock=EAGAIN signal=ERESTARTSYS register-first avoids lost wakelearner@ksa:~/gl-e04/lab-m06

Syllabus

gl-e04/

  • m01/ Loadable Modules, User Copies & MMIO

    Build a failure-safe module contract with residual-count copies and masked register updates.

  • m02/ Character Device Publication & Lifetime

    Publish two character-device instances, recover private state and unwind every failed registration.

  • m03/ Flattened Device Tree & OF Resources

    Decode a bounded big-endian FDT subset and reject malformed register resources.

  • m04/ Pad Routing, GPIO Descriptors & Managed Resources

    Validate pin tuples, convert logical polarity and release managed actions in dependency order.

  • m05/ Concurrency, Interrupt-Safe Locks & Scoped Mutexes

    Separate object lifetime, atomic updates, IRQ exclusion and sleeping critical sections.

  • m06/ Timers, IRQ Events & Blocking Character I/O

    Debounce events, preserve FIFO data on failed copies and unify read, poll and asynchronous notification.

Prerequisites

  • requiredGL-E03 or equivalent: ARMv7-A boot, Device Tree builds and cross-compilation
  • requiredC pointers, structures, binary arithmetic and POSIX file I/O
  • Bridged in M1Native C11 contracts isolate driver logic without requiring attached hardware
  • Bridged in M1Linux 6.12 API updates are shown explicitly at every affected boundary

Series map

  1. GL-E00Linux Host Workbench, POSIX Shell, Network Boot & Embedded C Style — Host VM/udev bridges, PTY/shell streams, FHS/permissions/MBR alignment, APT/TFTP/NFS boot, kernel C style & bring-up fault triage
  2. GL-E01ARMv7-A Cortex-A7 Architecture, Boot ROM & Bare-Metal BSP — Cross-workbench, Cortex-A7 modes/CP15, ARMv7 assembly, IOMUXC pad muxing, IVT/DCD Boot ROM, linker scripts & modular BSP
  3. GL-E02Bare-Metal Clocks, GIC Interrupts, DDR3, LCD & Sensor Buses — CCM PLL/PFD clock tree, GICv2 interrupts, EPIT/GPT timers, UART printf, MMDC DDR3 calibration, eLCDIF/FT5426/PWM & RTC/I2C/SPI
  4. GL-E03U-Boot 2025.x, Linux 6.12 Porting, Root Filesystems & Target Debugging — U-Boot Kbuild/SPL/relocation/porting, Linux 6.12 arch/arm boot/DTS/ENET port, BusyBox/Buildroot/Yocto rootfs, UUU & gdbserver
  5. GL-E04Linux 6.12 Character Drivers, Device Tree, gpiod, Concurrency & IRQ/Wait I/O — Loadable modules, cdev/udev, Flattened Device Tree, pinctrl/gpiod, atomic/spinlock/mutex/cleanup.h, timers, IRQs, wait queues & poll this course
  6. GL-E05Linux 6.12 Driver Model, Input, DRM/Framebuffer, Touch, PWM & ALSA SoC — platform/misc/sysfs driver model, input_dev, DRM/KMS & fbdev display, SiI9022A HDMI, MT Type-B touch, pwm-backlight & WM8960 ASoC
  7. GL-E06Linux 6.12 Bus, Sensor (regmap/IIO), Serial/CAN/USB, blk-mq & Network Drivers — RTC/I2C/SPI client drivers, regmap, IIO & SAR ADC, UART/RS-485/GPS, FlexCAN SocketCAN, USB Host/OTG/Gadget, blk-mq & FEC NAPI/Wi-Fi/4G
  8. GL-E07Linux 6.12 ASoC Audio Drivers, Early Boot Splash, Debian Rootfs & Systemd Daemons — SAI2/WM8960 ASoC & DAPM, U-Boot/CLUT224/psplash boot graphics, debootstrap Debian armhf, systemd watchdogs, SysV/POSIX IPC & vsftpd/sftp

Related live cohorts: DRV-120 · Linux Device Drivers (live cohort) KRN-101 · Linux Systems & Kernel Foundations (live cohort)

Companion formats

Slide deck

16:9 review slides with terminal listings, diagrams, and speaker notes.

Reference handbook

Printable HTML and PDF engineering reference covering every module and UAPI.

Flashcards

Leitner spaced-repetition terminal cards and TSV deck for syscalls, flags, and pitfalls.

Kernel Systems Academy engineering studio

Every Kernel Systems Academy course follows our 35% principles / 20% guided investigation / 45% engineering studio pedagogy. Listings are compiled against Linux 6.12 · C11 · U-Boot 2025.01 under strict compiler flags (-Wall -Wextra -Werror), and each module culminates in an evidence-checked lab graded locally by ./check.sh.

Frequently asked questions

Can I study this course offline from disk?

Yes. All fonts, stylesheets, diagrams, search indexes, and progress trackers use relative paths and local browser storage, so the bundle works identically over HTTP and file://.

How are the hands-on labs graded?

Each lab directory includes starter source files and an executable ./check.sh runner emitting TAP version 13 diagnostics (ok / not ok) and exiting 0 when every check passes.

What is included in the free preview?

Preview lessons and the opening module lab are unlocked in full so you can inspect our C11 listings, strace transcripts, and ./check.sh workflow before subscribing.

search — fzf

0/0 ───────────────────────────────────────────

keyboard shortcuts — less

/
search
f
focus mode
[
previous
]
next
?
help
Esc
close

figure