[comp.sys.ibm.pc] Activating COM3 and COM4

lal@tc.fluke.COM (Larry Lohkamp) (05/02/89)

I have an I/O problem. I have an HP plotter, a micom line, an internal
modem, and a CTX port. I have been playing human switch box because my
IDS-286T came with 2 serial ports. I thought that I had a port for
everything when I instaled an AST premium memory board. The AST board
came with two ports at COM1: and COM2:. My serial board says that its
two ports can be used as COM1, 2, 3, or 4. I tried all possible 
combinations of assigning the two interrupts ( #3 and #4 ), but could not
get the machine to recognise anything but COM1 & 2. If it makes any
difference, my DOS rev. is 3.3. Can I get all 4 ports to work, or am I
dreaming the impossible?

mbb@cbnewsh.ATT.COM (martin.b.brilliant) (05/03/89)

From article <8036@fluke.COM>, by lal@tc.fluke.COM (Larry Lohkamp):
> ..... The AST board
> came with two ports at COM1: and COM2:. My serial board says that its
> two ports can be used as COM1, 2, 3, or 4. I tried all possible 
> combinations of assigning the two interrupts ( #3 and #4 ), but could not
> get the machine to recognise anything but COM1 & 2. If it makes any
> difference, my DOS rev. is 3.3. Can I get all 4 ports to work, or am I
> dreaming the impossible?

I had a similiar problem with an internal modem.  The modem is supposed
to be configurable as any of the four COMn: ports.  The documentation
for DOS 3.3 says that DOS recognizes four COMn: ports.  However, the
documentation for the modem points out that the DOS definition of COM3:
and COM4: is not the one used by older communications software, and
that the board is compatible with the old software, not with DOS.

Some of this "older communications software" is explicit about how
COM3: and COM4: are defined in terms of port address and IRQ line. 
However, I couldn't find anything that says how DOS defines these
ports.  Can someone provide definitive information about this?

M. B. Brilliant					Marty
AT&T-BL HO 3D-520	(201) 949-1858
Holmdel, NJ 07733	att!hounx!marty1 or marty1@hounx.ATT.COM

Disclaimer: Opinions stated herein are mine unless and until my employer
	    explicitly claims them; then I lose all rights to them.

kirk%enterprise@Sun.COM ('Captain' Kirk DeHaan) (05/03/89)

From article <8036@fluke.COM>, by lal@tc.fluke.COM (Larry Lohkamp):
> I have an I/O problem. I have an HP plotter, a micom line, an internal
> modem, and a CTX port. I have been playing human switch box because my
> IDS-286T came with 2 serial ports. I thought that I had a port for
> everything when I instaled an AST premium memory board. The AST board
> came with two ports at COM1: and COM2:. My serial board says that its
> two ports can be used as COM1, 2, 3, or 4. I tried all possible 
> combinations of assigning the two interrupts ( #3 and #4 ), but could not
> get the machine to recognise anything but COM1 & 2. If it makes any
> difference, my DOS rev. is 3.3. Can I get all 4 ports to work, or am I
> dreaming the impossible?

Look for a program called com3&4. It installs the drivers for 3 + 4
so they are accessible.  


********************************************************************
* 'Captain' Kirk DeHaan			"There's a lot to be said  *
*  Sun Microsystems Inc.		  For a blow to the head"  *
*								   *
*  kirk@sun.com				      Blue Oyster Cult     *
*								   *
********************************************************************

foss@iris.ucdavis.edu (Jim Alves-Foss) (05/03/89)

In article <8036@fluke.COM> lal@tc.fluke.COM (Larry Lohkamp) writes:
>difference, my DOS rev. is 3.3. Can I get all 4 ports to work, or am I
>dreaming the impossible?

I have an internal modem using port 3 and DOS 3.3
What I did to let the modem work was write a simple little program to do the
following:

1. Change DOS equipment register to state I have 3 serial ports
2. Place the Port Base Address into the DOS table for serial ports - room 
   exists for at least 7 (maybe 8).

I wrote the code in BASIC - less than 5 lines, compiled it and have my
autoexec.bat file automatically run it when I boot.

Unfortunately I do not have the code here. I'll try to remember to post it
tonight.  

-Jim Alves-Foss

foss@iris.ucdavis.edu (Jim Alves-Foss) (05/04/89)

In article <4160@ucdavis.ucdavis.edu> foss@iris.ucdavis.edu (Jim Alves-Foss) writes:
>In article <8036@fluke.COM> lal@tc.fluke.COM (Larry Lohkamp) writes:
>>difference, my DOS rev. is 3.3. Can I get all 4 ports to work, or am I
>>dreaming the impossible?
>
>I have an internal modem using port 3 and DOS 3.3
>What I did to let the modem work was write a simple little program to do the
>following:
>
>1. Change DOS equipment register to state I have 3 serial ports
>2. Place the Port Base Address into the DOS table for serial ports - room 
>   exists for at least 7 (maybe 8).
>
>I wrote the code in BASIC - less than 5 lines, compiled it and have my
>autoexec.bat file automatically run it when I boot.
>
>Unfortunately I do not have the code here. I'll try to remember to post it
>tonight.  
>
>-Jim Alves-Foss
Here it is. Just remember to run "rs232off" before and after any programs
that misbehave when using com 3 or 4. (such as Procomm).

------------------------ Cut here for "addcom.bas" --------------------
REM The code was written by Jim Alves-Foss   Feb. 1988. It is released 
REM into the public domain by the author. -Enjoy-
REM This is for Microsoft Quick Basic but the concept is easy to adopt 
REM for other languages.
REM Place this executable in your autoexec.
REM Set segment to zero

10 DEF SEG = 0

REM At 400H we store the com port address information, 2 bytes gives each
REM  port address. Here we store 3E8 as base for COM 3: (com 4: base 2E8)

20 POKE 1028, 232: POKE 1029, 3

REM Now need to set the port information at 411H.

30 a = PEEK(1041)

REM Got old equipment information. Now, zero out bits 1,2,3 (numbered 0..7)
REM These hold the number of serial ports (0-7). Set this value to 3.
REM Restore old information with number of ports = 3

40 POKE 1041, (a AND 241) OR 6

REM Resturn to DOS

50 SYSTEM
----------------------- End Code -- see it was REAL short -------------
-Jim Alves-Foss

liber@darth.UUCP (Eric Liber) (05/04/89)

In article <8036@fluke.COM>, lal@tc.fluke.COM (Larry Lohkamp) writes:
> I have an I/O problem. I have an HP plotter, a micom line, an internal
> modem, and a CTX port. I have been playing human switch box because my
.
.
.
> get the machine to recognise anything but COM1 & 2. If it makes any
> difference, my DOS rev. is 3.3. Can I get all 4 ports to work, or am I
> dreaming the impossible?

Well I screwed up slightly in my last response but I found out last night
how simple it can really be.  You must plug the RS232 table AND the equipment
word to tell the system HOW MANY RS232 PORTS THERE ARE.  After you do this 
mode will work fine.  Here is a turbo Pascal (5.0) program that will do the
deed for com3 at 3E8:

program setcom3;

var
   rs232com3 : word absolute $0040:$0004;
   equipword : word absolute $0040:$0010;

begin
    rs232com3 := $03E8;
    equipword := equipword or $0200;
end.

thats all there is to it.  the equipment word at 40:10 and 40:11 (hex) 
has bits 9 - 11 set to indicate the number of com (rs232) ports in the 
system $0200 turns on bit 9 which changes the value to 3 from the startup
value of 2 (xxxx 010x xxxx xxxx) changed to (xxxx 011x xxxx xxxx).

All you have to do is include the command setcom3 in your start up batch and 
then you can initialize the port with a mode command such as:

MODE COM3:9600,N,8,1,P

The P was necessary in my system to keep the port from timing out too soon.

Anyway all this works on a gateway 386 using phoenix bios 3.??? and msdos 3.3.

If you have any more questions I will attempt to answer them.

good luck
Eric (the red baron) Liber

sbanner1@uvicctr.UVic.ca.UUCP (S. John Banner) (05/04/89)

In article <372@cbnewsh.ATT.COM> by mbb@cbnewsh.ATT.COM (martin.b.brilliant) writes:
>From article <8036@fluke.COM>, by lal@tc.fluke.COM (Larry Lohkamp):
>> ..... The AST board
>> came with two ports at COM1: and COM2:. My serial board says that its
>> two ports can be used as COM1, 2, 3, or 4. I tried all possible 
>> combinations of assigning the two interrupts ( #3 and #4 ), but could not
>> get the machine to recognise anything but COM1 & 2. If it makes any
>> difference, my DOS rev. is 3.3. Can I get all 4 ports to work, or am I
>> dreaming the impossible?
>Some of this "older communications software" is explicit about how
>COM3: and COM4: are defined in terms of port address and IRQ line. 
>However, I couldn't find anything that says how DOS defines these
>ports.  Can someone provide definitive information about this?

I have recently come across this problem (in a slightly different
form), and found the solution.  The base address of the first four
com ports are stored in the first four words of the BIOS information
area (0040:0000 to 0040:0008).  You only need one word for each, as
this stores the first port address, which are all at most 16 bits.
Once you have set these addresses right, then you need to find the
equipment information byte (I don't remember the address for that
one, but it is well documented), and fix it, so that it says you have
the right number of serial ports.  You can do the same thing with
parallel ports (there are three words for parallel ports right after
the four words for serial ports).  Then all you have to do, is get
the interupts set right, and you are in business.  Unfortunately,
there is no standard on how to find the right interupt.  As I recall,
the older machines used IRQ2, IRQ3, IRQ2, IRQ3, while I believe that
IBM decided to use IRQ2, IRQ3, IRQ3, IRQ3, in the PS/2 line... most
of the intelegent software, will try the various possibilities, and
see which one works.  Anyhow, it is basicly just a matter of installing
the board, setting the various pieces in the BIOS area, and it should
work...  At least it did for me...  :-).

			  sjb.

simon@ms.uky.edu (G. Simon Gales) (05/10/89)

DOS keeps the port address table at 40:0, there should be a port 
address for each COM port (1-4).

0040:0000 Port address of COM1
0040:0002   "     "    "  COM2
0040:0004   "     "    "  COM3
0040:0006   "     "    "  COM4

This is also documented in the MS-Kermit manual, which includes a 
short COM prg (type it in in DEBUG) that does this for you.  The
actual port addresses depend on the serial card(s).

-- 
/------------------------------------------------------------------------\
  Simon Gales@University of Ky
  {rutgers, uunet}!ukma!simon  -  simon@ms.uky.edu  -  simon@UKMA.BITNET