Article View: comp.os.msdos.programmer
Article #5754Re: defeating time-out on com ports?
From: Roy M. Silvernail
Date: Sat, 13 Apr 1991 22:21
Date: Sat, 13 Apr 1991 22:21
30 lines
1898 bytes
1898 bytes
rrw@naucse.cse.nau.edu (Robert Wier) writes:
> The problem we are having (my students are currently using
> Quick-C) is that when you go out to read a character and there
> isn't one there yet, the port seems to "time out" in 1.5 seconds
> or so. I can't find any way to defeat this, although I certainly
> see why in most circumstances it would be useful.
Although you don't say specifically, it would seem that you are using
BIOS routines to read the comport. (perhaps bioscom()?) Put succinctly,
the BIOS comport handling smells real bad! :-)
I use an asynch package I snagged off the net recently. It's an ASM
package callable from C, written by David Kessner. There is no timeout
on a port... instead, it returns a NULL character when nothing is
available on the port.
> Does anyone know how to do this? Does it require going directly
> to the UART and bypassing the built in routines? Or is there
> something actualy in the hardware in the nature of a switch
> which has to be reset?
The ASM stuff goes right to the UART hardware. It's really the only way
to handle comports and Do The Right Thing. BIOS routines, when they work
at all, are only good at 300 bps, and barely work at 1200.
--
Roy M. Silvernail -- roy%cybrspc@cs.umn.edu - OR- cybrspc!roy@cs.umn.edu
perl -e '$x = 1/20; print "Just my \$$x! (adjusted for inflation)\n"'
[space reserved for clever quote]{mail your submissions}
Technical Details
Message-ID:
<905c12w164w@cybrspc>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!know!news.cs.indiana.edu!msi.umn.edu!cs.umn.edu!cybrspc!royReferences:
<3603@naucse.cse.nau.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!know!news.cs.indiana.edu!msi.umn.edu!cs.umn.edu!cybrspc!roy From: roy%cybrspc@cs.umn.edu (Roy M. Silvernail) Newsgroups: comp.os.msdos.programmer Subject: Re: defeating time-out on com ports? Message-ID: <905c12w164w@cybrspc> Date: 13 Apr 91 22:21:19 GMT References: <3603@naucse.cse.nau.edu> Organization: Villa CyberSpace, Minneapolis, MN Lines: 30