Home  |Overview |Search |History |Versions |Categories |Keywords | Home

Keyword search

If you have e.g. a problem with your modem, enter "modem" and press Enter.


* Support offerings
* Installation support
* Hardware database
* Unlock your Support Key
* Download
* Contact information
   
Advertisment
Printable version Mailto SuSE

Setting Up an Additional Parallel Port

o Deutsch o Cesky

Email address:
Support knowledgebase (jsmeix_print-device-parallel)
Applies to

SuSE Linux: Versions 6.2 to 7.3
Kernel: Versions since 2.2

Situation:

You want to configure your additional parallel port.

From SuSE Linux 8.0 on, check the "Reference" manual.

Prerequisite:

You must be using kernel 2.2.xx or better.

Background Information:

By default, only the first parallel port /dev/lp0 is available.
This parallel port is configured by means of the following entry in the file /etc/conf.modules or /etc/modules.conf (SuSE Linux 6.3 or later):

alias parport_lowlevel parport_pc
options parport_pc io=0x378 irq=none,none
# If you have multiple parallel ports, specify them this way:
# options parport_pc io=0x378,0x278  irq=none,none
io=0x... is followed by the I/O address of the parallel port; irq=... usually states "none" for polling or the interrupt of the parallel port. Polling is usually better than interrupt operation and does not affect the speed (except for very old machines).
In order for the first parallel port to work with these settings, the following default values must be set for the parallel port in your BIOS:
I/O address 378 (hexadecimal)
Interrupt 7 (for polling it makes no difference)
Normal or SPP mode (other modes may not work)
DMA off (should be inactive in the normal mode)

Testing the first parallel port:
If a normal printer (not a GDI printer) is connected to /dev/lp0, the command
echo -en "Hello\f" >/dev/lp0
entered as the user root should produce a page with the word "Hello". (Compare the articles on GDI printers and selecting a compatible printer.)

Procedure:

Simplest Case:

Assuming you have a second parallel port that can be addressed with the standard I/O address 278 (hexadecimal; can be set e.g. with jumpers on ISA interface cards), the following entry in /etc/conf.modules or /etc/modules.conf (SuSE Linux 6.3 or later) is sufficient:

alias parport_lowlevel parport_pc
# options parport_pc io=0x378 irq=none,none
# If you have multiple parallel ports, specify them this way:
options parport_pc io=0x378,0x278  irq=none,none
Following a reboot, the second parallel port should be available.
Testing the second parallel port:
If a normal printer (not a GDI printer) is connected to /dev/lp1, the command
echo -en "Hello\f" >/dev/lp1
entered as the user root should produce a page with the word "Hello".

More Difficult Cases:

It will be more complicated if the I/O address of the additional parallel port is not known beforehand.
In this case, the I/O address of the additional parallel port must first be determined.

I) ISA PnP cards:

Sometimes fixed values for the I/O address, interrupt, and mode can be set on cards of this kind:
Either by way of jumpers or - if you have DOS/Windows - by means of an enclosed DOS/Windows program.
If this is possible, set fixed values for the I/O address, interrupt, and mode.

If this is not the case, the values for the I/O address, interrupt, and mode will be written to the ISA PnP card when Linux is started.
These values can be retrieved from the Linux boot messages, or the following procedure described in the manual (chapter "Linux and Hardware") can be followed:

  1. Log in as root
  2. If /etc/isapnp.conf already exists, save the existing file with
    mv /etc/isapnp.conf /etc/isapnp.conf.bak
  3. Create a new /etc/isapnp.conf with
    pnpdump -c >/etc/isapnp.conf
  4. Activate the ISA PnP card(s) with
    isapnp /etc/isapnp.conf
    and make a note of the I/O address (port) and interrupt (IRQ) of the interface card which will appear in the output.
Disadvantage of ISA PnP cards without fixed values for the I/O address, interrupt, and mode:
If you already use ISA PnP cards and install an additional ISA PnP card, the BIOS or the command
pnpdump -c >/etc/isapnp.conf
may cause the values for the I/O addresses and interrupts of the previous ISA PnP cards to be assigned differently. If this happens, the previous ISA PnP cards will no longer work and all ISA PnP cards must be reconfigured.
This problem does usually not occur with PCI cards. Though a newly added PCI card may cause the values for the I/O addresses and interrupts of the previous cards to be assigned differently by the BIOS, the PCI card drivers usually retrieve the current values from the BIOS at start-up. An exception to this rule is e.g. the driver for the parallel ports - the kernel module parport_pc - which requires an explicit indication of the values for the I/O addresses and interrupts of the parallel ports.

II) PCI cards:

The I/O addresses and interrupts which can be used for a PCI card can be displayed with the following command (as root):
lspci -v
or at a higher level of verbosity with
lspci -vv

Example:

Excerpt from the output of lspci -v for a PCI interface card with two parallel ports:

...
00:0a.0 Parallel controller: ...
        ...
        Flags: stepping, medium devsel, IRQ 10
        I/O ports at b400
        I/O ports at b000
        I/O ports at a800
        I/O ports at a400
...
Two I/O addresses in intervals of 400 (hexadecimal) jointly belong to one parallel port.
The following entry in /etc/conf.modules or /etc/modules.conf (SuSE Linux 6.3 or later) makes all three parallel ports available after a reboot:
alias parport_lowlevel parport_pc
# options parport_pc io=0x378 irq=none,none
# If you have multiple parallel ports, specify them this way:
options parport_pc io=0x378,0xb400,0xa800 irq=none,none,none
Testing all parallel ports:
Provided normal printers are connected to the parallel ports, entry of
echo -en "Hello\f" >/dev/lp0
echo -en "Hello\f" >/dev/lp1
echo -en "Hello\f" >/dev/lp2
as root should produce a page with the word "Hello", respectively.

Note:
Instead of rebooting, it is sufficient to update the list of kernel module dependencies as the user root and - provided only printers are connected to the parallel ports - stop the print daemon, unload and reload the kernel modules for the parallel ports, and restart the print daemon using the following commands:
/sbin/depmod -a 2>/dev/null >/dev/null
rclpd stop
rmmod lp
rmmod parport_probe
rmmod parport_pc
rmmod parport
modprobe parport
modprobe parport_pc
modprobe parport_probe
modprobe lp
rclpd start

If the test of the additional parallel ports is successful, additional printers or other parallel devices can be set up. Simple use /dev/lp1 or /dev/lp2 as printer device instead of /dev/lp0


See also:
o Installing a printer
o Parport - General Information

Keywords: PRINTING, PRINTER, PARALLEL, PORT, LP1, LP2, PARPORT

Categories: Frequently asked Questions , Documentation , Printer

SDB-jsmeix_print-device-parallel, Copyright SuSE Linux AG, Nürnberg, Germany - Version: 02. Apr 2002
SuSE Linux AG - Last generated: 04. Apr 2002 by ip (sdb_gen 1.40.0)