- Table of Contents
- Copyright
- About the Lead Authors
- About the Contributing Authors
- Acknowledgments
- Tell Us What You Think!
- Introduction
- I. Red Hat Linux Installation and User Services
- Chapter 1. Introduction to Red Hat Linux
- Chapter 2. Installation of Your Red Hat System
- Chapter 3. LILO and Other Boot Managers
- Chapter 4. Configuring the X Window System, Version 11
- Chapter 5. Window Managers
- Chapter 6. Connecting to the Internet
- Chapter 7. IRC, ICQ, and Chat Clients
- Chapter 8. Using Multimedia and Graphics Clients
- II. Configuring Services
- Chapter 9. System Startup and Shutdown
- Chapter 10. SMTP and Protocols
- Chapter 11. FTP
- Chapter 12. Apache Server
- Chapter 13. Internet News
- Chapter 14. Domain Name Service and Dynamic Host Configuration Protocol
- Chapter 15. NIS: Network Information Service
- Chapter 16. NFS: Network Filesystem
- Chapter 17. Samba
- III. System Administration and Management
- Chapter 18. Linux Filesystems, Disks, and Other Devices
- Chapter 19. Printing with Linux
- Chapter 20. TCP/IP Network Management
- Chapter 21. Linux System Administration
- Chapter 22. Backup and Restore
- Chapter 23. System Security
- IV. Red Hat Development and Productivity
- Chapter 24. Linux C/C++ Programming Tools
- Chapter 25. Shell Scripting
- Chapter 26. Automating Tasks
- Chapter 27. Configuring and Building Kernels
- Chapter 28. Emulators, Tools, and Window Clients
- V. Appendixes
- A. The Linux Documentation Project
- B. Top Linux Commands and Utilities
- C. The GNU General Public License
- D. Red Hat Linux RPM Package Listings
How Do I Print?
One of the first things you should do before setting up your printer for Linux (especially if it is a parallel-port printer), is to make sure the printer works. First, check to see that your printer is plugged in, turned on, and attached to your computer's parallel port. Pass-through parallel port cables shouldn't pose a problem, but don't expect to be able to use your printer while you're using your CD-ROM, QuickCam, SCSI adapter, tape drive, or SyQuest drive if attached to a pass-through cable.
For starters, try this simple code:
# ls >/dev/lp0
Chances are your printer will activate and its print head will move, but when you look at the printout, you might see a staircase effect, with each word on a separate line, moving across the page. Don't worry—this is normal and tells you that you can at least access your printer. Later in this chapter, you'll find out how to fine-tune your printing.
New Parallel-Port Drivers
Red Hat Linux uses version 2.2.16 of the Linux kernel. Unlike previous 2.0 versions of the kernel, recent 2.2.X and newer kernels use a different approach to parallel-port initialization, recognition, and configuration. In legacy kernels, parallel-port support was aimed specifically at providing printer support and was "hard-wired" into the kernel. This approach did not cover the needs of the myriad of parallel-port devices on the market. The newer approach, which uses several parallel-port kernel modules, abstracts communication with your computer's hardware to better support a much wider range of devices and provide new features, such as using multiple devices.
As distributed, Red Hat Linux contains a default parallel-port kernel module configuration in /etc/modules.conf. This line enables the low-level parallel-port parport kernel modules to attempt to autodetect any attached printers or devices:
alias parport_lowlevel parport_pc
You can view the output of these modules with the dmesg command following an attempt to print. Look for output similar to this:
parport0: PC-style at 0x3bc [SPP,PS2] parport_probe: succeeded parport0: Printer, Hewlett-Packard HP DeskJet 340 lp0: using parport0 (polling).
This shows that the computer's parallel port was detected, along with an attached printer (HP 340). The attached printer will use /dev/lp0 as the printer device. You can also use the lsmod command to verify that the printer drivers have been loaded following a print job, like this:
# lsmod Module Size Used by parport_probe 3428 0 (autoclean) parport_pc 7464 1 (autoclean) lp 5416 0 (autoclean) parport 7320 1 (autoclean) [parport_probe parport_pc lp] ...
The parport modules are automatically loaded whenever the lp.o kernel module is used. If your parallel port hardware is detected, you can examine the contents of the hardware file under the printer port's device number (such as /dev/lp0) like this:
# cat /proc/parport/0/hardware base: 0x3bc irq: none dma: none modes: SPP,PS2
You can also use the parport_pc kernel module to specify your system's parallel I/O port address and IRQ. Use the insmod command to first load the parport.o module like this:
# insmod parport
Next, use the parport_pc module, along with its io and irq options like this:
# insmod parport_pc io=0x378 irq=7
This will tell the Linux kernel that your computer has a parallel port using the specified address and IRQ. This can be important, especially if you need to custom configure the port for a printer or other device.
You can also try the tunelp command, which sets various parameters to "tune" your printer port or lets you know if your printer device is using interrupts or polling for printing. Try using the command with its -s or status option like this:
# tunelp /dev/lp0 -s
You might see this output:
/dev/lp0 status is 223, on-line
If tunelp reports "No such device or address", if you do not find an lp character device, and if you cannot load the parport modules, see Chapter 27, "Configuring and Building Kernels," to learn how to build kernel modules for your system.
For details about the new parport drivers, read the file parport.txt under the /usr/share/doc/kernel-doc-2.2.16 directory.
printtool The Red Hat Linux Print System Manager | Next Section

Account Sign In
View your cart