🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.linux.announce
Article #100

Interrupt driven printer driver uploaded

#100
From: Nigel Gamble
Date: Tue, 12 Jan 1993 06:36
61 lines
2799 bytes
I have uploaded lpirq.1.tar.Z to tsx-11.mit.edu.  It should be
available in the ALPHA directory.

I would appreciate feedback from anyone who installs it, both from
people who had the slowdown problem with the old driver, and from
those with fast laser printer who didn't.

Here is the README:

Interrupt driven parallel printer driver, version 0.1
-----------------------------------------------------
Nigel Gamble, 11 Jan 1993.

This new version of the Linux parallel printer driver makes use of the
interrupt hardware that is present on most of the I/O cards in use
on machines capable of running Linux.  It is much more efficient than
the existing driver (which uses over 20% cpu while printing a
ghostscript graphics file on my Epson compatible 9-pin dot-matix
printer).  It completely eliminates the problem of slow printing
previously seen with incorrect values of LP_INIT_CHAR; in fact,
LP_INIT_CHAR and LP_INIT_TIME are not used at all by the interrupt
driver.

Installation instructions
=========================

1.	Look at struct lp_struct lp_table in lp.h.  The first column
	is the base address of the printer port, the second is the
	interrupt number.  My board uses interrupt 7 for 0x378 (/dev/lp1).
	A zero in this column means the the old polling driver is
	used.  I expect that this configuration will be correct
	for most people with the standard `2 serial + 1 parallel'
	I/O card, but if it's not correct for you, change it.

2.	Copy lp.h to /usr/src/linux/include/linux (you may wish save
	the old lp.h as lp.h.OLD first).

3.	Copy lp.c to /usr/src/linux/kernel/chr_drv (you may wish save
	the old lp.c as lp.c.OLD first).

4.	Remake and reboot the kernel as usual.

There is a new ioctl,

	ioctl(fd, LPIRQ, irq);

which can be used to change the interrupt number used without recompiling
and rebooting.  The source of a simple program, lpcntl.c, is included
which calls the ioctl, so

	lpcntl /dev/lp1 0

can be used to switch to the polling driver, and

	lpcntl /dev/lp1 7

can be used to switch back to the interrupt driver using interrupt 7.

-- 
Nigel Gamble                                    gamble!nigel@uunet.UU.NET
Ft. Lauderdale, FL                              uunet!gamble!nigel
Technical Details
Message-ID: <1993Jan12.063621.21775@klaava.Helsinki.FI>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!news.funet.fi!hydra!klaava!wirzeniu

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.linux.announce,comp.os.linux
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!news.funet.fi!hydra!klaava!wirzeniu
From: gamble!nigel@uunet.UU.NET (Nigel Gamble)
Subject: Interrupt driven printer driver uploaded
Message-ID: <1993Jan12.063621.21775@klaava.Helsinki.FI>
Followup-To: comp.os.linux
Keywords: printer driver
Sender: wirzeniu@klaava.Helsinki.FI (Lars Wirzenius)
Organization: Nigel Gamble, Consultant
Date: Tue, 12 Jan 1993 06:36:21 GMT
Approved: linux-announce@tc.cornell.edu (Lars Wirzenius)
Lines: 61