Article View: comp.os.linux.announce
Article #124Interrupt driven printer driver version 0.2
From: Nigel Gamble
Date: Wed, 27 Jan 1993 04:17
Date: Wed, 27 Jan 1993 04:17
88 lines
3611 bytes
3611 bytes
Version 0.2 of the interrupt driven parallel printer driver has been uploaded to tsx-11.mit.edu:/pub/linux/BETA/lp/lpirq.2.tar.Z It has been tested with Linux 0.99pl4. If you have been having problems with abormally slow printing, this driver should fix it. Please let me know if you download it, even if it works perfectly! Interrupt driven parallel printer driver, version 0.2 ----------------------------------------------------- Nigel Gamble, 24 Jan 1993. uunet!gamble!nigel gamble!nigel@uunet.uu.net 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 ========================= 0. You need to have linux 0.99pl4. 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 are two new ioctls: ioctl(fd, LPSETIRQ, irq); 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. ioctl(fd, LPGETIRQ); returns the current interrupt number, and lpcntl /dev/lp1 (without the second argument) will print the current interrupt number. Changes from version 0.1 ======================== 1. Error handling in the polled driver fixed (supplied by Michael K. Johnson). 2. Default IRQ 5 added for /dev/lp2. 3. ioctl command LPIRQ replaced by LPSETIRQ and LPGETIRQ. 4. lpcntl.c modified for new ioctl commands. -- Nigel Gamble gamble!nigel@uunet.UU.NET Ft. Lauderdale, FL uunet!gamble!nigel -- Send submissions for comp.os.linux.announce to: linux-announce@tc.cornell.edu
Technical Details
Message-ID:
<1993Jan27.041716.18901@tc.cornell.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!usenet.coe.montana.edu!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!malgudi.oar.net!caen!batcomputer!theory.TC.Cornell.EDU!mdwShow Full Headers
Complete Article Headers
Newsgroups: comp.os.linux.announce Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!usenet.coe.montana.edu!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!malgudi.oar.net!caen!batcomputer!theory.TC.Cornell.EDU!mdw From: gamble!nigel@uunet.UU.NET (Nigel Gamble) Subject: Interrupt driven printer driver version 0.2 Message-ID: <1993Jan27.041716.18901@tc.cornell.edu> Originator: mdw@theory.TC.Cornell.EDU Keywords: parallel printer driver interrupt Sender: news@tc.cornell.edu Nntp-Posting-Host: theory.tc.cornell.edu Organization: Nigel Gamble, Consultant Date: Wed, 27 Jan 1993 04:17:16 GMT Approved: linux-announce@tc.cornell.edu (Matt Welsh) Lines: 88