Design - Develop - Deploy

Embedded Linux and Device Driver Programming

Summary

The course introduces the developer to the ARM architecture, device driver programming for the Linux kernel and building an embedded Linux system.

An overview of microprocessors, the ARM programmer's model, ARM instruction set is covered under ARM architecture. Character device drivers, PCI device drivers, blocking and non-blocking I/O and locking techniques is covered under Linux device driver programming. Using an embedded Linux system, and building the Linux kernel, filesystem, bootloader is covered under embedded Linux.

Pre-requisite

  • C programming

  • Microprocessors

  • Using GNU/Linux

  • GNU/Linux System Programming

Duration

  • Duration: 72 hours

  • Span: 6 weeks

Syllabus

ARM Architecture

ARM Processor Fundamentals

  • Registers

  • Pipeline

  • Exceptions, Interrupts, and the Vector Table

  • Cache

  • MMU

  • Core Extensions

  • ARM Processor Families

  • ARM based Embedded System Hardware

Programmer's Model

  • ARM architecture

  • Data sizes and Instruction set

  • Register set

  • Register organization

  • Processor modes and exceptions

  • The endian issue

  • Development of the ARM Architecture

  • Architecture extensions

Instruction Set

  • Overview of the features of the ARM instruction set

  • Conditional execution and flags

  • Condition codes

  • Branch instructions

  • Data processing instructions

  • Using Barrel shifter

  • Immediate constants

  • The coprocessor mechanism

  • Single register data transfer

  • Address accessed

  • Pre or Post Indexed Addressing

  • Software Interrupt

  • Transfer Instructions

  • Branches and subroutines

  • Overview of Thumb and the benefits

System Design

  • Overview of AMBA

  • Device Interfacing

  • Device Access

Development

  • Open source tools

  • Asssembly examples

  • Coding and debugging

  • Flashing and running

Linux Device Drivers

Introduction to Devices

  • Device Interfacing

  • Parallel Port LED Userspace Access

  • Parallel Port LCD Userspace Access

Introduction to Drivers

  • Unix/Linux Device Abstraction

  • Device Files

  • Types of Drivers

  • Mouse Device Access

  • Sound Mixer Device

  • RTC Access through /proc

  • Print Partition Table

Using Qemu and Using Kernel Modules

  • Qemu Usage

  • Disk Images

  • Host System Access

  • Device Simulation

  • Kernel Modules

  • Kernel Version Numbering

Writing Kernel Modules

  • Module Programming vs Application Programming

  • Hello World Module

    • Module Programming Basics

    • Compiling

    • Loading and Unloading

    • Module Parameters

Char Drivers

  • Major and Minor Numbers

  • Data Structures

    • File Operations Structure

    • File Structure

  • Registering Char Driver

  • Parallel Port LCD Driver

Device Model and Device Access

  • Linux Device Model

  • Bus Model

  • Writing PCI Drivers

Debugging Techniques

  • Debugging by Printing

    • Kernel Log Mechanism

    • Turning on/off Debug Messages

    • Rate Limiting

  • Debugging by Querying

    • debugfs

  • Debugging by Watching

    • strace

  • Debugging System Faults

    • Decoding Oops

    • Recovering from a System Hang

Interrupts and Concurrency

  • Interrupts

  • Installing Interrupt Handlers

  • Sources of Concurrency

  • Semaphores

  • Spinlocks

  • Common Locking Problems

  • Atomic Variables

Advanced Character I/O

  • Char driver to transmit and receive serial data

  • Blocking I/O

  • Implementing poll

  • Implementing ioctl

Embedded Linux

Components of GNU/Linux System

  • Boot Loader

  • Console

  • Storage Media

  • Filesystems

  • Root Filesystem + Shell + Utilities

  • Compiler

  • C Library

  • Debuggers

Hello Embedded World!

  • Accessing the target

    • Console on Serial Port

    • Minicom Usage

  • Cross compiling hello world program

    • About cross compilers

    • GNU Tool Chain

    • Using cross compilers

  • Downloading program to target

    • TFTP commands

Building Applications

  • Building third party applications

    • configure

    • build, host, target

    • cross compilation

Building Filesystem Image

  • Storage Types

  • MTD devices

  • Filesystems

  • Creating filesystem image from filesystem contents

  • Flashing root filesystem

Building Shell and Utilites

  • Busybox Introduction

  • Configuring Busybox

  • Rebuilding the root file system

Building Libraries

  • C Libraries

  • Building C Library

  • Using the C Library

  • Rebuilding the root file system

Building a Root Filesystem

  • Contents of root filesystem

  • Building root filesystem

  • Space optimization

Building the Kernel

  • Kernel configuration

  • Building the kernel

  • Booting from the new kernel

  • Kernel Boot Args

Kernel Variants

  • uClinux

  • RTAI

Target Flashing and Debugging

  • gdbserver

  • JTAG

Building the Boot Loader

  • U-Boot Introduction

  • Role of a Boot Loader

  • Commands

  • Building U-Boot

Building the Cross Compiler

  • Components of the tool chain

  • Building a cross toolchain