[alt.msdos.programmer] Switching COM: Ports

jzitt@dasys1.UUCP (Joe Zitt) (05/08/89)

Is there a way to fake out a PC into talking to a different COM port?
 
Here's the situation: I have what looks like a really neat Unix Mail clone.
Unfortunately, the code is hard-wired to use COM1:. Since my )!(@*#&$^% MIDI
board is also hard-wired to COM1:, I had to put my modem on COM2:.
 
Is there a way to get the software to talk to the other port, either through
a small resident or something else?

-- 
Joe Zitt     *      {sun!hoptoad,cmcl2}!dasys1!jzitt     *     Big Electric Cat 
PAM Repertory Company	    also: (killer,uunet,psuvax}!cbis3!elephant!zitt!joe
imagine the clouds dripping. dig a hole in your garden to put them in. yoko '83

nelson@sun.soe.clarkson.edu (Russ Nelson) (05/09/89)

In article <9593@dasys1.UUCP> jzitt@dasys1.UUCP (Joe Zitt) writes:

   Is there a way to fake out a PC into talking to a different COM port?

Yes and no.  Due to the lack of of interrupt driven COM port service
in the BIOS, everyone directly accesses the 8250.  So the only way to
do what you want is to patch your program to use the different COM port.
This can be non-trivial.
--
--russ (nelson@clutx [.bitnet | .clarkson.edu])
I'm a right-to-lifer -- everyone has a right to earn a living sufficient to
feed himself and his family.

posert@bonnie.ics.uci.edu (Bob Posert) (05/09/89)

In article <9593@dasys1.UUCP> jzitt@dasys1.UUCP (Joe Zitt) writes:
>
>   Is there a way to fake out a PC into talking to a different COM port?
>

Part of the Baker's dozen utility set is a program called swcom12.com.  I
haven't tried it, but the documentation is:

    } SWCOM12.COM
    } -----------
    } Switch RS-232 ports for COM1 and COM2.  No parameters.
    } 
    } To start:
    } C>swcom12

I'd post, but the package has to be distributed as a whole.  
Bakers Dozen is shareware, so you might be able to find it on a
local bbs, or you can contact the author(?)/distributor directly at:

                    Jim Button                      
                  P.O.  Box 5786                   
                Bellevue, WA 98006                   
                  1-800-JBUTTON.                          

--
Bob Posert
I'm: posert@bonnie.ics.uci.edu or {sdcsvax|ucbvax}!ucivax!bonnie!posert 

tkopp@carroll1.UUCP (Tom Kopp) (05/09/89)

In article <9593@dasys1.UUCP> jzitt@dasys1.UUCP (Joe Zitt) asks: 
>Is there a way to fake out a PC into talking to a different COM port?

The dos assign command should work.  I've seen it used to tell something to
send to COM1 everything that was supposed to go to lpt: so your mileage may
vary.

Basically, before you are going to use the modem, enter the following line:

assign com1 = com2

If this doesn't work, reverse the com1 and com2.  I haven't used the command
for a long time, so....


-- 
tkopp@carroll1.cc.edu  or  uunet!marque!carroll1!tkopp
Thomas J. Kopp @ Carroll College 3B2 - Waukesha, WI

aiko@cs.odu.edu (John K Hayes) (05/09/89)

In article <412@carroll1.UUCP> tkopp@carroll1.UUCP (Tom Kopp) writes:
>In article <9593@dasys1.UUCP> jzitt@dasys1.UUCP (Joe Zitt) asks: 
>>Is there a way to fake out a PC into talking to a different COM port?
>
>The dos assign command should work.  I've seen it used to tell something to
>send to COM1 everything that was supposed to go to lpt: so your mileage may
>vary.
>
>Basically, before you are going to use the modem, enter the following line:
>
>assign com1 = com2
>
>If this doesn't work, reverse the com1 and com2.  I haven't used the command
>for a long time, so....
>
>
>-- 
>tkopp@carroll1.cc.edu  or  uunet!marque!carroll1!tkopp
>Thomas J. Kopp @ Carroll College 3B2 - Waukesha, WI




I was having the same problem with a Zenith 248 that came with a funky 
adaptor that plugged into one of the bigger ports on back and had two ports
on the other side of it - I forget the specifics, but the effect was that
with the adaptor, the modem could not be plugged into COM1 but only COM2
which was on the back of the adaptor.

Anyway, I tried the DOS assign command and I believe that command is only
useful for assigning a COM port to an LPT port and possibly vice versa.  It
did not work assigning one COM port to another COM port.

I ended up yanking the stupid adaptor off of there.

-- 
    ---{john hayes}  Old Dominion University; Norfolk, Virginia USA
                     internet: aiko@cs.odu.edu
                     Home: (804) 622-8348     Work: (804) 460-2241 ext 134  

                      <++++++++++++++++++++++++++++++++++>
Are you a Have or a Have_Not?  Because if you're a Have_Not, you've probably
had it; whereas, if you're a Have, you've probably got it and are going to 
give it away at some point in the future!       --- The Clash
                      <++++++++++++++++++++++++++++++++++>

hollen@eta.megatek.uucp (Dion Hollenbeck) (05/10/89)

From article <412@carroll1.UUCP>, by tkopp@carroll1.UUCP (Tom Kopp):
> In article <9593@dasys1.UUCP> jzitt@dasys1.UUCP (Joe Zitt) asks: 
>>Is there a way to fake out a PC into talking to a different COM port?
> 
> assign com1 = com2
> If this doesn't work, reverse the com1 and com2.  I haven't used the command
> for a long time, so....


