Overview
This course provides an in-depth exploration of Linux kernel architecture, focusing on its internals and development for embedded systems. Participants will gain practical knowledge in kernel modules, character and block device drivers, and network drivers. The course also covers essential kernel features such as multitasking, memory management, and inter-process communication. Hands-on labs using QEMU and Beaglebone Black will reinforce practical skills in kernel programming and troubleshooting.
Objectives
By the end of this course, leaner will be able to:
-
Understand the Linux kernel architecture and its components
-
Develop and load kernel modules to extend kernel functionality
-
Write character device drivers for custom hardware interactions
-
Implement block device drivers for storage devices
-
Develop network device drivers for communication interfaces
-
Apply kernel features like multitasking and inter-process communication
-
Debug and troubleshoot kernel code effectively
-
Implement embedded system solutions using Linux kernel
Prerequisites
-
Embedded C
-
Basic Linux Usage
Course Outline
-
Overview of Linux kernel architecture and components
-
Kernel source code structure and navigation
-
Kernel build system and configuration
-
Kernel booting and initialization process
-
Development environment setup for kernel programming
-
Introduction to QEMU and Beaglebone Black as target platforms
-
Understanding kernel modules and their benefits
-
Building and loading kernel modules
-
Working with module parameters and lifecycle management
-
Logging and debugging using printk
-
Practical exercise: Developing a simple Hello World kernel module
-
Character device driver framework and file operations
-
Implementing open, read, write, ioctl, and close functions
-
Device registration, major and minor numbers, and udev usage
-
Memory-mapped I/O and I/O port interactions
-
Practical exercise: Creating a character driver for a virtual device using QEMU
-
Understanding block device driver framework
-
Request queue and I/O scheduling concepts
-
Implementing block device operations
-
Working with partitions and file systems
-
Practical exercise: Building a simple RAM disk block driver
-
Overview of network stack and driver interaction
-
Introduction to net_device structure and Ethernet drivers
-
Packet reception, transmission, and driver configuration
-
Practical exercise: Developing a basic network driver for a loopback interface (conceptual)
-
Process and thread management in Linux kernel
-
Inter-process communication using pipes, semaphores, and shared memory
-
Memory management concepts: virtual memory, paging, and allocation
-
Synchronization mechanisms: spinlocks and mutexes
-
Kernel timers and workqueues
-
Debugging kernel code using printk, kdump, and kgdb
-
Analyzing kernel logs and crash dumps
-
Using gdb for kernel-level debugging
-
Troubleshooting common kernel issues