Get in Touch

Course Outline

Introduction

  • Historical overview of GNU/Linux
  • Licensing frameworks
  • Kernel versioning schemes
  • Release cycles
  • Kernel code trees
  • Mainline kernel development
  • Distinction between kernel and user space
  • Mechanism versus policy
  • Alternatives for kernel drivers
  • RTOS compared to Linux

Memory Management

  • Virtual memory versus physical memory
  • Kernel memory allocation strategies
  • Page management
  • Memory zones
  • Application Programming Interface (API)
  • Slab allocator

Kernel Patching

  • Patch lifecycle management
  • Git version control
  • Accessing kernel source code
  • Creating patches
  • Patch validation
  • Patch refinement
  • Distributing patches
  • Audited code standards

Kernel Modules

  • Acquiring kernel sources
  • Configuration, building, and installation
  • Device drivers (static linking, runtime loading)
  • Initialization and exit routines
  • Licensing requirements
  • EXPORT_SYMBOL GPL
  • Out-of-tree Makefiles
  • Module initialization tools
  • Modules within the kernel tree
  • Kconfig configuration
  • Passing parameters to modules
  • Sparse static analysis

Character Drivers

  • Architectural design
  • User and kernel interface boundaries
  • I/O subsystem architecture
  • Virtual File System (VFS)
  • sysfs structure (devices, buses, drivers, classes)
  • kobject, ktype, and kset concepts
  • Linux kernel driver model
  • Device file management
  • Character driver implementation
    • Initialization procedures
    • Registration processes
    • Open and release operations
    • cdev operations (add, delete, etc.)
    • Major and minor device numbers
    • udev, udevmonitor, and udevadm utilities

Advanced Character Driver Operations

  • ioctl commands
  • Unlocked ioctl
  • Compatibility ioctl handling
  • User space API interfaces
  • Kernel space API interfaces
  • Process lifecycle management
  • Sleeping and blocking techniques
  • Sleep and wake mechanisms
  • Wait queue utilization
  • Thundering herd problem
  • Poll and select operations

Kernel Debugging

  • General debugging principles
  • Debugging the kernel
    • Git-based binary search debugging
    • Kernel-provided debug support
    • printk, syslogd, klogd, log levels, rate limiting, debug levels, and selective subsystem debugging
    • Querying debugfs for debugging purposes
    • Oops debugging and assertion
    • Magic SysRq key usage
    • kgdb and kdb integration
    • JTAG debugging

Tracing

  • gcov coverage analysis
  • lcov report generation
  • oprofile performance monitoring
  • ftrace utilities
    • nop tracer
    • function tracer
    • sched switch tracer
    • function graph tracer
    • dynamic tracer
  • trace-cmd and kernelshark
  • perf performance analysis
  • LTTng tracing

Interrupts

  • Interrupts versus polling
  • Interrupt handling basics
  • Code section execution
  • Reentrancy considerations
  • Event handling
  • Interrupt handler design
  • Shared interrupt handlers
  • Interrupt flow management
  • Interrupt control mechanisms

Deferring Work

  • Top and bottom halves
  • Softirqs
  • Tasklets
  • Work queues
  • Threaded interrupts

Concurrency

  • Critical regions and sections
  • Atomic operations
  • Race condition prevention
  • Synchronization strategies
  • Locking mechanisms
  • Locking solutions overview
  • Deadlock avoidance
  • Contention management
  • Determining what to lock
  • Available locking primitives
    • Atomic operations
    • Spinlocks
    • Read-write spinlocks
    • Semaphores
    • Binary semaphores
    • Mutexes
    • Read-write semaphores
    • Completion variables
    • Seqlocks
    • Disabling preemption
    • Ordering and memory barriers

Time Management

  • HZ tick rate
  • Jiffies counters
  • Large and small delays
  • Kernel timers

Hardware I/O

  • I/O Ports
  • I/O Memory
  • Handling side effects when accessing registers

User-Kernel Communication

  • put_user() and get_user()
  • copy_to_user() and copy_from_user()
  • Kernel I/O operations
  • Memory mapping
  • procfs
  • sysfs
  • debugfs
  • relayfs
  • Netlink sockets
  • ioctl

Portability

  • Word size considerations
  • Opaque data types
  • Signed and unsigned char handling
  • Data alignment
  • Integral promotion
  • Code reuse strategies
  • Endianness
  • System tick management
  • Page size variations
  • Instruction ordering
  • SMP, preemption, and high memory

Unless otherwise stated, the content of this course outline is licensed under Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0).

Requirements

  • Foundational experience using a GNU/Linux system as an end user
  • Basic comfort with command line shells
  • Fundamental understanding of user space and application development
  • Intermediate proficiency in C programming
  • Completion of Embedded GNU/Linux Systems Architecture is highly recommended, along with a solid grasp of its subject matter.
 35 Hours

Number of participants


Price per participant

Testimonials (3)

Upcoming Courses

Related Categories