Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
Configuring HP-UX for Peripherals: HP 9000 > Chapter 7 Configuring Printers and Plotters

Configuring a Printer Using HP-UX Commands

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

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.

  1. 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.

  2. 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.

  3. 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-Paralle 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 HP-UX System Administration Tasks.

    • If any necessary 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:

      1. Change directory to the build environment (/stand/build). There, execute a system preparation script, system_prep. system_prep writes a system file based on your current kernel in the current directory. (That is, it creates /stand/build/system.) The -v provides verbose explanation as the script executes.

        cd /stand/build
        /usr/lbin/sysadm/system_prep -v -s system
      2. Edit the /stand/build/system file to add any absent driver(s). (If you are adding an interface card also, make sure to add the interface driver, as documented in Chapter 2.)

      3. Build the kernel by invoking the mk_kernel command. This creates /stand/build/vmunix_test, a kernel ready for testing.

        /usr/sbin/mk_kernel -s system
      4. Save the old system file and kernel by moving them. Thus, if anything goes wrong, you still have a bootable kernel.

        mv /stand/system /stand/system.prev
        mv /stand/vmunix /stand/vmunix.prev
      5. Move the new system file and new kernel into place, ready to be used when you reboot the system.

        mv /stand/build/system /stand/system 
        mv /stand/build/vmunix_test /stand/vmunix
      6. If your printer installation also requires that you install an E/ISA card, you need to run eisa_config at this time to configure the EISA or ISA bus. Consult "Appendix A, EISA Configuration" of this manual for tutorial and procedures and eisa_config(1M) in the HP-UX Reference.

  4. 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.

    1. Power off and unplug all peripherals, then the SPU.

    2. Install the hardware, as described in the manual accompanying the (card and) printer.

    3. Connect the printer to the card.

    4. Plug in and power up the printer.

    5. Set the hardware switches for the printer address.

    6. 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.

  5. Invoke /usr/sbin/ioscan -fn -dprinter_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 HP-UX System Administration Tasks.

Creating a Device Special File for a Printer or Plotter Configured to a Serial Port

By default, insf creates device special files for parallel, HP-IB, 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.

  1. 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
  2. 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
  3. 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 HP-UX System Administration Tasks.

Creating a Device Special File for an HP-IB Printer

When the system boots, insf is unable to create default device special files for any printer attached to an EISA HP-IB interface. You will need to create a character device file using mknod.

To do so,

  1. Change directory to /dev.

  2. Determine the major number by invoking the lsdev command. You will see that hpib has a character major number of 21.

  3. Construct a minor number for the device by using the bit assignments for the hpib device driver, found in in Appendix C.

  4. Create the device special file using mknod, which has the following syntax:

    /usr/sbin/mknod file_name b|c major# minor#
    • Name the file something easily associated with the device.

    • Use c for character device special file.

    • Use the character major number reported by lsdev.

    • Use the minor number constructed from the bit assignment tables.

    The minor number for hpib has the syntax 0xABC000, where

    • 0x is the prefix indicating hexadecimal format.

    • AB is the card instance number.

    • C is the HP-IB device.

    Execute ioscan -f to identify the card instance number for the EISA HP-IB card. In the following sample output, the card instance number is 3.

    /usr/sbin/ioscan -f -d hpib 
    Class I H/W Path Driver S/W State H/W Type Description
    ================================================================
    ext_bus 3 4/0/3 hpib CLAIMED INTERFACE EISA card HWP0C70

    Set the HP-IB printer device number on the printer itself. Assuming for this example that the HP-IB device is set to 2, the command line for a device special file called /dev/hpib_printer would be as follows:

    /usr/sbin/mknod /dev/hpib_printer c 21 0x032000
  5. Once you create the device special file, HP-UX will be able to communicate with the printer. Plug in the printer, turn it on, and send it a short file. It should print.

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-4 of Appendix C 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.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1995, Hewlett-Packard Development Company, L.P.