*BSD News Article 16656


Return to BSD News archive

Newsgroups: comp.os.386bsd.questions
Path: sserve!newshost.anu.edu.au!munnari.oz.au!network.ucsd.edu!usc!wupost!csus.edu!netcom.com!alm
From: alm@netcom.com (Andrew Moore)
Subject: Re: [386bsd] Can't Print: Please help
Message-ID: <almC7vIqI.5HH@netcom.com>
Organization: Netcom Online Communications Services (408-241-9760 login: guest)
References: <Mg25kme00V868=1EZ5@andrew.cmu.edu>
Date: Mon, 31 May 1993 04:20:41 GMT
Lines: 76

In article <Mg25kme00V868=1EZ5@andrew.cmu.edu> "N. R. Natraj" <nn07+@andrew.cmu.edu> writes:
>I get this big fat cheque from IRS (yeah, right for a grad student!) and
>decide to plonk a big chunk of it into buying a printer. After a lot of
>deliberation I ended up buying a TI Microlaser PS 35. I have a machine
>running 386bsd+pk0.2.3 with the src tree recompiled (atleast that's what
>I think!). Here is what all I have tried to get the printer to print
>something.
>
>Attempt 1: kernel compiled with the following for the printer.
>
>device         lpt0    at isa? port "IO_LPT3" tty irq 7 vector lptintr
>device         lpa0    at isa? port "IO_LPT1" tty
>device         lpa1    at isa? port "IO_LPT2" tty

I recommend that you avoid the lpt driver.  This has been a source of
problems before and probably has not been fixed yet (see the included
article below).  Until lpt works correctly, the lpa devices are provided
as a work-around.  These are driven by an "interruptless" driver.
(The advantage of the interrupt-driven device is that it is faster.)

If your printer is connected to LPT1 (in DOSese), compile your kernel
(386BSD 0.1+0.2.3) with the above parameters.   Then:
# cd /dev; sh MAKEDEV lpa0 lpa1
# rm -f /dev/lp; ln -s /dev/lpa0 /dev/lp

Or instead of /dev/lpa0, you might want to use /dev/lpa0p
which evidently primes the printer on each open (see the file
/sys/i386/isa/lpa.c).

Next, you might need a filter to send the appropriate incantations to
your laser printer before printing.  There are lots of ways to do
this.  Reinier Kleipool has suggested the following which he uses for
his laserjet (the particular string may not be appropriate for
your printer).

#       @(#)printcap    5.3 (Berkeley) 6/30/90

lp|local line printer:\
 	:lp=/dev/lpt1:sd=/var/spool/lpd:lf=/var/log/lpd-errs:sh:\
 	:if=/usr/local/filters/if_ljet3:\
------------------------------------------------------------------------
And this is my homebrew if= input filter script:
--------------------------
/usr/local/filters/if_ljet3
-----------------
#!/bin/sh
printf "\033E\033&k2G"
cat -
printf "\033E"

The following articles explains why the lpt driver has problems:

In article <explorer.737559856@tbird.cc.iastate.edu> explorer@iastate.edu (Michael Graff) writes:
>In <1t57ruINNn53@gap.caltech.edu> glt@cco.caltech.edu (Greg Tanaka) writes:
>>...  For instance, in my case it was 
>>simply matter of configuring a lpt port for my parallel port card at irq 7..
>>not I get absolutely no stray interrupts...  
>
>This almost makes sense now...  I just started getting them, my roomate does
>not get them at all.  I use lpa, the interruptless driver, he uses the regular
>one, the lpt driver.

You always got them, but previous versions of 386BSD did not report them,
to reduce the number of bug reports from nervous newbies :-).

You still get them, but the printer driver is too stupid to report them.
All interrupt glitches cause IRQ 7's, so any device driver that uses
IRQ 7 is reponsible for handling them.  The consequences of ignoring
interrupt glitches range from none to a hung system.  Obviously they
don't matter in most cases.

Interrupt glitches are special cases of "stray" interrupts.  Other stray
interrupts are "impossible" because they are masked.
-- 
Bruce Evans
-- END of QUOTE --