Sie sind auf Seite 1von 3

LINUX DEVICE DRIVER DEVELOPMENT

Course Duration: 5 Days

Course Overview: This course teaches attendees to develop device drivers for a wide
range of device types for Linux. This course acquaints developers with the issues
essential for Linux device driver development. The course progresses through a number
of topics. Each topic is presented along with a supporting laboratory exercise before
moving on to the next topic.

This five day course provides substantial practice with the key steps in developing Linux
device drivers. The course shows attendees how device drivers work with the Linux
kernel, how to compile and load drivers, how to debug drivers, how to access PCI/ISA
hardware, as well as other essential topics. Attendees will develop a complete, simple,
driver that demonstrates the process of creating a Linux device driver. The course
covers the key issues in Linux device drivers. Such questions as: how do I develop a
character device, how do I debug a driver, how do I use task queues are examined.

Attendees will spend approximately 50 percent of the class time actually gaining hands-
on experience with these topics.

LEARNING OBJECTIVES

· To provide an understanding of the essentials of Linux device drivers.


· To give you practical experience in developing Linux device drivers.
· To explain the characteristics of the Linux kernel important to device driver writers.

After completing this course attendees will have learned:

· The steps necessary to add devices to a Linux system


· How to determine what hardware is present on a Linux system
· The purpose and functionality of device drivers
· Compiling and linking device drivers
· Basic networking tasks
· The use of a variety of performance tools
· Trade-offs between loadable modules and drivers compiled into the kernel.

Who Should Attend: The course is designed for software engineers who are new to
Linux and/or device drivers. Attendees should have experience with C, be able to
perform basic Unix commands, and have some experience with the basic Gnu tools of
gcc, gdb, and make. The Linux Development Fundamentals course is a good
introduction to this course.
COURSE OUTLINE
IOCTLs
How To Configure And Install The · What is ioctl
Kernel · Using ioctl commands to interact
· Obtain and install the kernel source with a device
code · Implementing IOCTL in drivers
· Configure and build a new kernel
Blocking and Wait Queues
· Install the new kernel
· Multi-tasking
How Loadable Modules Work · Schedule()
· Benefits of loadable modules · Wait Queues
· Loadable device drivers · Save sleeping
· Correct use of insmod, modprobe, · Poll()
rmmod, and lsmod
Memory management
· Passing parameters to a loadable
module · Memory allocation with kmalloc and
kfree
· The GPL and Linux
· Page-oriented memory allocation
Module Mechanics and Code · Memory allocation in the virtual
Portability address space
· Identifying important header files · The mmap() method.
· Writing a simple module
I/O ports and interrupts
· Compiling modules
· Uses of I/O ports and IRQs
· Loading/unloading modules
· Platform dependency issues
· Exporting symbols from a loadable
module · Functions used for reading and
writing I/O ports
· Creating stacked loadable modules
· Interrupt Handler functions
· Integer types for portability
· Restrictions of kernel code running
· Tips on portability
in an interrupt context
Tracing and Debugging
Time Management And Task Queues
· printk for debugging
· Timer interrupts
· Device information in /proc
· Delay execution techniques
· strace to track system calls
· Task queues
· ksyms and ksymoops
· Task queue operations
· Debuggers, e.g., gdb, and kgdb
· Obtaining the current time
Character Devices
Synchronization
· Classes of device files
· Race conditions
· Major and minor numbers
· Atomic access
· Creating device files with mknod
· Dead lock
· Registering character device file
· Spinlocks
· Listing character device driver
· The Kernel Lock
methods
· Disabling interrupts
Data: User To/From Kernel
· Important functions for accessing
user space
· Shared Memory
· Kiobufs
Accessing PCI/ISA hardware Case Study: Serial Port Driver
· Code to detect PCI devices in the · Register character driver
system · Create basic ramdisk character
· Resource conflicts driver
· Vendor/device IDs · Allocate/deallocate ram
· I/O mapping · Implement read/write
· DMA · Implement IOCTL in driver
Network Drivers · Change baud rate
· The net_device structure · Change various driver settings
· Naming scheme · Transfer data to and from user
space
· Network driver methods
· Create /proc file which lists the
· Various network and block driver
current driver settings
methods
· Detect Serial port
Block Device Drivers · Initialize serial port by programming
· Block device drivers I/O ports
· Header files · Send data through serial port
· Registering block drivers · Use task queues and bottom halves
· The block_device_operations to allow buffered transfers
structure · Receive data through serial port
· Special methods · Use task queues for polled reading
· Use Interrupts for interrupt enabled
reading
· Debug the new driver

Das könnte Ihnen auch gefallen