Learn to develop Linux drivers using DMA, interrupts, kernel threads, and synchronization.
Skills you will gain
- Demonstrate how to avoid common mistakes and pitfalls when writing kernel code.
- Apply Linux device driver APIs to Linux kernel subsystems.
- Explain how to use kernel services for interrupt handling, DMA, memory mapping, and debugging.
- Describe Linux device drivers and practical driver examples that can be readily applied in the work environment.
Course Description
Advanced knowledge of Linux kernel data structure and the ability to use its framework for writing device drivers is critical for Linux programmers.
In this course, students learn to differentiate between the kernel development environment and writing user space programs. They study Linux kernel subsystems, such as Linux scheduler, memory management, networking stack, and Linux block layer, all of which helps them build high-performing kernel drivers.
We will develop kernel modules that use kernel facilities and services to perform actions, such as interrupt handling, direct memory access (DMA), bus-independent device access, invoking kernel threads, and mapping device memory into the user space.
By introducing students to the proper use of available Linux synchronization primitives such as mutex, rwlock, semaphores, and read copy-update (RCU), students will learn to handle concurrency issues in the driver code.
Topics
- Implementing device driver file operation methods: read(), write(), poll(), and mmap().
- Scheduling driver tasks via timer API and delegates background work to kernel threads via work queues.
- Exploring Linux device models and building user interfaces to driver functions via procfs and sysfs pseudo file system.
- Building kernel modules via kprobe for debugging and profiling (eBPF) production drivers.
- Developing a fully functional network driver for an emulated Realtek RTL8139 PCI ethernet card, as part of a final project.
- Flexible Attend in person or via Zoom at scheduled times.
This class meets simultaneously in a classroom and remotely via Zoom. Students are expected to attend and participate in the course, either in-person or remotely, during the days and times that are specified on the course schedule. Students attending remotely are also strongly encouraged to have their cameras on to get the most out of the remote learning experience. Students attending the class in-person are expected to bring a laptop to each class meeting.
To see all meeting dates, click "Full Schedule" below.
You will be granted access in Canvas to your course site and course materials approximately 24 hours prior to the published start date of the course.
Recommended Texts:
Linux Device Drivers, 3rd Edition, Jonathan Corbet, et al., O'Reilly Media, 2005, ISBN-10: 0596005903, ISBN-13: 978-0596005900. Available Online: http://lwn.net/Kernel/LDD3/
Writing Linux Device Drivers: A Guide with Exercises, Jerry Cooperstein, CreateSpace Independent Publishing Platform, 2009, ISBN-10: 1448672384, ISBN-13: 978-1448672387.
Essential Linux Device Drivers, Sreekrishnan Venkateswaran, Prentice Hall, 2008, ISBN-10: 0132396556, ISBN-13: 978-0132396554.
