Red Hat Linux 7 Unleashed

Red Hat Linux 7 Unleashed

By William Ball

Printer Devices

Under Linux, each piece of your computer's hardware is abstracted to a device file (hopefully with an accompanying device driver in the kernel; see Chapter 18, "Linux Filesystems, Disks, and Other Devices," for more details). Printer devices, traditionally named after line printers, are character mode devices and will be found in the /dev directory. Some of these devices, along with the traditional hardware port assignments, are shown in Table 19.1.

Table 19.1. Parallel Printer Devices

Device Name Printer Address
/dev/lp0 First parallel printer 0x3bc
/dev/lp1 Second parallel printer 0x378
/dev/lp2 Third parallel printer 0x278

Serial printers are assigned to serial devices, such as /dev/ttySX, where X is a number from 0 to 3. Quite a few tty devices are listed in /dev. Generally, if you're going to use a serial printer, you have to use the setserial command to make sure the printer's serial port is set to the fastest baud rate your printer supports.

In some special cases, such as using an old Apple LaserWriter as a serial printer (it has a Diablo print-wheel emulation mode using the Courier font), you must define your own printer or edit an entry in the /etc/printcap database. Sometimes you can manipulate the printer to get a higher speed. For example, here's a 10-year-old trick, posted to the comp.laser-printers newsgroup by Dale Carstensen, for increasing the serial port speed of the Apple LaserWriter Plus to 19200:

%!
0000 % Server Password
statusdict begin 25 sccbatch 0 ne exch 19200 ne or
{ serverdict begin exitserver} {pop end stop} ifelse
statusdict begin
25 19200 0 setsccbatch
end % noteÑnext line has an actual CTRL-D

See Appendix D in the RedBook, Adobe's PostScript language reference manual, for more information about LaserWriters, or peruse comp.laser-printers for hints on setting up your laser printer. Also read the file Psfiles.htm under the /usr/share/ghostscript/5.50 directory for information about the numerous PostScript printer utilities included in the Ghostscript distribution.

Most desktop users, however, have a printer attached to the parallel printer port, so I'll first concentrate on /dev/lp.

Share ThisShare This

Informit Network