Embedded Linux kernel and driver development training 5-day session

Similar documents
Yocto Project and OpenEmbedded training 3-day session

Android System Development Training 4-day session

Embedded Linux system development training 5-day session

LINUX DEVICE DRIVERS Weekend Workshop

Kernel Internals. Course Duration: 5 days. Pre-Requisites : Course Objective: Course Outline

- Knowledge of basic computer architecture and organization, ECE 445

EMBEDDED LINUX ON ARM9 Weekend Workshop

DSX - Digital Systems Using Embedded Linux

Table of Contents. Preface... xi

Linux Driver and Embedded Developer

December 1, 2015 Jason Kridner

Beaglebone green User Manual

Software Development & Education Center

OPT3001EVM Linux Getting Started Guide. Felipe Balbi

ARM support in the Linux kernel

Software Development & Education Center

Porting Linux to a new SoC

Passing Time with a SPI Framebuffer Driver

Short Term Courses (Including Project Work)

Linux Kernel Architecture

Embedded Linux Conference San Diego 2016

November 3, 2015 Jason Kridner

Here to take you beyond. ECEP Course syllabus. Emertxe Information Technologies ECEP course syllabus

Introduction p. 1 Why Linux? p. 2 Embedded Linux Today p. 3 Open Source and the GPL p. 3 Free Versus Freedom p. 4 Standards and Relevant Bodies p.

FreeRTOS X. Task Notifications Semaphores Family Critical Section FreeRTOS Producer Consumer Tasks

Lecture notes Lectures 1 through 5 (up through lecture 5 slide 63) Book Chapters 1-4

Getting Started with FreeRTOS BSP for i.mx 7Dual

Timers 1 / 46. Jiffies. Potent and Evil Magic

ARM CORTEX-R52. Target Audience: Engineers and technicians who develop SoCs and systems based on the ARM Cortex-R52 architecture.

Parallella Linux - quickstart guide. Antmicro Ltd

Designing with ALTERA SoC Hardware

FPQ9 - MPC8360E implementation

Hands-on with the Sitara Linux SDK

ECE 550D Fundamentals of Computer Systems and Engineering. Fall 2017

AUTOBEST: A United AUTOSAR-OS And ARINC 653 Kernel. Alexander Züpke, Marc Bommert, Daniel Lohmann

Speeding AM335x Programmable Realtime Unit (PRU) Application Development Through Improved Debug Tools

Universal Windows Driver Development with WDF UMDF 2.0 and KMDF for IoT, Desktop and Server

Embedded System Curriculum

MYD-C437X-PRU Development Board

Kinetis SDK Release Notes for the TWR-K24F120M Tower System Module

The Kernel Abstraction

An introduction of operating system project. Seo Bon Keun

FreeBSD and Beaglebone Black, a robotic application.

ARM Powered SoCs OpenEmbedded: a framework for toolcha. generation and rootfs management

About the Need to Power Instrument the Linux Kernel

So you want to write a Linux driver subsystem? Michael Turquette

Bootstrap, Memory Management and Troubleshooting. LS 12, TU Dortmund

Designing with NXP i.mx8m SoC

Kernel Module Programming

EMBEDDED TRAINING IN BANGALORE

MYC-C437X CPU Module

Introduction to Linux kernel driver programming + i2c drivers

ELC4438: Embedded System Design ARM Cortex-M Architecture II

Overview. This Lecture. Interrupts and exceptions Source: ULK ch 4, ELDD ch1, ch2 & ch4. COSC440 Lecture 3: Interrupts 1

Noorul Islam College Of Engineering, Kumaracoil MCA Degree Model Examination (October 2007) 5 th Semester MC1642 UNIX Internals 2 mark Questions

The Actor Model applied to the Raspberry Pi and the Embedded Domain. Omer

Multi-core microcontroller design with Cortex-M processors and CoreSight SoC

«Real Time Embedded systems» Multi Masters Systems

Attack Your SoC Power Challenges with Virtual Prototyping

Embedded Operating Systems. Unit I and Unit II

Keil uvision development story (Adapted from (Valvano, 2014a))

Getting Started using Linux on a New Embedded System

ARMv8-A Software Development

ARM support in the Linux kernel

The Serial Device Bus

Developing Real-Time Applications

Contents. 1 Introduction Features Product Specifications Hardware Specification Software Specification...

Software Design Challenges for heterogenic SOC's

I/O Handling. ECE 650 Systems Programming & Engineering Duke University, Spring Based on Operating Systems Concepts, Silberschatz Chapter 13

Experiment 1. Development Platform. Ahmad Khayyat, Hazem Selmi, Saleh AlSaleh

Evaluation of Real-time Performance in Embedded Linux. Hiraku Toyooka, Hitachi. LinuxCon Europe Hitachi, Ltd All rights reserved.

Cortex-M3/M4 Software Development

Community Enterprise Operating System (CentOS 7) Courses

