Skip to main content

Linux kernel infrastructure for user-level device drivers


Peter Chubb

NICTA, Sydney, Australia
UNSW, Australia


Infrastructure for User-Level Device Drivers in Linux 2.5. (Kernel/Low Level) Presented by Dr Peter Chubb in Napier LG29 on Thursday, January 15th at 2:00pm

Linux 2.5.x has good support now for user-mode device drivers --- XFree being the biggest and most obvious --- but also there is support for user-mode input devices and for devices that hang off the parallel port.

The motivations for user-mode device drivers are many:

  • Ease of development (all the normal user-space tools can be used to write and debug, not restricted to use of C only (could use Java, C++, Perl, etc), fewer reboot cycles needed, fewer restrictions on what one can do wrt reentrancy and interrupts, etc., etc.)
  • Ease of deployment (kernel<->user interfaces change much more slowly than in-kernel interfaces; no licensing issues; no need for end-users to recompile to get module versions right, etc., etc.))
  • Increased robustness (less likely that a buggy driver can cause a panic)
  • Increased functionality. Some things are just plain easier to do in user space than in the kernel --- e.g., networking.
  • Increased simplicity (rather than have, say, a generic IDE controller that has to understand the quirks of many different kinds of controllers and drivers, you can afford to pick at run time the controller you really need)

There are however some drawbacks, the main ones being performance and security.

Three recent developments have made it possible to implement an infrastructure for user-level device drivers that perform almost as well (in some cases better than) in-kernel device drivers. These are the new pthreads library (and corresponding kernel changes: futexes, faster clone and exit, etc); fast system call support; and IOMMUs.

Now that many high-end machines have an IOMMU, it becomes possible, at least in theory, to provide secure access to DMA to user processes.

Fast system calls allow the kernel<->user corssing to be extremely cheap, making user-process interrupt handling feasible.

And fast context-switching and IPC for posix threads, means that multithreaded device drivers can have the kind of performance that until recently was only available in-kernel.

In my paper and talk I shall describe the infrastructure necessary to provide low-latency access to interrupts and DMA from a user process. I shall also present some benchmarks for an IDE controller that show essentially the same I/O performance as the in-kernel driver, at the expense of slightly increased processor utilisation.

BibTeX Entry

    month            = jan,
    paperurl         = {},
    booktitle        = {5th},
    author           = {Peter Chubb},
    year             = {2004},
    title            = {Linux Kernel Infrastructure for User-Level Device Drivers},
    address          = {Adelaide, Australia}