[lug] Workshop: Writing your first Linux device driver: Thursday, May 7

Paul Walmsley paul at booyaka.com
Sat May 2 11:00:30 MDT 2015

Hi folks

Some here might be interested in this Linux device driver workshop, coming 
up next Thursday at Solid State Depot:


- Paul

Writing Your First Linux Device Driver - Part 1

Thursday, May 7, 2015

7:00 PM
Solid State Depot

1965 33rd Street, UNIT B, Boulder, CO

You've always been fascinated by operating systems and kernels. You've 
downloaded the Linux kernel source, and built your own kernel. Maybe 
you've experimented with tweaking a kernel configuration for your own 

Now you're looking forward to that next step: fixing a bug in a kernel 
device driver, or writing a new one from scratch.

If the above describes you, then this workshop series is for you! This 
first installment will cover:

- What is a "device"/"IP block", and what is a kernel "device driver"?
- How do modern SoCs integrate devices? Memory-mapped I/O, clock and 
power control
- The basics of the Linux device model: probing and removing devices, sysfs
- Probing devices - Device Tree, ACPI, and dynamically-probe-able bus
- Basics of the Linux kernel C API: how it differs from userspace glibc
- Creating your skeleton driver in the kernel directory tree
- Integrating your driver with the kernel build system Kbuild
- Building and test-booting your skeleton driver

We'll be using the ARM-based BeagleBone Black as our development platform:


It's the best-documented hobbyist board in its price point on the market. 
You're strongly encouraged to bring one to hack on! However, the 
techniques described in this workshop will be useful for any CPU 
architecture - x86, ARM, MIPS, you name it - and any development board - 
Raspberry Pi, Minnowboard Max, etc. So if you have some other development 
platform, please feel free to bring it.

Prerequisites (or, what we won't cover this time):

- That you're running Linux on your development computer
- That you've downloaded a copy of the Linux kernel source and built it
- That you've experimented with the Linux kernel configuration system 
  already (e.g., 'make menuconfig')
- That you've written some C code before - doesn't have to be kernel
  code; could be userspace code

That said, all are welcome.

Part 2 of this workshop (to be scheduled for a later date) will start with 
the skeleton driver created in part one, and actually start interacting 
with the device.

NOTE: Our Hackerspace Internet connection is slow. So we recommend that 
you do the following before coming to the workshop:

1. Download a copy of the Linux kernel source from https://www.kernel.org/

2. Download and install an ARM cross-compiler toolchain - for example, 
   from the one provided with your Linux distribution, or have downloaded 
   one from Linaro, like this one:

3. Download the AM3359 Technical Reference Manual PDF from TI via this link:

Instructor: Paul Walmsley

Workshop cost: FREE for Solid State Depot members, or $5-$20 (sliding 
scale) for non-members.

More information about the LUG mailing list