www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/08/17/01:02:45

From: "David Christensen" <dchristensen AT california DOT com>
Newsgroups: comp.os.msdos.djgpp,comp.lang.perl.misc
References: <37b4a540 AT news5 DOT newsfeeds DOT com>
Subject: Re: djgpp, Win98, Perl, and serial port
Date: Mon, 16 Aug 1999 19:34:56 -0700
Lines: 100
X-Newsreader: Microsoft Outlook Express 4.72.3110.1
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
NNTP-Posting-Host: 209.3.225.50
Message-ID: <37b8c7c4@news5.newsfeeds.com>
X-Trace: 16 Aug 1999 21:24:04 -0500, 209.3.225.50
X-Report: Report abuse to abuse AT newsfeeds DOT com
X-Abuse-Info: Please be sure to forward a copy of ALL headers, INCLUDING the body
X-Abuse-Info2: ALL Spam complaints are acted upon within 24 hours!
Organization: Newsfeeds.com http://www.newsfeeds.com 72,000+ UNCENSORED Newsgroups. Instant access!!
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

-----Original Message-----
From: Bbirthisel AT aol DOT com <Bbirthisel AT aol DOT com>
To: dchristensen AT california DOT com <dchristensen AT california DOT com>
Date: Monday, August 16, 1999 2:39 PM
Subject: Re: djgpp, Win98, Perl, and serial port

Hi David:

In a message dated 8/16/99 3:12:46 PM Central Daylight Time,
dchristensen AT california DOT com writes:

> >> This is my current attempt...
> >And it ... is doomed to failure on Win9x...
>
>  Hmmm.  Eli suggested that I look into serial I/O using DJGPP
first,

I'm not sure who Eli is. There are at least three sets of "serial
libraries" for DJGPP. I played with two of them at one time. I
think the gentleman in Japan tried all three and used the one I had
not used - but I'll have to look up the details.


>  then try to do it in Perl.  I also had the idea of writing test
patterns to the serial port from Perl and seeing what happens.

Writing patterns will "sort-of" work. The reliability is not high,
however. Reading is the problem.


>  OK that's what I thought.  My back-up plan has always been CPAN
first, ActivePerl second.

Unless you need to use cross-platform code. The 5.005 version is a
bit more portable to linux, et.al. The 5.004_02 version on CPAN was
a big leap forward for its time - but it is almost two years old.
And there is no chance of retrofitting the portability improvements
since then into that port.


>  He is constrained by the DOS (DPMI?) API, which I never
learned --

Two of the libraries for DJGPP handle this for you (mostly - you
could play with the template code if you really HAD to).


>  I always programmed to the standard C library when I was on DOS.
I did serial I/O once using MS Quick C several years ago, but
couldn't figure out my code the last time I looked at it (~6
months?).  I think I got the key bits from sample code in the MS
Mouse Programmer's Guide.  I remember there was one or more
bios-something calls, but I couldn't find decent documentation for
them or the DOS serial driver.  It was monkey see, monkey do.

The Win9x/NT serial driver has very little in common with the DOS/
Win3.x one. It is so much superior I have sometimes wondered if $MS
contracted it out to silence all the complaints about "the dog".


>  For this project, I ended up learning the Win32 API stuff and
writing a console utility to do blocking serial I/O with timeouts.

After experimenting for a while with "basic" DJGPP, I tried
RSXNTDJ. Sort of an OS2/DJGPP hybrid. It was much easier to create
loadable libraries (.DLL) with that setup. Then you could bypass
the console pass and keep the port open between calls.


>  My early development support apps were Win98 batch files calling
the console utility.  I then migrated the serial code into our
Borland C++ Builder production app.  The development need is back,
and I refuse to use batch files -- thus Perl.  But the console
utility is slow and the constant open/closing of the serial port
confuses everything on the RS-485 bus.

I'll believe THAT.


>  The clean Perl solution would be a DJGPP::SerialPort.  A
work-around might be a Win32 service with a (piped? socketed?)
console interface.

If someone were compiling  a DJGPP Perl, it would make sense to try
to compile in the Win32::API module. This allows making arbitrary
calls to the underlying Win32 libraries. With that, numerous useful
modules would become available. I haven't tried compiling Perl on
Win95 (recently - it used to be "impossible"- I'm not sure about
the current status). The other alternative is an XS implementation
if the DJGPP port would support it. There HAS been some work on an
XS version of Win32API::CommPort that does not require Win32::API -
but it's not even close to done, yet. And it would probably need a
$ponsor to speed it up since I have no pressing need for it.

-bill







  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----

- Raw text -


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