EIEIOTECHNOVATION
← Training programmes

EIEIO / OPERATING SYSTEMS

Embedded Linux Device Development Workshop

Course outline

5 days

Pre-Requisites

Basic C programming

Familiar with Linux OS, but not essential.

Overview

This course aims to reduce development time by demonstrating how the range of helper functions and mechanisms provided by the kernel can make custom device driver creation easier.

Course Objectives

An understanding of the capabilities of the embedded Linux kernel and the techniques to work within it effectively

The facilities and frameworks of the kernel and how they can be used to speed up driver development

How to utilise the common patterns and data structures for different types of device driver.

Course Outline

Linux Kernel Internals

Introduction to Kernel

History of Linux

Types of Kernel

The Linux kernel

Kernel Facilities

Kernel Architecture

Kernel Version Numbers

Configure, Compile Kernel

The File System

Virtual File system & its role

Course Outline :: Embedded Linux & Device Development Workshop ::

Files associated with a process

Process management

Process Defined

Process Descriptor Structures in the kernel

Process States

Process Scheduling

Process Creation

System calls related to process management

Memory Management malloc, calloc, alloca, free

Demand Paging defined

Course Outline :: Embedded Linux & Device Development Workshop ::

Process Organization in Memory

Virtual Memory Management

Buddy System Algorithm

Slab Allocator

Swapping Memory Areas

Memory Mapping

Block Device Caching

Interrupts - Conceptual Understanding

About Interrupts

Interrupt Handlers

Softirqs

Tasklets

Work Queues

Device Drivers – Conceptual understanding

Character Device Drivers

Block Device Driers

Network Device Drivers

Kernel Configuration and Compilation

Kernel Building System

Patching the Kernel

Kernel Configuration

Compiling the Linux Kernel

Kernel Parameters

Build-Time Parameters

Boot-Time Parameters

Run-Time Parameters

Boot Process - understanding Power ON to login prompt process

BIOS Level

Boot Loader

Setup, startup_32 functions

Available Bootloaders – GRUB, UBoot, etc.

Role of a Bootloader

Bootloader Phase

Course Outline :: Embedded Linux & Device Development Workshop ::

Kernel Initialisation Phase

The start_kernel() function

System Initialisation Phase

Understanding Runlevels

Various initialization scripts & customizing them

Kernel Command-Line Boot Parameters

Linux Advanced Programming

Arguments, the environment, and popular system functions

Arguments to a program.

Retrieving information from the environment.

Discovering the date and time

Getting system information.

Argument

File I/O

Library functions and system calls forI/O

Getting file status information with stat()

Processing directories and directory entries.

Shell Commands & Shell Scripting

Basic Shell commands

Bash Shell Essentials

Creating Makefiles

Makefile basics

Creating make files for single or multiple source files project

Creating Lilbraries

Creating Static Library

Creating Shared Library

Multi Process Programming

Creating child processes fork(). vfork(), exec()

Parent synchronization with child

Multi Thread Programming

Creating multiple threads

Parent synchronization with other Threads

Course Outline :: Embedded Linux & Device Development Workshop ::

Inter Process Communication

Pipes, FIFO's,

Signals

System-V IPC's

Message queues

Shared memory

Semaphores

Introduction to Sockets

An Overview

System calls related to TCP and UDP sockets

Using Wireshark etc tool for network sniffing

Network Programming

TCP Server Client Programming

UDP Server Client Programming

Lab exercises

Programming & Debugging Tools

Debugging and Analysis Tools strace : Tracing System calls ltrace : Tracing Library calls

Using gdb and ddd utilities

Core Dump Analysis etc

Embedded Linux System Development

Platforms – RaspberryPi, Beaglebone Black, Friendly ARM

Introduction to Embedded Linux

What is Embedded System?

Anatomy of an Embedded System

Why Linux?

Is Linux Real-Time Enough?

The Status of Embedded Linux Today

Which Embedded Linux Distribution to Choose?

Embedded Linux Architecture

Basic requirements for Embedded Linux Product Development

The four basic elements: toolchain, bootloader, kernel, root file system

Course Outline :: Embedded Linux & Device Development Workshop ::

Configuration, compilation and cross-compiling

Building Development Environment

Toolchain installation

Cross compilation using Toolchain

Target & Host Setup

Setting Up Networking Services

Network Settings

Static and Dynamic IP addresses

Subnet mask

Bootloader commands and usage

Getting familiar with bootloader commands

Downloading kernel images and RootFS on Target board.

Loading RootFS in Platform by various techniques -

Configuring TFTP and downloading kernel image over TFTP.

Configuring NFS and using rootfs over NFS.

Using SD-Card for rootfs.

Using USB for rootfs.

Building an Embedded File System from Scratch -

Creating a minimal root file-system using Busybox

Creating a RAM disk image

Intro to Building Own Embedded Linux Distribution -

Yocto

Buildroot

Scratchbox

OpenEmbedded

Crosstool

Angstrom – Narcissus

Booting Linux

The Linux boot sequence boot-loaders : U-boot

System Initialization Scripts

Course Outline :: Embedded Linux & Device Development Workshop ::

Linux Device Driver Programming

An introduction to device drivers

User space vs Kernel space

Kernel Architecture or Model

Splitting the kernel

Kernel modules

Kernel Module vs Applications

Role of the Device Drivers

Classes of devices and modules

Kernel Module Programming Basics

Modules Defined

Data Type in the Kernel

Version dependency

Building and Running Modules

Types of Modules in the kernel

Writing Your first kernel module

Module Related Commands

Statically linked vs Dynamically linked drivers/modules

The kernel symbol table

Exporting symbols from modules

Module Parameters

Lab exercises for above mentioned topics

Kernel Debugging Techniques

Kernel Debugging: dmesg, printk

Lab exercises for above mentioned topics

Accessing Hardware Mechanisms

System Memory

Device Memory

I/O Ports

I/O ports vs. memory mapping

Allocating and mapping I/O space

Functions for reading and writing I/O ports

Side effects and compiler optimization

Accessing hardware from User Space

Course Outline :: Embedded Linux & Device Development Workshop ::

Example: the Parallel Port

Driver example

Barriers

User-Mode Access to Devices open, close, read, write ioctl ioperm, iopl, inb, outb mmap, munmap

The proc file system programming

Using /proc

Creating proc file system entries

Programme scope, delivery arrangements and suitability are confirmed during enquiry.