Training Categories
Click on a link to see more about each course.
Course Outline
Dates Offered (click on the desired date to register):
This course is currently not scheduled for the near future.
Embedded Linux, kernel and Device Drivers
Course Number: LIN1
Course Description:
Embedded systems exist in everything from our planes, trains, wireless devices, automobiles and televisions, to our microwaves-they are small, low powered and adaptable to a wide variety of environments. This course is designed for embedded system developers that need an understanding of the basics as well as the advanced concepts and topics involved in the creation, implementation and usage of a custom version of Linux for an embedded system and real time systems. Topics such as internal structure of Linux kernel and device drivers, kernel compilation, cross compilation, real world interfacing, alternatives for file systems, booting, Linux and Real time, RTAI, RTLinux, network integration, and kernel debugging are covered. Additional topics covered are hardware designs for Linux platforms using serial, parallel, USB, I/O port and I2C interfaces. This course will also explore why Linux is a great choice for an embedded application and what to look for when choosing hardware.
Objectives:
After completing this course, participants will be able to: ·Describe and customize the Linux boot sequence ·Build a customized, reduced sized Linux kernel ·Build a complete file system ·Create a bootable Linux floppy complete with a Filesystem ·Compile, link, and insert kernel modules, including NIC drivers. ·Compile, link, and debug programs using gcc, ld and gdb. ·Use real-time solutions such as RTAI ·Describe many tradeoffs for real-time solutions, including kernel vs. user space, high precision timing, guaranteed maximum interrupt latency times, priority inversion avoidance, preemption, and deterministic scheduling ·Use soft real-time solutions that involve low latency patches, improved scheduling, and POSIX API calls ·Explain comparative issues between Embedded QT, and Microwindows ·Boot from a remote device ·Use boot loaders for non-Intel architectures ·Describe and use RTLinux ·Describe FIFO – Kernel and User Space ·Use kernel debuggers such as kdb and kgdb ·Use Flash devices such as DiskOnChip ·Perform safe field upgrades of system software, including the kernel ·Use file systems such as ROMfs, Cramfs, RamDisk, and ReiserFS ·Compare small libraries such as uC-Libc and newlib to Glibc. ·Develop an application that uses system calls directly, without library wrappers ·Write a basic device driver ·Explain basic device driver concepts such as how one communicates with a driver ·Register a character driver and task queues.
Benefits:
Target Audience:
Prerequisites:
·Experience in C and C++ programming ·Equivalent UNIX or Linux workstation user skills for developers ·Shell scripting in a UNIX or Linux environment ·Experience with editors such as vi, emacs
Course Length: 5 days
CourseTopics:
Day 1 – Times are approximate Introduction to Embedded OS, Tools and Methods What does embedded mean? What does real time mean? Embedded development differences Building your own environment with GNUPro tools GNU software tool sets: Cross Compiling, Cross Configuration and Debugging Embedded methods and processes How to build the kernel Steps in configuring a new kernel Getting a new kernel Compiling the kernel Using menuconfig, xconfig Compressing the kernel Cross-compiling Compile, link, and insert kernel modules, including sound and NIC drivers Cross compile Linux applications for x86, and PowerPC Remote debugging gdb configuration Debug monitors - RedBoot, etc Kernel debuggers such as kdb and kgdb Embedded Linux Linux and embedded Linux Real-time solutions such as RTAI Linux kernel source code Build a custom, reduced size Linux kernel Compile, link, and insert kernel modules, including sound and NIC drivers File systems such as ROMfs, Cramfs, RamDIsk, and ReiserFS EDK on MBX PPC SBC Linux code size requirements Linux System requirements Running Linux on CPUs without an MMU Linux initialization procedure The Linux boot sequence Hacking inittab Modifying kernel init Initial disk images Create a bootable Linux floppy complete with a Filesystem boot loaders for non-Intel architectures Day 2 – Times are approximate Kernel and System Programming Introduction to the Linux Kernel The Kernel Classes of devices and modules Security issues Version Numbering Data Types Use of standard C types Assigning an explicit size to data items Interface-specific types Physical layout of the Kernel source Booting the kernel Before booting The init process The kernel directory The mm directory The fs directory Networking IPC and lib functions Drivers Architecture dependencies The task structure The process table Files and inodes Dynamic memory management Queues and semaphores System time and timers Main algorithms Signals Interrupts Booting the system Timer interrupts The scheduler Implementing system calls How does system calls actually work? Example of simple system calls Memory Management The architecture independent memory model Pages of memory Virtual address space Converting the linear address The page directory The page middle directory The page table The virtual address space for a process The user segment Virtual memory areas The system call brk Mapping functions The kernel segment Static memory allocation in the kernel segment Dynamic memory allocation in the kernel segment Block device caching Block buffering The update and bdflush processes List structures for the buffer cache Using the buffer cache Paging under Linux Page cache and management Finding a free page Page errors and reloading a page System Calls System Call Basics System Call Mechanism System Call Table Entry.S Direct System Calls Using System Call Macros Expansion of Macros System Call Documentation Tracing System Calls strace Day 3 – Times are approximate Process Related System Calls Fork exec clone Inteprocess Communication Semaphores Share memory Message queues Mmap Scheduling Memory Locking Signals Time POSIX Interface Threads Using Pthreads Synchronization Mutexes Condition Variables Synchronization Example Priority Inheritance Signals Virtual Memory and Real Memory File Systems Board Support Issues Drivers and loadable kernel modules Kernel modules and device I/O Basic device driver concepts such as how one communicates with a driver, how to register a character driver, and task queues. Writing a basic device driver Kernel module API Interrupts Board support Flash devices such as DiskOnChip Building and Running Modules Modules versus applications Compiling and loading The kernel symbol table Initialization and shutdown Using resources Automatic and manual configuration Working in the user space Char Drivers Design framework File operations The file structure Open and close Memory usage Read and write Installing and playing with the new drivers Enhance Char Drivers Operations ioctl Blocking I/O Select Asynchronous Notification Seeking a device Access control on a device file Day 4 – Times are approximate Inter-process communication Synchronization in the kernel Communication via files Locking entire files Locking file areas Pipes Debugging using ptrace System V IPC Access permissions, numbers and keys Semaphores Message queues Message queues Shared memory The ipcs and ipcrm commands IPC with sockets A simple example How loadable Modules Work Device Drivers Static vs Dynamic Drivers Loading Modules Working with loadable modules Example Stacked Loadable Modules Module Parameters Modinfo Module Configuration Linux and Real-Time A Real-Time time line Issues to consider User vs. Kernel space Open Source QoS Latencies Interrupt latencies Scheduling Transition Latencies Sensitive applications O(1) vs. O(n) Schedulers Measuring Latencies Latency Test Tool 8 Real-Time RTLinux Overview RTLinux Review Supported Kernel Version RTLinux License and Patent issues Methods to Obtain RTLinux Kernel Install RT Source RTLinux Kernel Changes Configure RTLinux Kernel Building RTLinux Programming with RTLinux Loading modules Cooperating Process model Shared Memory Day 5– Times are approximate RTLinux mbuff driver FIFO – Kernel and User Space Interrupt Handlers Sleeping threads Waking up on FIFO