Xref: utzoo comp.sys.ibm.pc.misc:5105 alt.msdos.programmer:2327 comp.os.msdos.programmer:2600 Path: utzoo!utgpu!cs.utexas.edu!news-server.csri.toronto.edu!helios.physics.utoronto.ca!ists!yunexus!xrtll!silver From: silver@xrtll.uucp (Hi Ho Silver) Newsgroups: comp.sys.ibm.pc.misc,alt.msdos.programmer,comp.os.msdos.programmer Subject: Re: Writing my own print spooler Message-ID: <1990Dec30.160422.27898@xrtll.uucp> Date: 30 Dec 90 16:04:22 GMT References: Reply-To: silver@xrtll.UUCP (Hi Ho Silver) Organization: Not around here, pal! Lines: 36 In article steven@ozonebbs.UUCP (Steven Rubin) writes: $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. Well, there isn't a "right" way and a "wrong" way; there are ways which don't work, and there are ways which do work with varying degrees of efficiency. Yours would work, though it would tend to slow down the program in the foreground once the printer's buffer filled up. Also, you would have to put in some code so that when it receives an int 1Ch, it would check to see if it was still processing from the last interrupt (this is possible if your number of characters is too large, if the printer is slow, or if the printer is off-line, for example). For a program which wakes up every clock tick, you used the correct interrupt; it's not wise to add code into the int 8h routine; int 1Ch is provided instead. A more efficient, though slightly more difficult, way might be to set up the printer port to interrupt the CPU whenever it's ready for another character. If the base I/O address of your printer port is printer_base, then bit 4 of the I/O register at printer_base+2 controls this. If set, the printer port will generate an interrupt 0Fh whenever the ACK line from the printer does a high-to-low transition. This happens just before the BUSY line returns to 0, and signals that you should go grab another byte because the printer is almost ready for it. The original poster referred to capturing int 5h. This is the print screen interrupt, not the BIOS printer output interrupt, so a print spooler on int 5h would only spool screen prints. Any other output would not be captured. Int 17h is the printer output interrupt. -- __ __ _ | ...!nexus.yorku.edu!xrtll!silver | always (__ | | | | |_ |_) >----------------------------------< searching __) | |_ \/ |__ | \ | if you don't like my posts, type | for _____________________/ find / -print|xargs cat|compress | SNTF