poll or select for ppi?

Bruce M Simpson bms at spc.org
Mon Mar 14 19:38:32 PST 2005


On Mon, Mar 14, 2005 at 10:05:34PM -0500, Matt Kory wrote:
> Is it possible to use poll or select to detect a change in the status
> bits of the parallel port?  I tried something like this, and took bits
> 5 and 6 of the status register low and nothing seemed to happen.  Is
> what I am trying to do even possible, or I am supposed to take a
> certain bit low to cause a read event?  Any help is appreciated.

Disclaimer: I'm no expert on the parallel port.

The man page for ppi(4) says that all I/O is via ioctl(), which isn't
covered by the select() mechanism.

You'd either have to poll PPIGSTATUS from userland on a timer, or perhaps
hack the driver to use a kevent. Considering there's probably no way to
get a hardware interrupt for the status change directly via ppi(4), you
might need to consider writing a set of custom ppbus microsequences and
a driver for your application.

Regards,
BMS


More information about the freebsd-hackers mailing list