home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.os.msdos.programmer:10595 comp.sys.ibm.pc.programmer:582
- Newsgroups: comp.os.msdos.programmer,comp.sys.ibm.pc.programmer
- Path: sparky!uunet!utcsri!skule.ecf!roscoe
- From: roscoe@ecf.toronto.edu (ROSCOE JAMES ANDREW)
- Subject: Re: H-E-L-P!! An interesting UART problem.
- Message-ID: <BxnxAA.Ft0@ecf.toronto.edu>
- Organization: University of Toronto, Engineering Computing Facility
- References: <1992Nov10.094131.9300@iccgcc.decnet.ab.com>
- Date: Fri, 13 Nov 1992 16:18:09 GMT
- Lines: 44
-
- In article <1992Nov10.094131.9300@iccgcc.decnet.ab.com> gardner@iccgcc.decnet.ab.com writes:
-
- >I'm writing a TSR that needs to redirect any bytes that
- >are written to COM2 for transmission to another "bucket."
- >
- >A vendor's program is running and writing bytes to COM2
- >for transmission. I want to have my TSR kicked whenever
- >the vendor's program sends a byte to COM2 for transmission
- >BUT I want to grab that byte and do some other work on
- >it... In fact, there will not be any external device
- >ever attached to COM2, so the byte won't actually ever
- >be transmitted and no external handshaking is going to
- >occur.
-
- So what you want to do is log everything that goes to com2. Judging from the
- other followups to your article, I get the feeling there's no way to tell when
- the UART has actually had a character sent to it.
-
- >What I have written are two isr's: One that is attached
- >to the COM2 hardware interrupt vector (0xb) and another
- >that is attached to the secondary clock software interrupt
- >vector (0x1c). The isr attached to COM2 is responsible
- >for grabbing the byte from COM2 and saving it in a queue.
- >The timer isr is responsible for taking a byte from the
- >queue and sending someplace else...
-
- The vendor program will very likely not call your handler after its own,
- since it would be almost against the rules of UART programming. You could
- probably then change the interrupt handler back to your own (or to the original
- DOS handler, if there even is one). The handler which the vendor program
- installed, then, could be called as a subroutine by your own timer tick handler
- so that you would have full control over what it things the "UART" (virtual,
- in this case) is telling it. You still might not be able to read the character
- being transmitted out of the port, but it's worth trying.
-
- You should have full control over everything at this point, and the only
- real problem I can think of would be the possibility of not being able to read
- the character from the comm port after it's been written. Best of luck to you!
- See ya.
-
- --
-
- James
- - roscoe@ecf.toronto.edu
-