User-level device drivers

Introduction to ppdev

The printer is accessible through /dev/lp0; in the same way, the parallel port itself is accessible through /dev/parport0. The difference is in the level of control that you have over the wires in the parallel port cable.

With the printer driver, a user-space program (such as the printer spooler) can send bytes in "printer protocol". Briefly, this means that for each byte, the eight data lines are set up, then a "strobe" line tells the printer to look at the data lines, and the printer sets an "acknowledgement" line to say that it got the byte. The printer driver also allows the user-space program to read bytes in "nibble mode", which is a way of transferring data from the peripheral to the computer half a byte at a time (and so it's quite slow).

In contrast, the ppdev driver (accessed via /dev/parport0) allows you to: