Course Description:
Linux is now being designed into everything from super
computers down to mobile phones. Fortunately, to deploy
Linux in your design very few applications require the
knowledge to re-program the actual Linux kernel.
However, most applications do require some
customisation for the specific hardware devices in their
design. This course caters for the many engineers
needing only the skills to design and test a Linux device
driver.
Course Objectives:
• To provide an overview of the Linux kernel internal
mechanisms available to a driver developer
• To become a proficient Linux driver developer for
character, block and network devices
• To recognise resource eating inefficient drivers, and
tailor to minimise RT latency.
Delegates will learn:
• The kernel module development cycle: edit, compile,
load, test and unload kernel module drivers
• To write, compile and link simple application
programs to test drivers
• To build a kernel with a new built-in driver
• To obtain a high-level appreciation of the relationship
between GNU, Open Source, GPL, and LGPL.
Pre-Requisites:
• Good C
• Knowledge of embedded micros, interrupts etc.
• Some Linux or any form of Unix familiarity would be
helpful
This course would be an excellent compliment to the
Feabhas EL-503: Developing for Embedded Linux.
This is not mandatory though.
Who Should Attend:
Engineers interested in interfacing to custom hardware on
a Linux platform. Linux application programmers
interested in accessing Linux at a lower level.
Duration:
Five days.
Course Material:
• A delegate handbook containing all the theory
presentation slides and laboratory exercises
• CD containing all kernels and utilities for the
laboratory exercises.
Related courses:
EL-503: Developing for Embedded Linux.
Laboratory Exercises:
• Drivers are written or customized to explore all
theoretical material using a PowerPC embedded
target running Linux
• For driver debugging, exercises include using
conventional printk and oops methods, as well as
advanced sessions using the GNU debugger, gdb.
The workshops are completed by adding a driver
“permanently” to a kernel image. |
Course Outline
The GNU/Linux kernel
- A high level overview of the kernel and
terminology including: virtual memory;
user/kernel space; processes; threads
- How to set up a cross-development
environment
- How to configure, cross-compile and
boot Linux on the PPC target
- Real-time behaviour and its impact on
device driver implementation
The kernel programming environment
- Modules: Adding driver modules to the
kernel, module utilities, symbols,
parameters, revisions and compatibility
- /proc: Talking directly to the kernel
- Debugging tools including: gdb, kgdb,
strace, printk, ksyms, lsmod and
logging daemons
The device driver interface
- Device nodes, major-minor numbers,
dynamically allocated driver numbers
- Registering character drivers, device
operations: open, release, read and
write
- Transferring data between user and
kernel space
- Blocking on wait queues, re-entrancy
issues
- synchronisation using semaphores and
spinlocks
Kernel mechanisms for the driver
- Kernel memory allocation, virtualphysical, paging, mapping, I/O Ports
- Interrupts: Registering and Handling,
Sharing, Disabling, SMP, Bottom half,
tasklets, workqueus
- Timing: sources of time, short/long
delays, current time, jiffies, kernel
timers, sleeping
- Poll/select; asynchronous notification
- ioctl
Advanced Kernel Issues
- Block and network drivers
- Peripheral Buses: PCI |