Driver Tutorial at LinuxWorld Conference and Expo

News
Aug 5, 20063 mins

Kernel development has special requirements. If you’re taking the device driver tutorial at LinuxWorld Conference and Expo, here’s how to get your laptop ready to go.

With two weeks remaining until the start of LinuxWorld Conference and Expo, it’s time to start getting ready. The device driver tutorial, taught by kernel developer and author Greg Kroah-Hartman, will have you working on the hairy side of the kernel space/userspace barrier, so you’ll need to check a few important requirements before you get started.

There’s nothing like being part of a room full of people who are all plugging in a device and getting it to work, and you don’t want to be the person whose driver doesn’t work because of something you could have taken care of before tutorial day. Based on working through the same tutorial at the FreedomHEC conference held in Seattle in May, here are a few items to check beforehand.

First of all, you should have a current kernel and know how to build it. Remember, you can copy over the .config file from your old kernel into your new kernel source tree, then run make oldconfig, so that you only have to answer config questions that have changed since you upgraded. Building the kernel before the tutorial is a good way to check that your C development environment is ready. If you can build the kernel, you’ll have all the tools you need for the driver tutorial.

The device that you’ll be using for the tutorial is USB, so check that your USB hardware and all the userspace support are working. Plug in a USB thumb drive, printer, or digital camera to test.

You’ll be loading and unloading multiple versions of your driver, so make sure that kernel module unloading, using the rmmod command, works. If not, you’ll need to build a kernel with CONFIG_MOD_UNLOAD set. You can find the “module unloading” option in the “Loadable module support” screen of the menuconfig tool. This isn’t something you need to do before the tutorial, but if you want to build and insert a module just to try it out, there’s a “hello world” module in chapter two of Linux Device Drivers.

On Linux, device driver developers aren’t second-class citizens, but have a key role in defining the directions in which Linux grows and develops. Greg said in his keynote talk at the Linux Symposium in Ottawa, “We want more drivers, no matter how ‘obscure’, because it allows us to see patterns in the code, and realize how we could do things better. If we see a few drivers doing the same thing, we usually take that common code and move it into a shared piece of code, making the individual drivers smaller, and usually fixing things up nicer.”