The Userspace I/O HOWTO

Hans-Jürgen Koch

This documentation is Free Software licensed under the terms of the GPL version 2.


Revision History
Revision 0.92009-07-16mst
Added generic pci driver
Revision 0.82008-12-24hjk
Added name attributes in mem and portio sysfs directories.
Revision 0.72008-12-23hjk
Added generic platform drivers and offset attribute.
Revision 0.62008-12-05hjk
Added description of portio sysfs attributes.
Revision 0.52008-05-22hjk
Added description of write() function.
Revision 0.42007-11-26hjk
Removed section about uio_dummy.
Revision 0.32007-04-29hjk
Added section about userspace drivers.
Revision 0.22007-02-13hjk
Update after multiple mappings were added.
Revision 0.12006-12-11hjk
First draft.


This HOWTO describes concept and usage of Linux kernel's Userspace I/O system.

Table of Contents

1. About this document
2. About UIO
How UIO works
3. Writing your own kernel module
struct uio_info
Adding an interrupt handler
Using uio_pdrv for platform devices
Using uio_pdrv_genirq for platform devices
4. Writing a driver in userspace
Getting information about your UIO device
mmap() device memory
Waiting for interrupts
5. Generic PCI UIO driver
Making the driver recognize the device
Things to know about uio_pci_generic
Writing userspace driver using uio_pci_generic
Example code using uio_pci_generic
A. Further information