🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #4829

Re: serial port BIOS

#4829
From: David Kessner
Date: Thu, 21 Feb 1991 18:56
50 lines
2685 bytes
In article <7154@dnlunx.pttrnl.nl> dondorp@dnlunx.pttrnl.nl (Dondorp E.) writes:
>I want to write a simple application that can read/write from
>COM1: (mouse) or COM4: (modem).

Hmmm.   For the most part, you should read the mouse via the mouse driver and
not the serial port.  The data you get at the serial port is not consistant
amung different brands of mice, and is non-existant with bus-mice.  The only
time you should read the serial port directly for mice data is when you are not
using MS-DOS at all (as is the case with UNIX, or MINIX, etc).

>However MS-DOS will open the file named "COMx:" but cannot read or
>write it.

That should work, you might try to use the MODE command to set the speed and
line settings of the COM port.  But, read on...

>Also when using direct BIOS calls, I still cannot use the serial
>ports.
>BtW the ports are functioning OK since both my mouse and my modem
>are in use.
>
>Now is there any reason why the serial ports cannot be accessed via
>BIOS (INT24)?
>(BtW I had all TSRs removed/not installed)
>
>If it's just the fault of my BIOS, is there any way that I can use
>the serial ports from my program in a reasonable machine independant
>way?
>
>	Erwin

The BIOS routines for serial I/O are brain dead.  The DOS functions are even
worse because they have their own way of doing things, and also call the BIOS.
It is all complicated by the speed of those routines, making 2400 baud barely
atainable.

The way EVERYONE accesses the serial ports is by their own ASSEMBLY langyage
routines.  I use Turbo C and Turbo Assembler, and have a set of serial routines
written in asm to be called from C.  If this is useful to anyone, just drop me
a line and I'll mail them you you (or post them here, they are quite small).  
The routines have been tested with a lot of hardware and are incompatable with 
some of the OLD hardware, but have had no problems with the newer things (newer
measning younger than 1985).  

					- David K

-- 
David Kessner - david@kessner.denver.co.us            | do {
1135 Fairfax, Denver CO  80220  (303) 377-1801 (p.m.) |    . . .
This is my system so I can say any damn thing I want! |    } while( jones);
Technical Details
Message-ID: <1991Feb21.185647.9432@kessner.denver.co.us>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!hellgate.utah.edu!csn!kessner!david
References: <7154@dnlunx.pttrnl.nl>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!hellgate.utah.edu!csn!kessner!david
From: david@kessner.denver.co.us (David Kessner)
Newsgroups: comp.os.msdos.programmer
Subject: Re: serial port BIOS
Keywords: serial port,BIOS
Message-ID: <1991Feb21.185647.9432@kessner.denver.co.us>
Date: 21 Feb 91 18:56:47 GMT
References: <7154@dnlunx.pttrnl.nl>
Reply-To: david@kessner.UUCP (David D. Kessner)
Organization: Kessner, Inc
Lines: 50