Article View: net.micro.pc
Article #5994Re: Printer-Code Interceptor
From: d.m.tutelman
Date: Thu, 20 Mar 1986 12:55
Date: Thu, 20 Mar 1986 12:55
46 lines
2940 bytes
2940 bytes
A classical daemon would be a process that runs concurrently,
an impossibility in MSDOS, an operating system with no real notion
of "process". However, there's a much simpler strategy that
may solve your problem.
The approach:
- All printer calls in a well-behaved DOS program eventually
call the printer BIOS routine (INT 17H).
- You can write a terminate-and-stay-resident program that,
when called, installs itself as the INT 17 handler.
- It would be called at boot time from the autoexec.bat file.
- It would be activated at its HANDLER entry point whenever
an application made a call to INT 17 (print a character).
- It would decide whether it has any graphics mapping to do.
If so, do it. Whether mapped or not, pass it on to the
real INT 17 handler, whose address you noted and saved
at installation. That will put it out to the printer.
The potential pitfalls:
- Not all programs are well-behaved in their use of the BIOS
(though I know of no specific offenders in the case of
printing; lots of them in the cases of diskette I/O, keyboard,
and especially screen). A program that has its own printer
handler built in and bypasses the BIOS won't get intercepted.
(But of course it wouldn't have been intercepted by a
REAL daemon in a REAL OS either.)
- Depending on how different the Toshiba graphics printing is
from the Epson, you may have to keep a lot of state information
around. I seriously doubt that the calls to your handler
will be one-to-one with actual characters printed, but it
may be much worse than that. For instance, the you may have to
construct several lines of pixels in a buffer, and put
them out in a batch.
I've used this approach in making a BIOS patch for a Hercules graphics
board, with success that can be gauged by the cautions I've noted.
Good luck, and please let us know what you do and how it works out.
---=== Dave Tutelman
-------===== Physical - AT&T Information Systems
----------====== Room 1H120
==--------======== Juniper Plaza, Route 9
====---========= Freehold, NJ 07728
============ Logical - ...ihnp4!mtuxo!mtuxt!dmt
====== Audible - (201)-577-4232
---------------------------------------------------------------
Technical Details
Message-ID:
<1739@mtgzz.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!mtuxo!mtgzz!dmtShow Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.PCS 1/10/84; site mtgzz.UUCP Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!mtuxo!mtgzz!dmt From: dmt@mtgzz.UUCP (d.m.tutelman) Newsgroups: net.micro.pc Subject: Re: Printer-Code Interceptor Message-ID: <1739@mtgzz.UUCP> Date: Thu, 20-Mar-86 07:55:58 EST Article-I.D.: mtgzz.1739 Posted: Thu Mar 20 07:55:58 1986 Date-Received: Sat, 22-Mar-86 04:18:30 EST Organization: AT&T Information Systems Labs, Middletown NJ Lines: 46 Keywords: daemon or some such thing To: ccastkw@gitpyr.UUCP In-reply-to: USENET article <1565@gitpyr.UUCP>