 |
» |
|
|
 |
First configure the software for the operating system. Then,
if necessary, bring down the system to install hardware. When you
reboot, HP-UX will automatically bind the drivers to the peripherals
it finds. Consult the tables in “Selecting Device Drivers for Your Printer
or Plotter” to
identify which drivers need to be present in your kernel for HP-UX
to communicate through the intended interface with the printer. Execute /usr/sbin/lsdev -d printer_driver to see whether the driver is already in the kernel.
If it is, you might see output resembling the following (shown for
a Series 700 parallel interface): /usr/sbin/lsdev -d CentIf
Character Block Driver Class
216 -1 CentIf ext_bus |
For a Series 800 parallel interface, executing /usr/sbin/lsdev
-d lpr2 might show similar output, but the character major
number is 181. In both Series 700 and 800 systems, the interface
class is ext_bus. Determine how much additional configuration
is needed for the printer by invoking the command, /usr/sbin/ioscan
-fn -dprinter_driver. If the necessary drivers
are already present in the kernel, the ioscan output of a Series 700 might resemble this: /usr/sbin/ioscan -fn -d CentIf
Class I H/W Path Driver S/W State H/W Type Description
=============================================================
ext_bus 1 2/0/6 CentIf CLAIMED INTERFACE Built-in Parallel Interface
/dev/c1t0d0_lp |
Similarly, the ioscan output for a Series 800 might resemble this: /usr/sbin/ioscan -fn -d lpr2
Class I H/W Path Driver S/W State H/W Type Description
===========================================================
ext_bus 2 56/53 lpr2 CLAIMED INTERFACE HP28655A-Parallel Interface
/dev/c2t0d0_lp |
Both cases show that the drivers and device special files
are present, allowing HP-UX to communicate with the printer. You can attach your printer without further operating-system configuration
and without bringing down the system. Your next task is to configure the LP spooler, to enable you
to send print jobs to the printer or plotter. To do so, see "Managing
Printers and Printer Output," in Managing Systems and
Workgroups. If any necessary static driver is absent
from the kernel (for example, if configuring the printer
also involves adding an interface card, or if you are configuring
the printer to an interface not previously used for a printer),
the ioscan output of a Series 800 might resemble this: /usr/sbin/ioscan -fn
Class I H/W Path Driver S/W State H/W Type Description
===========================================================
ext_bus -1 56/53 UNCLAIMED UNKNOWN HP28655A-Parallel Interface |
Notice in this example, the Driver field for the parallel
interface is blank, the class and hardware type are unknown and
no device special file is displayed. If the printer driver is absent, you will need to rebuild
the kernel to include it. Here is how to do so:
Once the software configuration is complete, bring down
the system with sufficient grace period to allow users to exit their
files. You can execute /usr/sbin/shutdown -r or /usr/sbin/reboot. If you have to install an interface card, bring the system
to a complete halt (that is, use /usr/sbin/shutdown -h or /usr/sbin/reboot -h). See shutdown(1M) or reboot(1M) in
the HP-UX Reference. Power off and unplug all peripherals, then the
SPU. Install the hardware, as described in the manual accompanying
the (card and) printer. Connect the printer to the card. Plug in and power up the printer. Set the hardware switches for the printer address. Plug in and power on any other peripherals and then the
SPU.
When the system reboots from the new kernel, HP-UX detects
the printer and associates it with its driver. In most instances, insf automatically creates the device special files necessary
to communicate with the printer, although in some cases you will
need to create the device special files as a separate operation.
(Two cases — configuring a printer to a serial port and
guidelines for configuring a non-HP printer to a parallel port — are
documented following this procedure.) Also refer to Appendix C “Major and Minor Numbers” for instructions on using mknod to create a custom device special file, if needed. Invoke /usr/sbin/ioscan -fn -d printer_driver again to confirm that the I/O subsystem finds the
printer and has created the necessary device special files. Your
output should now resemble that shown in step 3. Your next task is to configure the LP spooler to enable you
to send print jobs to the printer or plotter. See "Managing Printers
and Printer Output," in Managing Systems and Workgroups.
Creating a Device Special File for a
Printer or Plotter Configured to a Serial Port |  |
By default, insf creates device special files for parallel and
SCSI ports that can be easily associated with a printer or plotter. However, the device special files insf creates for serial ports (ports controlled by asio0, mux0, mux2, and mux4) are named to accommodate terminals more intuitively
than printers or plotters. To use the serial port for a line printer,
you should create a new device special file with a line printer
name. Execute ioscan -fn -C tty to identify the device file currently associated
with the port. Note in the following excerpted output, the sample
device special file representing port 3 has a name consistent with the device-file format
used by terminals and modems. /usr/sbin/ioscan -fn -C tty
Class I H/W Path Driver S/W State H/W Type Description
==================================================================
tty 0 56/56 mux2 CLAIMED INTERFACE MUX
/dev/tty0p3 |
Create a new device special for the port to which you
are attaching the printer by invoking /usr/sbin/mksf and specifying the device driver (-d), hardware path (-H), and serial port (-p). Use -l to create a device special file with a line-printer
name and -v for verbose output. For example, the following command line creates a new device
special file for port 3 with a line-printer name. /usr/sbin/mksf -d mux2 -H 56/56 -p3 -l -v
making c0p3_lp c 193 0x000300 |
If your manual states that your printer uses hardware flow
control (RTS/CTS) and you wish to employ it, you can execute mksf with the -f option to enable the feature. /usr/sbin/mksf -d mux2 -H 56/56 -p3 -f -l -v
making c0p3_lp c 193 0x000310 |
Invoke /sbin/ioscan -fn again to display the new device special file, whose
name will now be consistent with other line printer device special files. Class I H/W Path Driver S/W State H/W Type Description
==================================================================
...
tty 0 56/56 mux2 CLAIMED INTERFACE MUX
...
/dev/c0p3_lp
|
You can also confirm the file's characteristics by invoking /usr/sbin/lssf on the new file or viewing the long listing (ll). /usr/sbin/lssf /dev/c0p3_lp
mux2 card instance 0 port 3 hardwired at address 56/56 /dev/c0p3_lp |
ll /dev/c0p3_lp
crw-rw-rw- 1 bin bin 193 0x000300 Mar 16 18:29 /dev/c0p3_lp |
In the minor number (0x000300, shown in the long listing), you can see that
the 3 corresponds to the port number for the mux2 card at card instance 0. If you have enabled hardware flow control, your output will
resemble the following: /usr/sbin/lssf /dev/c0p3_lp
mux2 card instance 0 port 3 hardwired HW flow control
at address 56/56 /dev/c0p3_lp
ll /dev/c0p3_lp
crw-rw-rw- 1 bin bin 193 0x000310 Mar 16 18:29 /dev/c0p3_lp |
In the minor number (0x000310, shown in the long listing), you can see that
the 3 corresponds to the port number for the mux2 card at card instance 0 and that bit 27 is set.
(For minor number bit assignments, see Appendix C “Major and Minor Numbers”) Your next task will be to configure the LP spooler to enable
you to send print jobs to the printer or plotter. See "Managing
Printers and Printer Output," in Managing Systems and
Workgroups.
Guidelines for Configuring a Non-HP Printer to a Parallel
Port |  |
Compatibility problems typical when configuring non-HP peripherals
to the parallel interface usually involve the handshake mode. The CentIf driver provides six handshake modes that can be
accessed for different implementations. To use them, create a custom
device special file using specific bits in the minor number. When a peripheral is unable to communicate via the parallel
port, be sure to use the cat command and not lp as a starting point. This eliminates problems
with model scripts and lpsched. If this fails, and the peripheral is known to
work, substitute an HP LaserJet or DeskJet printer and test again.
If the HP product works, the problem may be in the handshake method.
(Be sure that the problem is communication and not the text going
to the printer — a PostScript printer will always report an
error if an ASCII file is sent to it.) Table C-3 “Minor Number for a SCSI Disk Device”shows the the bit assignments for
the CentIf driver. Bits 28-31 encode the handshake mode,
as follows: - 1
Handshake using nACK and BUSY lines. - 2
Handshake using BUSY line only. - 3
Bidirectional read/write for ScanJet support. - 4
Streaming mode. Setup = 1 usec, hold = 1 usec. This mode
is commonly used by Tektronix (Phasor and others) printers. - 5
Pulsed mode. Similar to mode 1, but nSTROBE is 1 usec. - 6
Pulsed mode. Similar to mode 2, but nSTROBE is 1 usec.
Modes 5 and 6 are used to resolve deadlock situations that
may occur in modes 1 and 2. Products that work well with modes 5
and 6 are the HP 293x family of printers, and some printers from NEC and
Qume. Note, these modes are for reference use only.
No support (beyond mode 2 for HP LaserJets) is implied; however,
the user may test these modes for possible success with other vendor
devices. For more information on the Centronics interface, consult
the cent(7) manpage.
|