Get in Touch

Course Outline

Introduction

  • A brief history of GNU/Linux
  • Licensing models
  • Kernel versioning schemes
  • The release cycle
  • Kernel trees
  • The mainline kernel
  • Kernel space versus user space
  • Mechanism versus policy
  • Alternatives for kernel drivers
  • RTOS versus Linux

Memory Management

  • Virtual memory versus physical memory
  • Memory allocation within the kernel
  • Pages
  • Memory zones
  • Application Programming Interface (API)
  • Slab allocator

Kernel Patching

  • Patch lifecycle
  • Using Git
  • Kernel source management
  • Creating a patch
  • Checking patches
  • Fixing patches
  • Submitting/shipping patches
  • Audited code standards

Kernel Modules

  • Obtaining kernel sources
  • Configuring, building, and installing
  • Device drivers (static linking and runtime loading)
  • Initialization and exit functions
  • Licensing considerations
  • EXPORT_SYMBOL_GPL
  • Out-of-tree Makefiles
  • Module initialization tools
  • Adding modules to the kernel tree
  • Kconfig
  • Passing parameters to modules
  • Sparse static analysis

Character Drivers

  • Architecture
  • User/kernel interface
  • I/O subsystem
  • Virtual File System (VFS)
  • sysfs (devices, buses, drivers, classes)
  • kobject, ktype, and kset
  • The Linux kernel driver model
  • Device files
  • Character driver
    • Initialization
    • Registration
    • Open and release operations
    • cdev, cdev_add, cdev_del, and related functions
    • Major and minor numbers
    • udev, udevmonitor, and udevadm

Advanced Character Driver Operations

  • ioctl
  • Unlocked ioctl
  • Compatibility ioctl
  • User-space API
  • Kernel-space API
  • Process lifecycle
  • Sleeping and blocking operations
  • Waking up processes
  • Wait queues
  • The thundering herd problem
  • Poll and select mechanisms

Kernel Debugging

  • Debugging techniques
  • Debugging the kernel
    • Binary search using Git
    • Kernel debug support
    • printk, syslogd, klogd, loglevels, rate limiting, debug levels, and selective subsystem debugging
    • Debugging via debugfs queries
    • Oops debugging and triggering oopses
    • 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 handling
  • Program sections
  • Reentrancy
  • Events
  • Interrupt handlers
  • Shared interrupt handlers
  • Interrupt flow
  • Interrupt control

Deferring Work

  • Top-half and bottom-half processing
  • Softirqs
  • Tasklets
  • Work queues
  • Threaded interrupts

Concurrency

  • Critical regions and sections
  • Atomic operations
  • Race conditions
  • Synchronization techniques
  • Locking mechanisms
  • Locking solutions
  • Deadlocks
  • Contention
  • Deciding what to lock
  • Available locking primitives
    • Atomic operations
    • Spinlocks
    • Reader-writer spinlocks
    • Semaphores
    • Binary semaphores
    • Mutexes
    • Reader-writer semaphores
    • Completion variables
    • Seqlocks
    • Disabling preemption
    • Ordering and barriers

Time

  • HZ configuration
  • Jiffies
  • 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
  • Memory mapping
  • procfs
  • sysfs
  • debugfs
  • relayfs
  • Netlink sockets
  • ioctl

Portability

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

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

Requirements

  • Basic familiarity with using a GNU/Linux system as an end user
  • Basic familiarity with a command-line shell
  • Foundational knowledge of user-space and application development
  • Intermediate proficiency in C programming
  • Previous attendance at Embedded GNU/Linux Systems Architecture is strongly recommended, along with a solid understanding of the topics covered therein
 35 Hours

Number of participants


Price per participant

Testimonials (3)

Upcoming Courses

Related Categories