🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.sun
Article #13353

HP LJ Series II

#13353
From: Dan Mick
Date: Thu, 21 Dec 1989 06:42
53 lines
2350 bytes
I'm trying to get an HP LJ II hooked up to my 3/50, and I'm having the
devil's own time getting it to work.  

After a bit of experimentation, I got the file laserjet-printcap.Z from a
very old comp.misc article, but that goes molasses-slow, as it calls
select(0,0,0,0,<1500 usec timeout>) between *each character*.  It's really
horrid, but if I remove the calls, the LJ loses data in ways I can't
understand.  I've managed, at least, to turn the timeout down to 200 us,
but I'm still not happy with the performance.

Also, I really don't understand the two filters given (one raw, one
sorta-formatted) or all of the printcap entries, particularly in the way
some tty flags are set from the printcap entry and some from the filters.
I can't get any log messages from lpd, either. 

Does anyone have any good results with a LaserJet under any BSD, and/or
SunOS 3.2, and/or can you explain the printcaps and filter stuff below?

lp|lz|laserjet|Hewlett-Packard Laserjet:\
	:lp=/dev/ttyb:sd=/usr/spool/lpd:br#9600:pw#132:pl#60:\
	:xs#060:fc#0177477:\   <- this stuff in particular
        lf=/usr/adm/lpd-errs:\
	:of=/usr/local/bin/hpf:vf=/usr/local/bin/lzcat:rs:


An extract from lzcat.c...hpf.c does the same initialization.  My
questions are in the ??? comments.

#include <sgtty.h> 

lzinit()
{
    struct sgttyb nbuf;
    unsigned long lbits;

    setbuf(stdout, NULL);


    /* ??? Okay, maybe there aren't local bit masks in some BSD printcaps..*/

    /* Work around to by-pass bug in terminal driver and force LITOUT */
    lbits = LMDMBUF|LLITOUT;
    ioctl(fileno(stdout), TIOCLSET, &lbits);


    /* ??? but do this stuff twice? */

    ioctl(fileno(stdout), TIOCGETP, &nbuf);
    nbuf.sg_flags &= ~(ECHO|XTABS|CRMOD);  /* While we're at it, set the mode */
    ioctl(fileno(stdout), TIOCSETP, &nbuf);

    fputs("\033&k3G", stdout);	/* Set device to sane mode	*/
}
Technical Details
Message-ID: <4032@brazos.Rice.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!rice!sun-spots-request

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!rice!sun-spots-request
From: charyb!dan@uunet.uu.net (Dan Mick)
Newsgroups: comp.sys.sun
Subject: HP LJ Series II
Keywords: Miscellaneous
Message-ID: <4032@brazos.Rice.edu>
Date: 21 Dec 89 06:42:19 GMT
Sender: root@rice.edu
Organization: Sun-Spots
Lines: 53
Approved: Sun-Spots@rice.edu
X-Sun-Spots-Digest: Volume 8, Issue 230, message 5 of 13