|
Packit |
d36e9b |
libieee1284 README
|
|
Packit |
d36e9b |
------------------
|
|
Packit |
d36e9b |
|
|
Packit |
d36e9b |
This library is intended to be used by applications that need to
|
|
Packit |
d36e9b |
communicate with (or at least identify) devices that are attached via
|
|
Packit |
d36e9b |
a parallel port.
|
|
Packit |
d36e9b |
|
|
Packit |
d36e9b |
It currently works on Linux, OpenBSD (i386 only), FreeBSD/i386,
|
|
Packit |
d36e9b |
Solaris/x86, and Cygwin.
|
|
Packit |
d36e9b |
|
|
Packit |
d36e9b |
For Linux, there are some wrinkles in communicating with devices on
|
|
Packit |
d36e9b |
parallel ports:
|
|
Packit |
d36e9b |
|
|
Packit |
d36e9b |
- Applications that want to harvest IEEE 1284 Device ID information
|
|
Packit |
d36e9b |
can look in /proc for it, but it is in a different location in 2.4
|
|
Packit |
d36e9b |
kernels than it was in 2.2 kernels, and is completely absent in 2.0
|
|
Packit |
d36e9b |
kernels.
|
|
Packit |
d36e9b |
|
|
Packit |
d36e9b |
- Soon it will be in a different location again in 2.4.
|
|
Packit |
d36e9b |
|
|
Packit |
d36e9b |
- All kernels allow ioperm/inb/outb-style I/O, but it requires root
|
|
Packit |
d36e9b |
privilege. In addition, string I/O (such as outsb) is not available
|
|
Packit |
d36e9b |
on some architectures.
|
|
Packit |
d36e9b |
|
|
Packit |
d36e9b |
- 2.4 kernels have /dev/parport[0,1,2,...] device nodes which
|
|
Packit |
d36e9b |
applications can use; applications don't need to be run as root, but
|
|
Packit |
d36e9b |
they obviously need appropriate permissions set on the device node
|
|
Packit |
d36e9b |
they want to use.
|
|
Packit |
d36e9b |
|
|
Packit |
d36e9b |
- When capabilities catch on, /dev/port will be another alternative to
|
|
Packit |
d36e9b |
ioperm that doesn't require root privilege, although it does require
|
|
Packit |
d36e9b |
RAWIO capabilities.
|
|
Packit |
d36e9b |
|
|
Packit |
d36e9b |
The aim of this library is to take all the worry about the above
|
|
Packit |
d36e9b |
wrinkles from the application. It will figure out which method is
|
|
Packit |
d36e9b |
appropriate for the currently running kernel. For instance, if the
|
|
Packit |
d36e9b |
application wants to know the device ID of a device on a particular
|
|
Packit |
d36e9b |
port, it will ask the library for the the device ID. The library will
|
|
Packit |
d36e9b |
then figure out if it's available via /proc (in any of the possible
|
|
Packit |
d36e9b |
locations), and if not then it will try asking the device itself. If
|
|
Packit |
d36e9b |
/dev/parport0 isn't available for use, it will try ioperm; if that
|
|
Packit |
d36e9b |
fails, it will try /dev/port. And the application doesn't have to
|
|
Packit |
d36e9b |
care.
|
|
Packit |
d36e9b |
|
|
Packit |
d36e9b |
The interface is set out in the header file, ieee1284.h, and in the
|
|
Packit |
d36e9b |
SGML document doc/interface.xml (which can be viewed in HTML format
|
|
Packit |
d36e9b |
at <http://cyberelk.net/tim/libieee1284/interface/>). If this doesn't
|
|
Packit |
d36e9b |
do something that you think it should, or it does something in a way
|
|
Packit |
d36e9b |
that doesn't make sense to you, please let me know so that I can fix
|
|
Packit |
d36e9b |
it. I need feedback on the interface to know whether it is working.
|
|
Packit |
d36e9b |
|
|
Packit |
d36e9b |
--
|
|
Packit |
d36e9b |
Tim Waugh <tim@cyberelk.net>
|