Historical stuff

My favorite operating system is Linux. I do all my private and business computer work with Linux - I'm quite happy with that. I started using Linux in early 1995, quite shortly after I got a new PC as gift. I tried using (Novell-)DOS 7 and Windows 3.1, but after a short time I discovered that a Unix like operating system is the only way to work in a convenient way in a TCP/IP network.

Most of the projects listed in the download page are from my early beginnings of using Linux.

One of the bigger projects I've done in this time mainly to satisfy my private interest was a readback implementation for reading back the printer status using the PC parallel port. As there was no support for this function in Linux kernels up to version 2.1 I wrote a patch that enabled read() operation on the PC parallel port device /dev/lp.

In the meantime this code was enhanced, improved, abstracted and ported to other plattforms by a lot of kernel developers. You can get an impression of the current development on the Linux parport page.


Why Statusreadback?

A lot of newer printer models offer the possibility to report their status much more verbose than this would be possible via the 3 lines "Paper error", "Error" and "Offline". These printers offer a lot more information. One is able to read installed fonts, available paper trays or installed printer memory. Data is transmitted from printer to the host computer.
Unfortunality the printer port in the PC is write only and therefore you have to use the status and acknowledge lines together with some tricks to get bytes from the printer back to the host computer.

How do I do a readback?

A protocol defined in detail in IEEE1284 is used. Bytes that are to be transferred from the printer back to the computer are split up into so called nibbles, a group of 4 bits. They are transferred over the existing status lines, e.g. "Paper error". A fully cabled printer port cable is needed for this. Especially very cheap or homemade cable are sometimes missing some status lines. The cable can be used for simple printing, but readback could possibly not work.

How do I configure my Linux kernel?

In the meantime the patch is avilable for quite some time now in the Linux kernel. Most distributions are using the information provided by the IEEE 1284 compatible devices, in most cases a printer.

What can I do now?

Now it is interesting for you to know: "Does my printer support this feature"? For example a lot of "laserjet" printers from HP are capable to report their status this way. I myself had a HP Laserjet 6P and so are all examples derived from this printer. On the next Page there is a description of PJL commands, unfortunality only available in german at the moment. As small example we can execute the following command line as user "root". If your printer starts to print the line then it does not support PJL.


# echo -e "\33%-12345X@PJL\n@PJL INFO ID\n\33%-12345X" | \
cat > /dev/lp0
# cat /dev/lp0

As you see everything works on the command line. The only thing missing now is a user mode program that benefits from the enhanced possibilities.
Take a look at the PJL commands.

© Carsten Groß - last change 01.03.2008 20:01