Get in Touch

Course Outline

Introduction

  • A brief history of GNU/Linux
  • Licensing models
  • Kernel versioning
  • Release cycles
  • Kernel trees
  • Mainline kernel
  • Kernel vs. user space
  • Mechanism vs. policy
  • Alternatives for kernel drivers
  • RTOS vs. Linux

Memory Management

  • Virtual memory vs. physical memory
  • Memory allocation in the kernel
  • Pages
  • Zones
  • Memory management API
  • Slab allocator

Kernel Patching

  • Lifecycle of a patch
  • Using git
  • Kernel source code
  • Creating patches
  • Checking patches
  • Fixing patches
  • Submitting patches
  • Audited code

Kernel Modules

  • Acquiring kernel sources
  • Configuration, building, and installation
  • Device drivers (statically linked and loaded at runtime)
  • Initialization and exit functions
  • Licensing implications
  • EXPORT_SYMBOL_GPL
  • Out-of-tree Makefiles
  • module-init-tools
  • Adding modules to the kernel tree
  • Kconfig
  • Passing parameters to modules
  • Sparse static analysis

Character Drivers

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

Advanced Character Driver Operations

  • ioctl
  • Unlocked ioctl
  • Compat ioctl
  • User-space API
  • Kernel-space API
  • Process lifecycle
  • Sleeping and blocking
  • Sleeping and waking up
  • Wait queues
  • Thundering herd problem
  • Poll and select

Kernel Debugging

  • General debugging concepts
  • Debugging the kernel
    • Binary search with git
    • Kernel debug support
    • printk, syslogd, klogd, log levels, rate limits, debug levels, and selective subsystem debugging
    • Debugging via debugfs
    • Oops debugging and triggering 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/kernelshark
  • perf
  • LTTng

Interrupts

  • Interrupts vs. 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
  • Workqueues
  • Threaded interrupts

Concurrency

  • Critical regions/sections
  • Atomic operations
  • Race conditions
  • Synchronization
  • Locking mechanisms
  • Locking solutions
  • Deadlocks
  • Contention
  • What to lock?
  • What synchronization primitives can be used?
    • Atomic operations
    • Spinlocks
    • Reader-writer spinlocks
    • Semaphores
    • Binary semaphores
    • Mutexes
    • Reader-writer semaphores
    • Completion variables
    • Seqlocks
    • Disabling preemption
    • Ordering and memory barriers

Timekeeping

  • 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
  • Memory mapping
  • procfs
  • sysfs
  • debugfs
  • relayfs
  • netlink
  • ioctl

Portability

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

Except where otherwise noted, 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
  • Basic knowledge of user-space or application development
  • Intermediate proficiency in C programming
  • Participants should have previously attended Embedded GNU/Linux Systems Architecture (strongly recommended) and/or possess a solid understanding of the topics covered in that course.
 35 Hours

Number of participants


Price per participant

Testimonials (3)

Upcoming Courses

Related Categories