delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/12/06/19:15:05

From: Felaco <bcf AT ssd DOT ray DOT com>
Date: Wed, 6 Dec 1995 17:53:46 -0500
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Serial port code.

I am attempting to port a serial comm program I recently wrote from Microsoft
C/C++ 7.00 (bleah!) to djgpp.  (this is my first experience with low-level DOS
programming, so I am no expert).  I am doing this for 2 reasons:

1) I can't get MSC to run on this 4 meg laptop I want to use to compile.
2) I am hoping protected mode program will service interrupts faster and not
   drop chars at 38400 bps, as the real mode program is doing.
3) For the hell of it.

I am beginning to think I am wasting my time.  First of all, I have wrestled with
the problem of accessing conventional memory and have succeeded in getting the 
BIOS comm port address after struggling with the segment/offset concept yet 
again (whenever I have it figured out, I forget it before the next time I have to
think about it).  I know that the comm port address I am using is valid, but the
program crashes with a segmentation fault when I do an outportb to the serial 
port.  (I used gdb to find where the faulty source line was)

Secondly, even if I get this to work, are my premises for doing this valid?  The
program is almost constantly waiting for input from the user, therefore mostly
running in real mode.  So now I am just adding the overhead of switching to 
protected mode for each interrupt.  Doesn't sound like an improvement.  Also,
what are my chances of compiling in a reasonable amount of time on a 486/33+
laptop with 4Mb RAM?  I guess I am just doing this for the hell of it.

I know various people are attempting to write serial packages for V2 but I am
using 112m2 (I am about to jump up to m4).

Any thoughts?

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019