Linux kernel development

Duration: 5 days

Linux kernel development and device driver engineering are key disciplines in hardware manufacturing and embedded software development companies. Some of the tasks are better handled and optimized in the privileged kernel space than in application code.

For developers, Linux kernel provides an extensive but mostly undocumented driver API. Handling asynchronous hardware events is fundamentally different from most application code. Developers need to handle concurrency and memory management outside the usual application process or thread paradigm. Documentation is often sparse or entirely missing and books are obsolete. The code base and the driver API are always changing. Reading the kernel source code is a must.

This workshop is intended for groups of advanced Linux (POSIX) developers that would benefit from the knowledge of Linux kernel code, interrupt handling, kernel threads and operating system architecture.

  • Introduction to operating systems
    • Hardware abstraction
    • Multitasking
    • Process management
  • Hardware architecture features
    • Kernel and user space distinction
    • CPU and virtual memory
    • Symmetric multi-processing
  • Hardware device driver code
    • Hardware interrupt handling
    • Deferred handler operations
    • Atomic context and process context
  • Concurrency issues
    • Asynchronous interrupt synchronization
    • SMP synchronization using spinlocks
    • Process locking
  • Memory management
    • User space, kernel space and interrupt handler stacks
    • Paged memory allocations
    • SLAB based memory allocation
    • Circular buffers
    • Linked lists
    • Pre-allocated buffers
  • Process management
    • Processes, threads and namespaces
    • Tasks and the schedulre
  • Operating system API development
    • System calls
    • Virtual file system APIs
  • Tracing and debugging
    • Logging and debug messages
    • Kernel debugging possibilities
    • Debugging features for user space applications
    • Tracing the system calls
  • Loadable kernel modules
    • Build system
    • In-tree and out-of-tree builds
    • Module dependencies and automation
    • Automatic device driver loading
  • Device driver object model
    • Kernel object model
    • Objects accessible via sysfs
    • Automated devtmpfs node creation and udev
  • Plug and play driver subsystems
    • Automatic driver discovery
    • USB/PCI device ID tables
    • Device registration
  • Kernel code organization
    • Kernel source tree
  • Legal and community considerations
    • GPLv2
    • Mailing lists
    • Subsystem maintainers
    • Branch maintainers