Programming Embedded Linux
Tuxology team May 15th, 2008
Overview
This course provides embedded systems developers, making their first steps with Linux as an embedded system platform, with the skills required for being a productive programmer in that environment.
The curriculum includes building applications and device drivers with real time constraints, understanding the inner working of the Linux system and its effects the system behavior. Participants should have solid knowledge in C, and background in embedded systems or low level programming.
The course is suitable for people planning to develop for embedded Linux platforms from any source, including “home made” Linux distributions or embedded Linux system vendors such as WindRiverTM, MontaVistaTM or TimeSysTM. The course is taught using a real live embedded Linux system,
running inside a hardware emulator as the target, and the GNU tool set/Eclipse IDE on the host.
The course is parallel to the “Linux Kernel Internals” course with a twist towards the embedded systems and real time domains and is preferred for people with embedded systems background and requirements.
Skills
On completion, delegates will be able to create applications and device drivers for Embedded Linux environments, or to import such applications from systems using legacy RTOSes.
Audience
- Seasoned embedded systems developers (using VxWorks, pSos, Vertex, Nucleos or home grown systems) wishing to become competent Linux Embedded systems developers.
- Seasoned Linux developers wishing to become competent Linux Embedded systems developers.
Prerequisites
- Experience Programming in C.
- Experience in embedded systems or low level programming in any environment.
Content
Introduction
- What is Linux
- Layers in a Linux system
- Linux vs. Legacy RTOS
Basic concepts
- Files and file system
- The shell
- Processes
- Setting up networking
Application programming and the user space API
- Makefiles and the build environment
- Processes and threads
- IPC (mutex, condition variables, mailboxes, pipes, shared memory, Unix domain sockets and signals)
- Timers
- Memory mapping and locking
- Real time priorities
- Debugging applications: in process and using remote debugger
Linux Internals and device drivers
- Linux kernel source layout
- Kernel Coding conventions
- Kernel log
- Supervisor mode and the system call interface
- Linux boot sequence
- Kernel modules
- Proc file driver
- Memory management
- Character device driver
- Scheduling
- Interrupts
- Top and bottom halfs: softirqs, tasklets, timers and work queues
- Blocking and waiting for events
- Locks and atomic operations
- Networking stack and network device drivers
Practice
During the course participants will develop a Linux device driver for an embedded
Linux target running in a hardware emulator using the GNU tool chain and the
Eclipse IDE.
Resources
Course slides
Code Examples
User space code example (threads, signals and semaphores)
Usage Rights
The course materials were created by the following authors:
- Original course slides © Michael Opdenacker from Free Electrons
- Networking slides © Oron Peled
- Additional slides and material by Gilad Ben-Yossef, © Codefidence ltd.
- Additional slides and material by Yariv Shivek, © Codefidence ltd.
- Portions of the course slides are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology — Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .
- Portions © Xavier Leroy <Xavier.Leroy@inria.fr>
- Tux Image Copyright: © 1996 Larry Ewing
- Linux is a registered trademark of Linus Torvalds.
- All other trademarks are property of their respective owners.
Used and distributed under a Creative Commons Attribution-ShareAlike 2.0 license.