Linux Kernel Internals and Device Driver Programming

Course

Inhouse

Price on request

Description

  • Type

    Course

  • Methodology

    Inhouse

  • Duration

    5 Days

You will gain a comprehensive understanding of Linux Kernel building, kernel and device driver programming, and experience of device drivers for components and protocols often found in embedded systems such as I2C, SPI, Bluetooth and USB. You'll consolidate your knowledge with practical labs, including: Investigating process creation and management in the Linux kernel. Suitable for: Attendees are expected to be proficient C programmers and have a good working knowledge of Linux or Unix. Courses ELIN101 "Linux for Embedded and Real Time System Developers" and SMC103 "Introduction to C Programming for Embedded Systems" provide suitable background.

Questions & Answers

Add your question

Our advisors and other users will be able to reply to you

Who would you like to address this question to?

Fill in your details to get a reply

We will only publish your name and question

Reviews

Course programme

Overview
Developers building embedded solutions using Linux often need to make kernel-level modifications, or to write drivers for custom hardware. This advanced programming course provides an intensive overview of the Linux 2.6 kernel, kernel level programming and device driver theory and implementation, as well as kernel configuration and compilation. Code will be developed and tested on both a Debian 2.6 kernel running on a PC Platform and an ELinos 2.6 kernel running on an ARM 9 target board.

Course Benefits
You will gain a comprehensive understanding of Linux Kernel building, kernel and device driver programming, and experience of device drivers for components and protocols often found in embedded systems such as I2C, SPI, Bluetooth and USB. You'll consolidate your knowledge with practical labs, including:
  • Investigating process creation and management in the Linux kernel
  • Investigating inter-process communication mechanisms
  • Implementing and testing a loadable module
  • Building a character device driver as a loadable module
  • Building and testing a block device driver as a loadable module
  • Building and testing an I2C network interface driver
  • Building and testing a driver for a stepper motor controller
As additional benefit, you'll take home copies of two books: "Linux Device Drivers" (3rd edition) by Rubini, and "Linux Kernel Development" (2nd edition) by Love.

Course Contents
Linux Background
  • The evolution of Linux
  • Linux and the POSIX API
  • Understanding how the Linux Kernel is split up
  • The major differences between Linux 1.x and Linux 2.x
  • Key changes between Linux 2.4 and Linux 2.6
Linux Internals - the key parts
  • Memory addressing - segmentation and paging
  • Process creation, process switching, process destruction
  • Interrupts and Exception Handling
  • Time, timing and timer interrupts
  • Memory management and the process address space
  • System calls, signals and the POSIX API
  • I/O Devices
  • File systems - VFS, EXT2, Flash File Systems
  • Inter-process communication
  • Program loading and execution
Modules
  • Loadable modules and insmod
  • Security issues with loadable modules
  • Applications compared to kernel modules
  • User space, kernel space
  • Compiling and loading a module
  • Initialisation, shutdown and error handling by a module
  • Usage counting and module unloading
  • How a module acquires and accesses system resources (I/O Ports, I/O memory)
  • Automatic and manual configuration
  • User space drivers
Character Drivers
  • Major and minor device numbers
  • Dynamic allocation of major numbers
  • File operations - the file_operations structure and the file structure
  • Case study - Rubini and Corbet's scull device
  • Getting applications to use new devices
Device drivers
  • Device driver testing and debugging
  • Using ioctl commands
  • Blocking vs. non-blocking I/O
  • Controlling access to a device
Time and the Linux Kernel
  • Timer interrupts and kernel time
  • Kernel time and the jiffies variable
  • Task queues
  • Understanding kernel timers
  • Tasklets and deferred work
Memory management - basics
  • kmalloc
  • Lookaside caches
  • vmalloc
  • Boot time memory allocation
Hardware management and usage - basics
  • I/O Ports and I/O Memory
  • Interrupts and Interrupt handling
  • The /proc interface
  • Circular buffers
  • Spinlocks
  • Race conditions
Block drivers
  • Registering
  • Handling requests - and data transfer
  • Queuing and block drivers
  • The ioctl command and block drivers
Case studies
  • USB device drivers
  • I2C and SPI device drivers
  • CAN device drivers
  • Bluetooth device drivers
  • Network device drivers
  • Overview of the Linux TCP/IP Protocol stack
  • TCP/IP over Ethernet
  • PPP over a dial-up modem connection
  • TCP/IP over USB
  • TCP/IP over Bluetooth
  • A/D and D/A for control applications

Linux Kernel Internals and Device Driver Programming

Price on request