Embedded Linux Device Drivers and Kernel Internals

5 Day Course
Code PSD162

Book Now - 1 Delivery Method Available:

Scheduled Online Onsite

Overview

This 5-day training class uses hands-on exercises combined with instruction to illustrate the concepts of GNU/Linux kernel internals and device driver development. It is designed to bring you quickly up to speed. We describe processes, concepts and commands necessary to write GNU/Linux device drivers through a combination of theory and on-the-job training. Don’t reinvent the wheel, but learn from an experienced trainer and take home a working knowledge and the ability to use it effectively in your own embedded development project.

Objectives

To provide an understanding of the essentials necessary to write a GNU/Linux Device Driver. How-to’s, theory and hands-on excercises provide you with the necessary experience to interact with community from the very beginning and to write your own GNU/Linux Device Driver after successfully completing this training.

Modules

Hide all

Introduction (1 topic)

  • Quick history of GNU/Linux, licensing, kernel versioning, release cycle, kernel trees, mainline, kernel vs. user space, mechanism vs. policy, kernel driver alternatives, RTOS vs. Linux

Memory Management (1 topic)

  • Virtual memory vs. physical memory, memory allocation in kernel, pages, zones, API, slab

Kernel Patch (1 topic)

  • Life cycle, git, kernel source, create patch, check patch, fix patch, ship patch, audited code

Kernel Module (2 topics)

  • Get kernel sources, configure, build, install, device drivers (statically linked, loaded at runtime), init, licensing, EXPORT SYMBOL GPL, out of
  • tree makefile, module-init-tools, module in kernel tree, Kconfig, parameter passing, sparse

Char Drivers (8 topics)

  • Architecture, user/kernel interface, I/O subsystem, VFS, sysfs (devices, bus, drivers, classes), kobject, ktype, kset, linux kernel driver model, device files
  • Char driver
  • Initialization
  • Registration
  • Open, release
  • cdev, cdev add, cdev del,...
  • Major/minor numbers
  • udev, udevmonitor, udevadm

Advanced Charachter Driver Operations (2 topics)

  • ioctl, unlocked ioctl, compat ioctl,
  • user space API, kernel space API, process lifecycle, sleeping/blocking, sleeping/waking up, wait queue. thundering herd, poll/select

Kernel Debugging (10 topics)

  • Bug, debugging, debugging the kernel
  • Binary search with git
  • Debug support from kernel
  • printk syslogd, klogd, loglevels, rate
  • limit, debug levels, debug selective subsystems
  • Debugging by querying debugfs
  • oops debugging, asserting oops
  • Magic SysRq Key
  • kgdb/kdb
  • JTAG

Tracing (5 topics)

  • gcov
  • lcov
  • oprofile
  • ftrace (nop tracer, function tracer, sched switch tracer (viewer), function graph tracer, dynamic tracer)
  • LTTng

Interrupts (1 topic)

  • Interrupts vs. polling, interrupt, program sections, reentrancy, events, interrupt handler, shared interrupt handler, interrupt flow, interrupt control

Deferring Work (1 topic)

  • Top/bottom halves, softirqs, tasklets, work queues

Concurrency (12 topics)

  • Critical region/section, atomic, race condition, synchronization, locking, locking solutions, deadlock, contention, what to lock?
  • Atomic operations
  • Spin locks
  • Reader-writer spin locks
  • Semaphore
  • Binary semaphore
  • Mutex
  • Reader-writer semaphore
  • Completion variables
  • Sequential locks
  • Disable preemption
  • Orderig and barriers

Time (1 topic)

  • HZ, Jiffies, big/small delays, kernel timers

Hardware I/O (1 topic)

  • I/O Ports, I/O Memory, How to deal with side effects accessing registers?

User-Kernel Communication (1 topic)

  • put(get) user(), copy to(from) user(), Kernel I/O, memory mapping, procfs, sysfs, debugfs, relayfs, netlink, ioctl

Portability (1 topic)

  • Word size, opaque types, signed/unsigned char, data alignment, integral promotion, code reuse, endianess, system tick, page size, instruction ordering, SMP/preemption/high memory

Prerequisites



  • Basic familiarity with using a GNU/Linux system as an end user.
  • Basic familiarity with a command line shell.
  • 
  • Basic knowledge of user space / application development.
  • 
  • Intermediate C programming knowledge.
  • 
  • Should have attended Embedded GNU/Linux Systems Architecture before(strongly recommended!).

Additional Learning

The courses below may help you meet the knowledge level required to take this course. If you are unsure please ask a training advisor .

  • Embedded Linux System Architecture

    This 5-day course uses hands-on exercises combined with instruction to illustrate the concepts of embedded GNU/Linux.

    5 Day Course Course Code PSD160
    Scheduled Online Onsite

Relevant Certifications

or call:408-759-5074

Course PDF

Print

Share this Course

+1
Share

Recommend this Course

Sections