Extending Fixed Subsystems at the TLM Level: Experiences from the FPGA World

Notes to Instructors Concerning the BLITZ Projects

Lab 1. OMAP5912 Starter Kit (OSK5912)

Software Driven Verification at SoC Level. Perspec System Verifier Overview

Module MI037 Peripherals

VORAGO VA108x0 GCC IDE application note

FPQ6 - MPC8313E implementation

Bringing display and 3D to the C.H.I.P computer

CS 134. Operating Systems. April 8, 2013 Lecture 20. Input/Output. Instructor: Neil Rhodes. Monday, April 7, 14

S2C K7 Prodigy Logic Module Series

Spring 2017 :: CSE 506. Device Programming. Nima Honarmand

WS_CCESSH5-OUT-v1.01.doc Page 1 of 7

L2 - C language for Embedded MCUs

Lesson 6 Intel Galileo and Edison Prototype Development Platforms. Chapter-8 L06: "Internet of Things ", Raj Kamal, Publs.: McGraw-Hill Education

embos Real Time Operating System CPU & Compiler specifics for Texas Instruments MSP430 CPUs and Rowley compiler for MSP430 Document Rev.

Homework 9: Software Design Considerations

pcduino V3B XC4350 User Manual

Microcontroller basics

F28HS Hardware-Software Interface: Systems Programming

AT-501 Cortex-A5 System On Module Product Brief

Input/Output Systems

Supporting a new ARM platform: the Allwinner example

Real Time Linux patches: history and usage

MicroEmbedded Technologies, Pune. A user manual for Using the BeagleBone Black with Linux Host.

CSE 4/521 Introduction to Operating Systems

Contents. Foreword...xxi Preface...xxiii Acknowledgments...xxix About the Author...xxx

CS330: Operating System and Lab. (Spring 2006) I/O Systems

Transcription:

Embedded Linux kernel and driver development training 5-day session Title Embedded Linux kernel and driver development training Overview Understanding the Linux kernel Developing Linux device drivers Linux kernel debugging Porting the Linux kernel to a new board Working with the kernel development community Practical labs with the ARM-based Beagle Bone Black board. Materials Check that the course contents correspond to your needs: https://bootlin.com/doc/training/linux-kernel. Duration Five days - 40 hours (8 hours per day). 50% of lectures, 50% of practical labs. Trainer One of the engineers listed on https://bootlin.com/training/trainers/ Language Oral lectures: English or French. Materials: English. Audience People developing devices using the Linux kernel People supporting embedded Linux system developers. Solid experience in C programming In particular, participants must be familiar with creating and dealing with complex data types and structures, with pointers to such symbols, as well as with function pointers. Prerequisites Knowledge and practice of UNIX or GNU/Linux commands People lacking experience on this topic should get trained by themselves, for example with our freely available on-line slides (https://bootlin.com/blog/ command-line/). Experience in embedded Linux development. Taking our Embedded Linux course (https://bootlin.com/training/ embedded-linux/) first is not an absolute prerequisite, but it will definitely help people lacking embedded Linux development experience. They will understand the development environment and board manipulations better, allowing them to concentrate on kernel code programming.

For on-site sessions only Everything is supplied by Bootlin in public sessions. Required equipment Materials Video projector PC computers with at least 8 GB of RAM, and Ubuntu Linux installed in a free partition of at least 20 GB. Using Linux in a virtual machine is not supported, because of issues connecting to real hardware. We need Ubuntu Desktop 16.04 (Xubuntu and Kubuntu variants are fine). We don t support other distributions, because we can t test all possible package versions. Connection to the Internet (direct or through the company proxy). PC computers with valuable data must be backed up before being used in our sessions. Some people have already made mistakes during our sessions and damaged work data. Print and electronic copies of presentations and labs. Electronic copy of lab files. Hardware The hardware platform used for the practical labs of this training session is the BeagleBone Black board, which features: An ARM AM335x processor from Texas Instruments (Cortex-A8 based), 3D acceleration, etc. 512 MB of RAM 2 GB of on-board emmc storage (4 GB in Rev C) USB host and device HDMI output 2 x 46 pins headers, to access UARTs, SPI buses, I2C buses and more. Labs The practical labs of this training session use the following hardware peripherals to illustrate the development of Linux device drivers: A Wii Nunchuk, which is connected over the I2C bus to the BeagleBone Black board. Its driver will use the Linux input subsystem. An additional UART, which is memory-mapped, and will use the Linux misc subsystem. While our explanations will be focused on specifically the Linux subsystems needed to implement these drivers, they will always be generic enough to convey the general design philosophy of the Linux kernel. The information learnt will therefore apply beyond just I2C, input or memory-mapped devices.

