Get in Touch

Course Outline

Introduction

  • A brief history of GNU/Linux
  • Licensing models
  • Kernel versioning schemes
  • The release cycle
  • Kernel tree structures
  • Mainline kernel development
  • Distinctions between kernel space and user space
  • Mechanism versus policy design principles
  • Alternatives to kernel drivers
  • RTOS compared to Linux

Memory Management

  • Virtual memory versus physical memory
  • Memory allocation within the kernel
  • Understanding pages
  • Memory zones
  • Application Programming Interface (API)
  • The slab allocator

Kernel Patching

  • The patch lifecycle
  • Using Git
  • Navigating kernel source code
  • Creating patches
  • Validating patches with checkpatch
  • Fixing patch issues
  • Submitting patches
  • Audited code practices

Kernel Modules

  • Acquiring kernel sources
  • Configuring, building, and installing modules
  • Device drivers (static linking versus runtime loading)
  • Initialization and exit routines
  • Licensing requirements
  • EXPORT_SYMBOL for GPL
  • Building out-of-tree makefiles
  • Utilizing module-init-tools
  • Integrating modules into the kernel tree
  • Configuration via Kconfig
  • Passing parameters to modules
  • Code checking with sparse

Character Drivers

  • Driver architecture
  • User-space and kernel-space interfaces
  • The I/O subsystem
  • Virtual File System (VFS)
  • sysfs (devices, buses, drivers, and classes)
  • kobject, ktype, and kset structures
  • The Linux kernel driver model
  • Device file management
  • Character driver implementation
    • Initialization procedures
    • Registration processes
    • Open and release operations
    • cdev operations (add, remove, etc.)
    • Major and minor numbers
    • Using udev, udevmonitor, and udevadm

Advanced Character Driver Operations

  • ioctl commands
  • Unlocked ioctl operations
  • Compat ioctl for compatibility
  • User space APIs
  • Kernel space APIs
  • Process lifecycle management
  • Sleeping and blocking techniques
  • Waking up processes
  • Wait queues
  • Addressing the thundering herd problem
  • Using poll and select

Kernel Debugging

  • General debugging strategies
  • Debugging the kernel
    • Using git for binary search debugging
    • Kernel-supported debug features
    • printk, syslogd, klogd, log levels, rate limiting, debug levels, and selective subsystem debugging
    • Debugging via debugfs queries
    • Analyzing oops messages and forcing oops
    • Using the Magic SysRq Key
    • kgdb and 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 mechanisms
  • Program sections in interrupt handling
  • Ensuring reentrancy
  • Handling events
  • Interrupt handlers
  • Shared interrupt handlers
  • Interrupt flow control
  • Interrupt management

Deferring Work

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

Concurrency

  • Critical regions and sections
  • Atomic operations
  • Managing race conditions
  • Synchronization techniques
  • Locking mechanisms
  • Various locking solutions
  • Deadlock prevention
  • Handling contention
  • Determining what to lock
  • Available synchronization primitives
    • Atomic operations
    • Spinlocks
    • Reader-writer spinlocks
    • Semaphores
    • Binary semaphores
    • Mutexes
    • Reader-writer semaphores
    • Completion variables
    • Seqlocks
    • Disabling preemption
    • Ordering and memory barriers

Time Management

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

Hardware I/O

  • I/O Ports
  • I/O Memory mappings
  • Handling side effects during register access

User-Kernel Communication

  • put_user() and get_user() functions
  • copy_to_user() and copy_from_user() functions
  • Kernel I/O operations
  • Memory mapping techniques
  • procfs usage
  • sysfs integration
  • debugfs implementation
  • relayfs functionality
  • Netlink sockets
  • ioctl mechanisms

Portability

  • Word size considerations
  • Opaque types
  • Signed versus unsigned characters
  • Data alignment rules
  • Integral promotion behaviors
  • Code reuse strategies
  • Endianness handling
  • System tick variations
  • Page size dependencies
  • Instruction ordering constraints
  • SMP, preemption, and high memory management

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 familiarity with using a GNU/Linux system as an end user
  • Basic understanding of command line shell operations
  • Foundational knowledge of user space application development
  • Intermediate proficiency in C programming
  • Prior attendance of the course Embedded GNU/Linux Systems Architecture is strongly recommended, or a solid understanding of the topics covered therein
 35 Hours

Number of participants


Price per participant

Testimonials (3)

Upcoming Courses

Related Categories