Xref: utzoo comp.sys.ibm.pc.misc:5108 alt.msdos.programmer:2328 comp.os.msdos.programmer:2602 Path: utzoo!utgpu!cs.utexas.edu!tut.cis.ohio-state.edu!ucsd!nosc!crash!lairdb From: lairdb@crash.cts.com (Laird Broadfield) Newsgroups: comp.sys.ibm.pc.misc,alt.msdos.programmer,comp.os.msdos.programmer Subject: Re: Writing my own print spooler Message-ID: <6617@crash.cts.com> Date: 31 Dec 90 00:53:50 GMT References: Organization: "Well, a head on top, an arm on each side, two legs...." Lines: 37 In steven@ozonebbs.UUCP (Steven Rubin) writes: >chas@tira.uchicago.edu (Charles Blair) writes: >> I've written my own int 5h handler. What I want to do is to make it >> act like a print spooler, so that I can let the application it is a >> part of get on with other work while stuff is printing -- this is a >> problem when I drive the printer in graphics mode. >> >> What's a good way to approach this problem? I've thought of installing >>... >I don't know if this is the "correct" way to do a spooler, but The way I do >it would be something like this >1) Capture int 1Ch. >2) Every clock tick, print x amount of characters from the file >3) return control to the other program. >I suppose there is some other stuff to keep in mind when doing something >like this, But basicly it is a very simple procedure. Hmmm. I've always got enough stuff tied to 1Ch that I'm a tad concerned about performance impact, so instead I tie to the IRQ7 interrupt (0fh). When it triggers, I check the busy line from the printer, stuff a character out if it's okay, expect the busy line to transition, and bail. This allows the printing to happen pretty much as fast as the printer can take it, without loading down the system (especially significant when you consider that 99+% of the time, you're not printing anything.) If you have 4 channels of 9600 baud commo going, as well as a user, responsiveness and load sensitivity are pretty important. There are a few tricks to it (proper EOI for the 8259, circular buffer mgmt., etc) but that's the outline. -- -- Laird P. Broadfield | Year after year, site after UUCP: {akgua, sdcsvax, nosc}!crash!lairdb | site, and I still can't think INET: lairdb@crash.cts.com | of a funny enough .sig.