Linux Kernel Internals and Development (LFD420)
Dive into Linux kernel development—explore Linux architecture, master essential kernel development methods, and learn to collaborate effectively with the Linux developer community
Description
Dive into Linux kernel development—explore Linux architecture, master essential kernel development methods, and learn to collaborate effectively with the Linux developer community
Summary
Dive into Linux kernel development—explore Linux architecture, master essential kernel development methods, and learn to collaborate effectively with the Linux developer community
What You'll Learn
- In this course you will 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
Prerequisites
- 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.
Outline
- Objectives
- Who You Are
- The Linux Foundation®
- Copyright and No Confidential Information
- The Linux Foundation® Training
- Certification Programs and Digital Badging
- Linux Distributions
- Platforms
- Preparing Your System
- Using and Downloading a Virtual Machine
- Things Change in Linux and Open Source Projects
- Documentation and Links
- Procedures
- Kernel Versions
- Kernel Sources and Use of git
- Labs
- Overview on How to Contribute Properly
- Know Where the Code is Coming From: DCO and CLA
- Stay Close to Mainline for Security and Quality
- Study and Understand the Project DNA
- Figure Out What Itch You Want to Scratch
- Identify Maintainers and Their Work Flows and Methods
- Get Early Input and Work in the Open
- Contribute Incremental Bits, Not Large Code Dumps
- Leave Your Ego at the Door: Don't Be Thin-Skinned
- Be Patient, Develop Long Term Relationships, Be Helpful
- UNIX and Linux
- Monolithic and Micro Kernels
- Object-Oriented Methods
- Main Kernel Components
- User-Space and Kernel-Space
- Error Numbers and Getting Kernel Output
- Task Structure
- Memory Allocation
- Transferring Data between User and Kernel Spaces
- Object-Oriented Inheritance - Sort Of
- Linked Lists
- String to Number Conversions
- Jiffies
- Labs
- What are Modules?
- A Trivial Example
- Compiling Modules
- Modules vs Built-in
- Module Utilities
- Automatic Module Loading
- Module Usage Count
- The module struct
- Module Licensing
- Exporting Symbols
- Resolving Symbols
- Labs
- Processes, Threads, and Tasks
- Process Context
- Kernel Preemption
- Real Time Preemption
- Dynamic Kernel Patching
- Run-time Alternatives
- Porting to a New Platform
- Labs
- Overview of System Initialization
- System Boot
- Das U-Boot for Embedded Systems
- Kernel Startup
- Installation and Layout of the Kernel Source
- Kernel Browsers
- Kernel Configuration Files
- Kernel Building and Makefiles
- initrd and initramfs
- Labs
- What are System Calls?
- Available System Calls
- How System Calls are Implemented
- Adding a New System Call
- Labs
- 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
- Concurrency and Synchronization Methods
- Atomic Operations
- Bit Operations
- Spinlocks
- Seqlocks
- Disabling Preemption
- Mutexes
- Semaphores
- Completion Functions
- Read-Copy-Update (RCU)
- Reference Counts
- Labs
- SMP Kernels and Modules
- Processor Affinity
- CPUSETS
- SMP Algorithms - Scheduling, Locking, etc.
- Per-CPU Variables
- Labs
- 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
- Capabilities
- Labs
- Debuginfo Packages
- Tracing and Profiling
- sysctl
- SysRq Key
- oops Messages
- Kernel Debuggers
- debugfs
- Labs
- 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
- The CFS Scheduler
- Calculating Priorities and Fair Times
- Scheduling Classes
- Scheduler Details
- Labs
- Virtual Memory Management
- Systems With and Without MMU and the TLB
- Memory Addresses
- High and Low Memory
- Memory Zones
- Special Device Nodes
- NUMA
- Paging
- Page Tables
- page structure
- Kernel Samepage Merging (KSM)
- Labs
- Huge Page Support
- Transparent Huge Pages
- libhugetlbfs
- Labs
- Requesting and Releasing Pages
- Buddy System
- Slabs and Cache Allocations
- Memory Pools
- kmalloc()
- vmalloc()
- Early Allocations and bootmem()
- Memory Defragmentation
- Labs
- Allocating User Memory and Address Spaces
- Locking Pages
- Memory Descriptors and Regions
- Access Rights
- Allocating and Freeing Memory Regions
- Page Faults
- Labs
- Caches
- Page Cache Basics
- What is Swapping?
- Swap Areas
- Swapping Pages In and Out
- Controlling Swappiness
- The Swap Cache
- Reverse Mapping
- OOM Killer
- Labs
- Types of Devices
- Device Nodes
- Character Drivers
- An Example
- Labs
- 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