ppbus programming / porting freenomad to FreeBSD

Nimrod Mesika nimrod-me at bezeqint.net
Fri Dec 24 07:50:37 PST 2004


Hi all,

I'm trying to port 'freenomad' (an abandoned sourceforge project)
from Linux to FreeBSD.

The software uses the Linux parallel port framework (parport) to
setup a simple IEEE 1284 ECP session.

It seems like the equivalent functionality is provided by FreeBSD's
ppbus(4). However, I can't find any documentation/example code for
using ppbus from a userland application.

Specifically, the Linux app does the following:

1. open("/dev/parport0", O_RDWR)
2. Claim the port (Linux ioctl PPCLAIM)
3. Negotiate ECP (Linux ioctl PPNEGOT with arg. IEEE1284_MODE_ECP)

Before reading or writing it sets the parallel port direction
4. ioctl( fd, PPDATADIR, &direction ) (direction=0/1)
5. write() or read() using the handle returned by open()

On exit
6. Release the port: ioctl( fd, PPRELEASE )
7. close(fd)

I need to find the equivalent code for FreeBSD and would appreciate
any pointers you might have.

Thanks,
Nimrod.



More information about the freebsd-questions mailing list