Day 1 - Morning Lecture - Introduction to the Linux kernel Kernel features Understanding the development process. Legal constraints with device drivers. Kernel user interface (/proc and /sys) User space device drivers Lecture - Kernel sources Specifics of Linux kernel development Coding standards Retrieving Linux kernel sources Tour of the Linux kernel sources Kernel source code browsers: cscope, Kscope, Elixir Lab - Kernel sources Making searches in the Linux kernel sources: looking for C definitions, for definitions of kernel configuration parameters, and for other kinds of information. Using the Unix command line and then kernel source code browsers. Day 1 - Afternoon Lecture - Configuring, compiling and booting the Linux kernel Lab - Kernel configuration, cross-compiling and booting on NFS Kernel configuration. Native and cross compilation. Generated Configuring, cross-compiling and booting a files. Booting the kernel. Kernel booting paramelinux kernel with NFS boot support. ters. Mounting a root filesystem on NFS.

Day 2 - Morning Lecture - Linux kernel modules Linux device drivers A simple module Programming constraints Loading, unloading modules Module dependencies Adding sources to the kernel tree Lab - Writing modules Write a kernel module with several capabilities. Access kernel internals from your module. Set up the environment to compile it Day 2 - Afternoon Lecture - Linux device model Understand how the kernel is designed to support device drivers The device model Binding devices and drivers Platform devices, Device Tree Interface in user space: /sys Lab - Linux device model for an I2C driver Implement a driver that registers as an I2C driver Modify the Device Tree to list an I2C device Get the driver called when the I2C device is enumerated at boot time Day 3 - Morning Lecture - Introduction to the I2C API The I2C subsystem of the kernel Details about the API provided to kernel drivers to interact with I2C devices Lecture - Pin muxing Understand the pinctrl framework of the kernel Understand how to configure the muxing of pins

Lab - Communicate with the Nunchuk over I2C Configure the pin muxing for the I2C bus used to communicate with the Nunchuk Extend the I2C driver started in the previous lab to communicate with the Nunchuk via I2C Day 3 - Afternoon Lecture - Kernel frameworks Block vs. character devices Interaction of user space applications with the kernel Details on character devices, file_operations, ioctl(), etc. Exchanging data to/from user space The principle of kernel frameworks Lecture - The input subsystem Principle of the kernel input subsystem API offered to kernel drivers to expose input devices capabilities to user space applications User space API offered by the input subsystem Lab - Expose the Nunchuk functionality to user space Extend the Nunchuk driver to expose the Nunchuk features to user space applications, as a input device. Test the operation of the Nunchuk using sample user space applications

Day 4 - Morning Lecture - Memory management Linux: memory management - Physical and virtual (kernel and user) address spaces. Linux memory management implementation. Allocating with kmalloc(). Allocating by pages. Allocating with vmalloc(). Lecture - I/O memory and ports I/O register and memory range registration. I/O register and memory access. Read / write memory barriers. Lab - Minimal platform driver and access to I/O memory Implement a minimal platform driver Modify the Device Tree to instantiate the new serial port device. Reserve the I/O memory addresses used by the serial port. Read device registers and write data to them, to send characters on the serial port. Day 4 - Afternoon Lecture - The misc kernel subsystem Lab - Output-only serial port driver Extend the driver started in the previous lab What the misc kernel subsystem is useful for by registering it into the misc subsystem API of the misc kernel subsystem, both the Implement serial port output functionality kernel side and user space side through the misc subsystem Test serial output from user space

Lecture - Processes, scheduling, sleeping and Lab - Sleeping and handling interrupts in a deinterrupts vice driver Adding read capability to the character driver Process management in the Linux kernel. developed earlier. The Linux kernel scheduler and how pro Register an interrupt handler. cesses sleep. Waiting for data to be available in the Interrupt handling in device drivers: interread() file operation. rupt handler registration and programming, Waking up the code when data is available scheduling deferred work. from the device. Day 5 - Morning Lecture - Locking Lab - Locking Issues with concurrent access to shared resources Locking primitives: mutexes, semaphores, Observe problems due to concurrent accesses spinlocks. to the device. Atomic operations. Add locking to the driver to fix these issues. Typical locking issues. Using the lock validator to identify the sources of locking problems. Lecture - Driver debugging techniques Debugging with printk Using Debugfs Analyzing a kernel oops Using kgdb, a kernel debugger Using the Magic SysRq commands Debugging through a JTAG probe Lab - Investigating kernel faults Studying a broken driver. Analyzing a kernel fault message and locating the problem in the source code.

Day 5 - Afternoon Lecture - ARM board support and SoC support Understand the organization of the ARM support code Understand how the kernel can be ported to a new hardware board Lecture - Power management Overview of the power management features of the kernel Topics covered: clocks, suspend and resume, dynamic frequency scaling, saving power during idle, runtime power management, regulators, etc. Lecture - The Linux kernel development process Organization of the kernel community The release schedule and process: release candidates, stable releases, long-term support, etc. Legal aspects, licensing. How to submit patches to contribute code to the community.