Tel No. (+91) 944 501 7608

  Linux Kernel Programming




    Training Home

DEC403 : Linux Kernel Programming Development Training


Summary
Course code : DEC403
Training Mode : Corporate Onsite, Class Room, Online
Duration : 40 Hrs
Course Fee : Enquire
Registration : Register to confirm the batch. (Min Strength of Batch is 4 and Max is 12 )

Linux Kernel Internals and Programming Training in Bangalore

Overview

Linux® Kernel Internals (DEC403) is a hands-on course providing experienced developers an intensive, low-level examination of the Linux kernel architecture. Topics include kernel compilation, debugging tools and techniques, and internal kernel APIs, including synchronization, process management and memory management. These topics provide a solid understanding of the kernel’s architecture. Further you can develop device drivers in course DEC402

Target Audience:

Experienced developers who want to gain a thorough understanding of the Linux kernel architecture.

Course Obejctives

  • Working with the Developer Community
  • User Mode and Kernel Mode
  • Kernel Compilation and Tools
  • Modules
  • Kernel API Overview
  • Synchronization
  • Kernel Debugging 1: Tools and Techniques
  • Device Driver Overview
  • Memory Management
  • Processes Managment
  • The Scheduler
  • Kernel Timing
  • SystemTap
  • System and Kernel Initialization
  • Kernel Debugging 2: Crash Dumps
  • Linux Realtime Kernel
  • Interrupts

linux kernel programming

Prerequisites:

  • Experience in C programming
  • Knowledge of systems programming in a UNIX or Linux environment
  • Register-level hardware programming knowledge is recommended but not required
  • Familiarity with basic tools, such as vi, Emacs, and shell utilities
  • Familiarity with UNIX development tools, such as gcc and make

linux kernel programming training in hyderabad

Course Syllabus

1. General OS Architecture
  • OS Architecture
2. User Mode and Kernel Mode
  • The Linux Kernel - An Overview
  • The Role of the Kernel
  • Kernel Contexts
  • Four Milliseconds in the Life of the Kernel
  • System Ring Levels
  • Kernel Mode
  • User Mode
  • Mode Switching Example: System Calls
  • x86 System Call Interface
  • x86 System Call Interface (cont.)
  • Mode Switching Example: IRQ Event
  • Kernel Mode Linux
3. Kernel Compilation and Tools
  • Kernel Packages
  • Kernel Version
  • Kernel Documentation
  • Kernel Source Layout
  • Kernel Source Layout (cont.)
  • Recompiling the Red Hat Kernel
  • Install Kernel Development Packages
  • Kernel Source Package
  • Preparing Source Code for Compilation
  • Customizing Kernel Name (Optional)
  • Choosing Compilation Options
  • Compiling the Kernel and Modules
  • Installing the Kernel Modules
  • Installing the Compiled Kernel and Related
  • Files
  • Kernel Application Binary Interface (kABI)
  • cscope
  • LXR
  • git
  • git Documentation
4. Modules
  • Kernel Modules
  • Kernel Module Utilities
  • Mapping Modules to Attached Devices
  • Kernel Module Essentials
  • modinfo Macros
  • printk()
  • /proc/kmsg and klogd
  • printk() Loglevels
  • Rate Limiting printk()
  • Putting It All Together: A Simple Module
  • Compiling a Module
  • Integrating A New Module with the Kernel
  • Makefile and Kconfig
  • Module Parameters
  • Example: Module with Parameter
5. Kernel API Overview
  • Multitasking, Stacks, and Task-Descriptors
  • Contents of a Program's Stack
  • Kernel Mode Switch and the Stack
  • Task Structures
  • What Is a Process?
  • thread_info Structure
  • task_struct: Process Identifiers
  • task_struct: Process State
  • task_struct: Scheduling Information
  • Doubly Linked Lists
  • Doubly Linked Lists: Manipulation
  • Doubly Linked Lists: Iteration
  • Doubly Linked Lists: Processes
  • task_struct: Related Processes
  • task_struct: Statistics
  • Allocating Kernel Memory: kmalloc()
  • Memory Cache Optimizations: Branch
  • Prediction
  • Memory Cache Optimizations: Binding
  • Structures
  • Generating Kernel Errors
6. Synchronization
  • Critical Sections
  • Mutual Exclusion Devices
  • Linux Mutex Toolbox
  • Atomic Bit Operations
  • Atomic Integers
  • Spinlocks
  • Spinlocks and Local Interrupts
  • Read-Write Spinlocks
  • Mutexes
  • Semaphores
  • Spinlock/Mutex Example
  • Alternatives to Locking
  • Sequential Locks
  • Read-Copy-Update (RCU)
  • Linux RCU Implementation
  • Per-CPU Variables
  • Completions
  • The Big Kernel Lock
7. Kernel Debugging 1: Tools and Techniques
  • Debugging Preparations
  • kernel-debuginfo Warnings
  • Kernel vs. User Space
  • Live vs. Postmortem Debugging
  • Crashes vs. Hangs
  • Debugging Device Drivers
  • User Space Debugging Tools
  • /proc Kernel Information
  • kernel.panic Tunable and Kernel Crashes
  • /sys Filesystem
  • debugfs Filesystem
  • Printing from the Kernel
  • Kernel Oops Messages
  • SysRq Mechanism
  • sosreport
  • The crash Tool
  • crash Requirements
  • crash Installation
  • crash Invocation
  • crash Invocation Output
  • crash Help
  • crash Command Input
  • crash Command Output
  • crash Command Overview
  • crash Default Context
