how to talk to the serial and parallel ports through a C program

Andreas Kohn andreas.kohn at
Mon Jun 9 13:39:38 PDT 2003

Am Mon, 2003-06-09 um 18.44 schrieb Dan Malaby:
> I was wondering if there was a good place to go to get programing examples 
> on how to
> talk to the serial and parallel ports. I have looked in the developers 
> handbook but have not
> any luck finding what I want.
> Any pointers would be appreciated
> Thanks


at least for parallel ports, ppi might help you. There is a short
example in the ppi(4) man page:

     To present the value 0x5a to the data port, drive STROBE low and
     high again, the following code fragment can be used:
             int             fd;
             u_int8_t        val;
             val = 0x5a;
             ioctl(fd, PPISDATA, &val);
             ioctl(fd, PPIGCTRL, &val);
             val |= STROBE;
             ioctl(fd, PPISCTRL, &val);
             val &= ~STROBE;
             ioctl(fd, PPISCTRL, &val);

Andreas Kohn <andreas.kohn at>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url :

More information about the freebsd-questions mailing list