Linux Kernel Internals and Development

4 Day Course
Hands On
Official The Linux Foundation Curriculum
Code LFD420

Book Now - 3 Delivery Methods Available:

Scheduled Virtual Onsite

Overview

This course is designed to provides experienced programmers with a solid understanding of the Linux kernel. In addition to a detailed look at the theory and philosophy behind the Linux kernel, you’ll also participate in extensive hands-on exercises and demonstrations designed to give you the necessary tools to develop and debug Linux kernel code.

In this course you’ll learn how Linux is architected, the basic methods for developing on the kernel, and how to efficiently work with the Linux developer community. If you are interested in learning about the Linux kernel, this is absolutely the definitive course on the subject.

In this course you’ll learn:

  • How Linux is architected
  • How kernel algorithms work
  • Hardware and memory management
  • Modularization techniques and debugging
  • How the kernel developer community operates and how to efficiently work with it.
  • And much more.

The information in this course will work with any major Linux distribution.

Modules

Hide all

Introduction (5 topics)

  • Objectives
  • Who You Are
  • The Linux Foundation
  • Linux Foundation Training
  • Course Registration

Preliminaries (7 topics)

  • Procedures
  • Things change in Linux
  • Linux Distributions
  • Kernel Versions
  • Kernel Sources and Use of git
  • Platforms
  • Documentation and Links

Kernel Architecture I (6 topics)

  • UNIX and Linux
  • Monolithic and Micro Kernels
  • Object-Oriented Methods
  • Main Kernel Tasks
  • User-Space and Kernel-Space
  • Kernel Mode Linux

Kernel Programming Preview (8 topics)

  • Error Numbers and Getting Kernel Output
  • Task Structure
  • Memory Allocation
  • Transferring Data between User and Kernel Spaces
  • Linked Lists
  • String to Number Conversions
  • Jiffies
  • Labs

Modules (12 topics)

  • What are Modules?
  • A Trivial Example
  • Compiling Modules
  • Modules vs Built-in
  • Module Utilities
  • Automatic Loading/Unloading of Modules
  • Module Usage Count
  • The module struct
  • Module Licensing
  • Exporting Symbols
  • Resolving Symbols
  • Labs

Kernel Architecture II (7 topics)

  • Processes, Threads, and Tasks
  • Process Context
  • Kernel Preemption
  • Real Time Preemption Patch
  • Dynamic Kernel Patching
  • Run-time Alternatives
  • Porting to a New Platform

Kernel Initialization (3 topics)

  • Overview of System Initialization
  • System Boot
  • Das U-Boot for Embedded Systems

Kernel Configuration and Compilation (6 topics)

  • Installation and Layout of the Kernel Source
  • Kernel Browsers
  • Kernel Configuration Files
  • Kernel Building and Makefiles
  • initrd and initramfs
  • Labs

System Calls (6 topics)

  • What are System Calls?
  • Available System Calls
  • How System Calls are Implemented
  • Adding a New System Call
  • Replacing System Calls from Modules
  • Labs

Kernel Style and General Considerations (13 topics)

  • Coding Style
  • kernel-doc
  • Using Generic Kernel Routines and Methods
  • Making a Kernel Patch
  • sparse
  • Using likely() and unlikely()
  • Writing Portable Code, CPU, 32/64-bit, Endianness
  • Writing for SMP
  • Writing for High Memory Systems
  • Power Management
  • Keeping Security in Mind
  • Mixing User- and Kernel-Space Headers
  • Labs

Race Conditions and Synchronization Methods (12 topics)

  • Concurrency and Synchronization Methods
  • Atomic Operations
  • Bit Operations
  • Spinlocks
  • Seqlocks
  • Disabling Preemption
  • Mutexes
  • Semaphores
  • Completion Functions
  • Read-Copy-Update (RCU)
  • Reference Counts
  • Labs

SMP and Threads (6 topics)

  • SMP Kernels and Modules
  • Processor Affinity
  • CPUSETS
  • SMP Algorithms - Scheduling, Locking, etc.
  • Per-CPU Variables
  • Labs

Processes (7 topics)

  • What are Processes?
  • The task_struct
  • Creating User Processes and Threads
  • Creating Kernel Threads
  • Destroying Processes and Threads
  • Executing User-Space Processes From Within the Kernel
  • Labs

Process Limits and Capabilities (3 topics)

  • Process Limits
  • Capabilities
  • Labs

Monitoring and Debugging (8 topics)

  • Debuginfo Packages
  • Tracing and Profiling
  • sysctl
  • SysRq Key
  • oops Messages
  • Kernel Debuggers
  • debugfs
  • Labs

Scheduling Basics (10 topics)

  • Main Scheduling Tasks
  • SMP
  • Scheduling Priorities
  • Scheduling System Calls
  • The 2.4 schedule() Function
  • O(1) Scheduler
  • Time Slices and Priorities
  • Load Balancing
  • Priority Inversion and Priority Inheritance
  • Labs

Completely Fair Scheduler (CFS) (5 topics)

  • The CFS Scheduler
  • Calculating Priorities and Fair Times
  • Scheduling Classes
  • CFS Scheduler Details
  • Labs

Memory Addressing (12 topics)

  • Virtual Memory Management
  • Systems With no MMU
  • Memory Addresses
  • High and Low Memory
  • Memory Zones
  • Special Device Nodes
  • NUMA
  • Paging
  • Page Tables
  • page structure
  • Kernel Samepage Merging (KSM)
  • Labs

Huge Pages (4 topics)

  • Huge Page Support
  • libhugetlbfs
  • Transparent Huge Pages
  • Labs

Memory Allocation (9 topics)

  • Requesting and Releasing Pages
  • Buddy System
  • Slabs and Cache Allocations
  • Memory Pools
  • kmalloc()
  • vmalloc()
  • Early Allocations and bootmem()
  • Memory Defragmentation
  • Labs

Process Address Space (7 topics)

  • Allocating User Memory and Address Spaces
  • Locking Pages
  • Memory Descriptors and Regions
  • Access Rights
  • Allocating and Freeing Memory Regions
  • Page Faults
  • Labs

Disk Caches and Swapping (10 topics)

  • Caches
  • Page Cache Basics
  • What is Swapping?
  • Swap Areas
  • Swapping Pages In and Out
  • Controlling Swappiness
  • The Swap Cache
  • Reverse Mapping
  • OOM Killer
  • Labs

Device Drivers (5 topics)

  • Types of Devices
  • Device Nodes
  • Character Drivers
  • An Example
  • Labs

Signals (10 topics)

  • What are Signals?
  • Available Signals
  • System Calls for Signals
  • Sigaction
  • Signals and Threads
  • How the Kernel Installs Signal Handlers
  • How the Kernel Sends Signals
  • How the Kernel Invokes Signal Handlers
  • Real Time Signals
  • Labs

Prerequisites

Students should be proficient in the C programming language, basic Linux (UNIX) utilities such as ls, grep and tar, and be comfortable with any of the available text editors (e.g. emacs, vi, etc.) Experience with any major Linux distribution is helpful but not strictly required.

Scheduled Dates

Please select from the dates below to make an enquiry or booking.

Pricing

Different pricing structures are available including special offers. These include early bird, late availability, multi-place, corporate volume and self-funding rates. Please arrange a discussion with a training advisor to discover your most cost effective option.

Code Location Duration Price Oct Nov Dec Jan Feb Mar
LFD420

(Classroom or Virtual)
4 Days $2,495
14-17

Course PDF

Print

Share this Course

+1
Share

Recommend this Course

Sections