🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #4491

Re: Sharing the serial device

#4491
From: Larry Phillips
Date: Fri, 20 Jul 1990 21:10
46 lines
2800 bytes
In <31946@cup.portal.com>, Thyss@cup.portal.com (Brian TT Fudge) writes:
>Recently I was fooling around with the serial device and found that there
>was almost no use for sharing the serial device.  Is it just me, or do others
>have problems when they try it too?

Well, there's plenty of use for sharing the serial port. I don't have problems
sharing it, except for some ill-mannered terminal programs that open it in
EXCLUSIVE mode.

>I open 2 ports and 2 devices.  One to read from and one to write to.  Every-
>thing works fine.  I runback the program and then runback another one.  I
>loose every other character.  One program gets one character and the other
>the next. 

That's because there are READs outstanding from both programs. Sharing means
that a READ will be satisfied by the program currently holding it, and that any
other programs that want to READ will have to take their place in line. I can
remember starting up about 6 or 7 ATerms once, and watching the characters go
'round-robin' in the windows. Quite useless, but funny to watch. If you want to
share the port, you will have to ensure that any programs that are not using
it, do not have any outstanding READ commands pending. WRITE commands are less
of a problem.

>When I quit the program (close both devices and both ports), the TR (terminal
>ready) light on my modem goes off, meaning the serial device was closed.  I
>don't think that should happen since I should have 4 serial devices open, and
>closing 2 of them shouldn't close all 4.

That doesn't happen to me, because I don't use all 7 wires in my cables. I have
only three wires hooked up (TxD, RxD, and GND). I can exit any terminal program
and simply start another one. I have never bothered trying to find out what the
behaviour is under 7 wire operation, so I can't offer much advice there. Yes,
the port should not drop DTR while ANY programs have the device open.

I posted SerMod as part of ROBBS some time ago. It shows how the serial port
can be shared for both transmit and receive.

-larry

--
Sex is better than logic, but I can't prove it.
+-----------------------------------------------------------------------+ 
|   //   Larry Phillips                                                 |
| \X/    lphillips@lpami.wimsey.bc.ca -or- uunet!van-bc!lpami!lphillips |
|        COMPUSERVE: 76703,4322  -or-  76703.4322@compuserve.com        |
+-----------------------------------------------------------------------+
Technical Details
Message-ID: <1807@lpami.wimsey.bc.ca>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!van-bc!

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!van-bc!
From: lphillips@lpami.wimsey.bc.ca (Larry Phillips)
Newsgroups: comp.sys.amiga.tech
Subject: Re: Sharing the serial device
Message-ID: <1807@lpami.wimsey.bc.ca>
Date: 20 Jul 90 21:10:41 GMT
Lines: 46
Return-Path: <lpami!lphillips>
To: van-bc!rnews