Get in Touch

Course Outline

Introduction

  • A brief history of GNU/Linux
  • Licensing models
  • Kernel versioning standards
  • The release cycle
  • Kernel trees
  • Mainline development
  • Kernel space versus user space
  • Mechanism versus policy
  • Alternatives to kernel drivers
  • RTOS versus Linux

Memory Management

  • Virtual memory compared to physical memory
  • Kernel memory allocation strategies
  • Pages
  • Memory zones
  • Memory allocation API
  • Slab allocator

Kernel Patching

  • The patch lifecycle
  • Using Git
  • Accessing kernel source code
  • Creating patches
  • Checking patches
  • Fixing patches
  • Submitting patches
  • Code auditing

Kernel Modules

  • Obtaining kernel sources
  • Configuration, building, and installation
  • Device drivers (static linkage and runtime loading)
  • Initialization and exit routines
  • Licensing requirements
  • EXPORT_SYMBOL with GPL restrictions
  • Out-of-tree Makefiles
  • Module initialization tools
  • Integrating modules into the kernel tree
  • Kconfig configuration
  • Passing parameters to modules
  • Using Sparse for static analysis

Character Drivers

  • Architectural design
  • User-kernel interface
  • The I/O subsystem
  • The Virtual File System (VFS)
  • sysfs (devices, buses, drivers, classes)
  • kobject, ktype, and kset
  • The Linux kernel driver model
  • Device file management
  • Character driver implementation
    • Initialization
    • Registration
    • Open and release operations
    • cdev, cdev_add, cdev_del, etc.
    • Major and minor numbers
    • udev, udevmonitor, and udevadm

Advanced Character Driver Operations

  • ioctl operations
  • Unlocked ioctl
  • Compat ioctl
  • User-space API
  • Kernel-space API
  • Process lifecycle management
  • Sleeping and blocking mechanisms
  • Waking up processes
  • Wait queues
  • Handling the "thundering herd" problem
  • poll and select interfaces

Kernel Debugging

  • General debugging principles
  • Debugging the kernel
    • Binary search techniques with Git
    • Kernel debugging support features
    • printk, syslogd, klogd, loglevels, rate limiting, debug levels, and selective subsystem debugging
    • Debugging via debugfs
    • Oops debugging and forcing oopses
    • Magic SysRq Key
    • kgdb/kdb
    • JTAG debugging

Tracing

  • gcov
  • lcov
  • oprofile
  • ftrace
    • nop tracer
    • function tracer
    • sched_switch tracer
    • function graph tracer
    • dynamic tracer
  • trace-cmd and kernelshark
  • perf
  • LTTng

Interrupts

  • Interrupts versus polling
  • Interrupt handling fundamentals
  • Program sections in interrupt context
  • Reentrancy issues
  • Event handling
  • Interrupt handlers
  • Shared interrupt handlers
  • Interrupt flow
  • Interrupt control mechanisms

Deferring Work

  • Top halves and bottom halves
  • Soft interrupts (softirqs)
  • Tasklets
  • Work queues
  • Threaded interrupts

Concurrency

  • Critical regions and sections
  • Atomic operations
  • Race conditions
  • Synchronization techniques
  • Locking mechanisms
  • Locking solutions
  • Deadlocks
  • Contention
  • Identifying what to lock
  • Available synchronization primitives
    • Atomic operations
    • Spin locks
    • Read-write spin locks
    • Semaphores
    • Binary semaphores
    • Mutexes
    • Read-write semaphores
    • Completion variables
    • Seqlocks
    • Disabling preemption
    • Ordering and memory barriers

Time Handling

  • HZ
  • Jiffies
  • Short and long delays
  • Kernel timers

Hardware I/O

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

User-Kernel Communication

  • put_user/get_user
  • copy_to_user/copy_from_user
  • Kernel I/O interfaces
  • Memory mapping
  • procfs
  • sysfs
  • debugfs
  • relayfs
  • Netlink sockets
  • ioctl

Portability

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

Unless otherwise noted, the content and this course outline are licensed under Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0).

Requirements

  • Fundamental experience using a GNU/Linux system as an end user
  • Basic proficiency with a command-line shell
  • Foundational knowledge of user-space and application development
  • Intermediate-level C programming skills
  • Completion of the course Embedded GNU/Linux Systems Architecture is strongly recommended, or an equivalent understanding of its topics
 35 Hours

Number of participants


Price per participant

Testimonials (3)

Upcoming Courses

Related Categories