Yes, this will work, but only with programs which ask DOS to provide COM
service.  The majority of programs talk directly to the UART and this
would be of no use with those programs.






	Dion Hollenbeck             (619) 455-5590 x2814
	Megatek Corporation, 9645 Scranton Road, San Diego, CA  92121

                                seismo!s3sun!megatek!hollen
                                ames!scubed/

network@mstr.hgc.edu (craig chaiken) (05/10/89)

In article <412@carroll1.UUCP>, tkopp@carroll1.UUCP (Tom Kopp) writes:
> In article <9593@dasys1.UUCP> jzitt@dasys1.UUCP (Joe Zitt) asks: 
> >Is there a way to fake out a PC into talking to a different COM port?
> Basically, before you are going to use the modem, enter the following line:
> assign com1 = com2

MSDOS's ASSIGN command reassigns block devices (disk drives), not character
devices such as COM1.  Use the command MODE COM1=COM2 to make COM1 be COM2.
You can also achieve this effect by copying the word at address 0000:402 to
0000:400.

Craig Chaiken
Hartford Graduate Center
Computing Services
network@mstr.hgc.edu

rayd@laidbak.UUCP (Ray Dueland) (05/10/89)

You could change the binary.  Load the program with debug and search for
all occurrances of the IN and OUT instructions.  Change the ones that
operate on the COM1 addresses (3f8?) to operate on the COM2 addresses.
The only other thing I can think of that would need to be done is to
change where the interrupt vector gets loaded.

--
Ray Dueland
{amdahl|clout|masscomp|nucsrl|sun|tellab5}!laidbak!rayd

tj@gpu.utcs.utoronto.ca (Terry Jones) (05/10/89)

Even programs that go directly to hardware may work with the "switched"
com ports. There is an area in memory that stores the hardware addresses
of installed ports (40:0) and software that actually looks there to find the
address of com1 or 2 should switch properly. In this guy's case maybe he
will get lucky in that ONE and ONLY ONE of the programs he wants to use
with com1 will look at the address to find where the hardware is and go there
and if they are switched then it will access com2, now if the other program just
goes to hardware at com1 address then they will behave!

tj

cb@cci632.UUCP (Just another hired gun (n2hkd)) (05/11/89)

In article <412@carroll1.UUCP> tkopp@carroll1.UUCP (Tom Kopp) writes:
.In article <9593@dasys1.UUCP> jzitt@dasys1.UUCP (Joe Zitt) asks: 
.>Is there a way to fake out a PC into talking to a different COM port?
.
.The dos assign command should work.  I've seen it used to tell something to
.send to COM1 everything that was supposed to go to lpt: so your mileage may
.vary.
.
.Basically, before you are going to use the modem, enter the following line:
.
.assign com1 = com2
^^^^^^^^^^^^^^^^^^^^
	Gee that's what I thought, however they gone and changed this
	again. According to my Compaq 3.2 manual, they assign command
	is only available for a "specific drive" to a "different drive".
	The Mode command can reassign, but only the printer ports!!

	Looks like they decided that we don't need that feature anymore...
-- 
 my signature file just got squashed......................
email:   cb@cci632     or    !rochester!kodak!n2hkd!curtis  
Curtis Braun, Computronics, PO Box 1002 Fairport NY, 14450  

gordon@eecea.eece.ksu.edu (Dwight Gordon) (05/11/89)

In article <1989May10.111641.8831@gpu.utcs.utoronto.ca> tj@gpu.utcs.UUCP (Terry Jones) writes:
>Even programs that go directly to hardware may work with the "switched"
>com ports. There is an area in memory that stores the hardware addresses
>of installed ports (40:0) and software that actually looks there to find the
>address of com1 or 2 should switch properly. . . .

  The problem comes if your software uses interrupts.  Normally COM1 is
hard-wired to INT4 and COM2 is hard-wired to INT3.  Swapping the pointers
will fool the bios into believing that the hardware COM1 is really COM2
and visa-versa, however the interrupts will remain the other way around.
This will cause any (well, almost any :-) software to be confused.  
Theoretically, the software could look for standard port assignments, and
make some assumptions if they are not so, but this is a lot to expect of
any programmer :-) (no flames please, I program too!).

Dwight W. Gordon         |   913-532-5600    |   gordon@eecea.eece.ksu.edu
Electrical & Computer Engineering Department |     dwgordon@ksuvm.bitnet
Kansas State University - Durland Hall       | rutgers!ksuvax1!eecea!gordon
Manhattan, KS 66506      | {pyramid,ucsd}!ncr-sd!ncrwic!ksuvax1!eecea!gordon

donp@bucket.UUCP (Don Park) (05/12/89)

>
>   Is there a way to fake out a PC into talking to a different COM port?
>

One way would be to use BNUCOM - a Level 5 compatible F.O.S.S.I.L.
driver. It comes with a utility to change BNU's com addresses to
effectively use different ports without changing the program.
(Assuming this program uses a fossil driver)
Hope this helps,
Don
-- 
+-------------   Bark Technologies - Don Park - Bryan Bybee ------------------+
: BBS (503)-257-3666 - VOICE (503)-246-0025 - (503)-256-2195 - Bark Tech.  /\ :
: Hardware - Software - IBM - TANDY COLOR COMPUTER - Support - Tech. Line  \/ :
+----------------- ...!tektronix!teksce!bucket!donp --------------------------+