[comp.sys.ibm.pc] Help using the Serial Ports

kirkenda@jove.cs.pdx.edu (Steve Kirkendall) (04/29/89)

Greetings DOS wizards -- I need help.

I'm writing a communications program using the Microsoft C compiler.  I know
how to use the serial ports in UNIX, but with DOS I keep looking for features
and not finding them.  I'm sure somebody out there must have needed to do the
same kinds of things...

Specifically, I'm looking for advice, or references, or comments, or rumors,
or war stories, or (best of all) P.D. source code for any of the following:

 * An interrupt-driven Serial Port driver.  The MS-DOS Encyclopedia includes
   the source for one... has anybody tried typing it in and making it go?
   For my application, I will need 16K output buffers and 4K input buffers;
   is that an easy mod?  Does anybody know of something better?

 * How do I implement the UNIX sleep() library function?  I would prefer to
   NOT use delay loops, as I will probably be using my application under
   some multitasking variant of DOS.  Mustn't waste those CPU cycles, ya know.

 * How can I implement a read-with-timeout operation?  In UNIX I would just
   use signal(SIGALRM, myfunc) and alarm(timeout) before doing my read().
   What's the smart way to do this in DOS?

 * How do I detect an unexpected loss of carrier?  In UNIX I would use
   the SIGHUP signal.  Do I really have to keep polling a particular bit
   in a particular I/O port?   Say it ain't so!

If I've asked any stupid questions, please tell me why they're stupid.  If I
failed to ask some smart ones, please tell my what I missed.  I'm looking for
any info I can get.

If you can help me, please respond via email.  I'll be oh-so-grateful.
(If you can't help, well, thanks for reading the questions anyway.)

	-- Steve Kirkendall
	UUCP address: ...uunet!tektronix!psu-cs!kirkenda