Printing in Amigo Linux: Printer Set-up
 

Amigo Linux Printing How-To:

Setting up your printer

Introduction  |  Printer set-up  |  Software installation  |  Fine-tuning  |  Endnotes
 
 

Before installing the software for printing, you need to make sure your printer is recognized by Amigo Linux. This does not happen as a matter of course, every time you boot. For my description below, I will assume you have a parallel-port printer. If you have a USB printer, you will have to change the procedure accordingly, which should not be difficult.

In order that you can print from Linux, you have to load a module called lp that sets up your parallel port. This requires that you know the io address and the irq of your parallel port. If it is the port connected directly to the motherboard, it is most likely what DOS calls LPT1, at io 0x378 and irq 7. In case you are not sure about this, you may want to go into your BIOS to see what the values of these parameters are in your system.

In order to see what modules are loaded on your system, do the following at the shell prompt:

lsmod

You will see a list of modules such as

usb-ohic   19048   0   (unused)
ntfs       51360   0   (unused)
...
but nothing that says lp.

To load the lp module, do the following at the shell prompt:

insmod lp io0x378 irq7
assuming that these are the proper values for your parallel port. (If your port were LPT2, at io 0x278 and irq 7, you would use those values). Now if you again do:

lsmod

you will see the same list of modules as before, but in addition an entry that says something like:

lp         6724   0   (unused)

At this point you are ready to test printing, assuming that your printer is connected to your parallel port. Do the following at the shell prompt:

ls > /dev/lp0

and your printer should print out a file listing of your working directory in raw text format. /dev/lp0 is the first device loaded by the lp module, corresponding to LPT1. The other one is /dev/lp1, corresponding to LPT2. So you could address two printers at the same time if you had set up two parallel ports.

Note that the syntax above of the insmod command is important. Do not use = signs for io and irq, as some of the Linux documentation suggest. It won't work that way ! Also, it is usually recommended to load modules with the modprobe rather than the insmod command. The reason given is that modprobe loads all modules that depend on each other. In the case of the lp module, if you do

modprobe lp io0x378 lpr7
the lp module does get loaded, but also another module called parport. And when parport is loaded, printing does NOT work, at least on my system !

Now, assuming that printing works with your printer in principle, you can make sure that the lp module gets loaded every time you boot Amigo Linux by inserting the line

insmod lp io0x378 irq7
into the /etc/rc.d/rc.modules file. I don't think it matters where you put this line. However, a natural place is somewhere near the top of the file where you will find other stuff about parallel port modules (such as parport). Do not comment out anything that is there already, but add the line above.


© C. Steinbrüchel (2005)



Introduction  |  Printer set-up  |  Software installation  |  Fine-tuning  |  Endnotes