Get in Touch

Course Outline

Introduction

  • Historical overview of GNU/Linux
  • Licensing models
  • Kernel versioning schemes
  • Release cycles
  • Kernel tree structures
  • The mainline kernel
  • Distinction between kernel space and user space
  • Mechanism versus policy
  • Alternatives to kernel drivers
  • RTOS compared to Linux

Memory Management

  • Virtual memory versus physical memory
  • Kernel memory allocation strategies
  • Memory pages
  • Memory zones
  • Relevant APIs
  • Slab allocator

Kernel Patching

  • Patch lifecycle
  • Utilizing Git
  • Navigating kernel sources
  • Creating patches
  • Verifying patches with checkpatch
  • Correcting patches
  • Submitting patches
  • Code auditing standards

Kernel Modules

  • Acquiring kernel sources
  • Configuration, building, and installation
  • Device drivers: static linking and runtime loading
  • Init and exit functions
  • Licensing requirements
  • EXPORT_SYMBOL and GPL compatibility
  • Out-of-tree Makefiles
  • Module initialization tools
  • Integrating modules into the kernel tree
  • Kconfig systems
  • Passing parameters to modules
  • Using Sparse for static analysis

Character Drivers

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

Advanced Character Driver Operations

  • ioctl commands
  • Unlocked ioctl
  • Compatible ioctl handling
  • User-space APIs
  • Kernel-space APIs
  • Process lifecycle management
  • Sleeping and blocking techniques
  • Waking up processes
  • Wait queues
  • The thundering herd problem
  • Poll and select mechanisms

Kernel Debugging

  • General debugging techniques
  • Debugging the kernel
    • Using Git for binary search debugging
    • Built-in kernel debug support
    • printk, syslogd, klogd, log levels, rate limiting, and selective subsystem debugging
    • Debugging via debugfs queries
    • Oops debugging and triggering oopses
    • Magic SysRq Key functionality
    • kgdb and kdb
    • JTAG debugging

Tracing

  • gcov coverage tools
  • lcov visualization
  • oprofile analysis
  • ftrace subsystem
    • nop tracer
    • function tracer
    • sched_switch tracer
    • function_graph tracer
    • dynamic tracer
  • trace-cmd and kernelshark
  • perf tool
  • LTTng tracing

Interrupts

  • Interrupts versus polling
  • Interrupt fundamentals
  • Program sections and execution flow
  • Reentrancy concepts
  • Event handling
  • Interrupt handlers
  • Shared interrupt handlers
  • Interrupt flow control
  • Interrupt management

Deferring Work

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

Concurrency

  • Critical regions and sections
  • Atomic operations
  • Race conditions
  • Synchronization strategies
  • Locking mechanisms
  • Locking solutions
  • Deadlock prevention
  • Contention management
  • Identifying 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
  • Jiffies usage
  • Managing delays (large and small)
  • Kernel timers

Hardware I/O

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

User-Kernel Communication

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

Portability

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

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

Requirements

  • Fundamental understanding of using a GNU/Linux system as an end user
  • Basic proficiency with a command-line shell
  • Foundational knowledge of user-space or application development
  • Intermediate proficiency in C programming
  • Completion of Embedded GNU/Linux Systems Architecture is highly recommended, along with a solid grasp of the topics covered in that course.
 35 Hours

Number of participants


Price per participant

Testimonials (3)

Upcoming Courses

Related Categories