8. Interrupts
  • Interrupts
  • Nature of Interrupts
  • Types of Interrupts
  • Interrupt Specific Hardware
  • Interrupt Descriptor Table (IDT)
  • IDT Initialization
  • IDT Initialization Functions
  • Exception Handling
  • Asynchronous Interrupt Handling
  • Interrupt Handler Considerations
  • irq_desc Structure
  • irqaction Structure
  • Interrupt Handler Registration
  • Performing Deferred Work
  • Softirqs
  • Using Softirqs
  • Tasklets
  • Using Tasklets
  • Work Queues
  • Work Queue Data Structures
  • Using Work Queues
9. Device Driver Overview
  • Device Drivers
  • Device Types
  • Device Nodes
  • Creating a Device Node
  • Dynamic Loading of Driver Modules
  • Major and Minor Numbers
  • Dynamic Major and Minor Numbers
  • Dynamically Created Device Nodes
  • Dynamically Created Device Nodes Made Easy
  • Device Driver Essentials
  • Character Device Registration
  • Device Driver File Operations
  • Driver Methods
  • The file Structure
  • The inode Structure
  • The open and release Methods
  • The read and write Methods
  • Module Usage Count
  • Simple Character Driver Example
10. Processes
  • Creating Processes
  • Sharing Resources
  • do_fork()
  • Process Memory Maps
  • Memory Areas
  • vm_flags
  • pmap
  • Kernel Threads
  • Process 0
  • Destroying Processes
  • Context Switches
  • When Does Context Switching Occur?
  • When Is need_resched Set?
  • When Is schedule() Called?
  • Kernel Preemption
11. The Scheduler
  • Priority
  • Priority for Normal Processes
  • Priority for Real-Time Processes
  • Time Slices
  • The O(1) Scheduler: Run Queues
  • The O(1) Scheduler: Priority Arrays
  • The O(1) Scheduler: How it works
  • Wait Queues
  • The O(1) Scheduler: Load Balancing
  • The O(1) Scheduler: load_balance()
  • Problems with the O(1) Scheduler
  • O(1) Scheduler vs. CFS
  • Overview of CFS
  • Details of CFS
  • CFS Task Scheduling
  • CFS Scheduler Policies
  • CFS Scheduler Classes
  • CFS fair_sched_class
  • CFS Tuning
  • CFS Group Scheduling
  • CONFIG_FAIR_GROUP_SCHED
  • CONFIG_FAIR_CGROUP_SCHED
12. Memory Management
  • Virtual Memory and Paging
  • x86 Memory Architecture
  • Memory Segmentation in Linux
  • x86 Segmentation
  • x86 Segmentation in Linux
  • Memory Paging
  • Page Tables
  • Mapping Virtual Addresses (x86)
  • Mapping Virtual Addresses (x86-64)
  • Memory Zones
  • Arranging the Virtual Address Space
  • ZONE_NORMAL
  • ZONE_HIGHMEM
  • ZONE_DMA
  • Kernel Memory Allocation
  • Memory Management
  • Buddy Allocator
  • Requesting and Releasing Page Frames
  • Slab Allocator
  • Slab Allocator (cont.)
  • Non-Contiguous Memory Area
  • Management
  • Memory Flags: gfp_mask
  • __get_free_pages()
  • kmalloc()
  • vmalloc()
13. Kernel Timing
  • The Need for Timing
  • Timing Hardware
  • Timing Source Selection
  • Wall/Real Time: xtime
  • Wall Clock System Calls
  • Kernel Ticks: jiffies
  • Software Timers
  • POSIX Timers
  • Interval Timers and alarm()
  • High-Resolution Timers
  • Timer Interrupt Handler
  • TIMER_SOFTIRQ Softirq
  • Delay Functions
  • SystemTap
  • line
  • Introduction to SystemTap
  • SystemTap's Main Components
  • Monitoring the Kernel with SystemTap
  • The stap Command
  • Flow of Data in SystemTap
  • Common Tapset Probe Points
  • SystemTap Script Examples
14. System and Kernel Initialization
  • Boot Sequence Overview
  • BIOS Initialization
  • Bootloader
  • Starting the Boot Process: GRUB
  • Bootloader Components
  • The Chicken/Egg Module Problem and the Initial RAM Disk
  • GRUB and grub.conf
  • Kernel Initialization Overview
  • __init and __initdata
  • Initialization Subsections and Ordering
  • Kernel Initialization
  • init/main.c: start_kernel()
  • init/main.c: rest_init()
  • init/main.c: init()
  • init/main.c: do_basic_setup()
  • init/main.c: init_post()
  • init Initialization
  • Run Levels
15. Kernel Debugging 2: Crash Dumps
  • Introduction to Crash Dumps
  • Netdump/Diskdump Challenges
  • Kdump
  • Kdump Solution
  • Kexec
  • Relocatable Kernel
  • In-place Kernel Decompression
  • Starting Kdump
  • Kdump Initrd Image
  • Configuring Kdump
  • Kdump Core Dumps to the Local System
  • Kdump Core Dumps to NFS Mount Points
  • Kdump Core Dumps to SSH Servers
  • Dump File Size
  • Customizing the Dump Capture Method:
  • makedumpfile
  • Dump Filtering
  • Dump Compression
  • Future Challenges
16. Linux Realtim Kernel
  • Realtime (RT) Linux
  • Benefits of a Realtime Kernel
  • Response Time Comparisons
  • Wake-Up Response Time Example
  • Changes in the Kernel
  • Changes in the C Library
  • RT Measurement Tools
  • RT Tuning Tools
  • RT Tuning Methods
  • Loading the RT Kernel

Download   Enquire Us

Note:

** These sections may be considered in part or in whole as optional. They contain background reference material, specialized topics, or advanced subjects. The instructor may choose to cover or not cover them depending on classroom experience and time constraints.