delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/11/20/18:05:56

From: lm46 AT calva DOT net (Luc Mordacq)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: BCserio can't read from port
Date: Fri, 20 Nov 1998 22:57:17 GMT
Organization: PSINet France CalvaCom
Lines: 77
Message-ID: <365af3c6.2509720@news.calvacom.fr>
References: <72unqa$m48$1 AT kocrsv08 DOT delcoelect DOT com>
NNTP-Posting-Host: 154.15.17.64
Mime-Version: 1.0
X-Trace: guinness.serv.psi.calva.net 911602990 13081 154.15.17.64 (20 Nov 1998 23:03:10 GMT)
X-Complaints-To: usenet AT calvacom DOT fr
NNTP-Posting-Date: 20 Nov 1998 23:03:10 GMT
X-Newsreader: Forte Agent 1.5/32.452
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

The line 
>	comPort = sio_openport(com1, 3);
should be 
	comPort = sio_openport(com1, 4);
because IRQ4 is the IRQ for com1.

Howewer I download djgpp recently with BCserio but I did not manage to
have BCserio receive characters. I did not some testing with win95 and
drdos with CWSDPMI as DPMI manager and nothing works. I can send one
char as a time on the serial line but not receive. So I suppose that
the interrupt is not correctly linked.
Let me know if it work for yoou

Luc Mordacq
lm46 AT calva DOT net

>spost AT kocrsv01 DOT delcoelect DOT com (Scott E. Post) wrote:

>I need to write a small program to do some serial communications
>under Windows 95 (after 15 years using Unix exclusively).  I downloaded
>djgpp and Bill Currie's serio package (version 2.1).  I modified the
>test.c program that came with the package to simply hang in a loop 
>and read from com1.  I hooked up a serial device to continuously transmit
>characters to com1.  When I run the program the sio_charready command
>never returns that there are characters in the buffer.  Also, sio_getspeed
>returns what looks suspiciously like a bad number (327728).
>
>I tried removing com1 from the win95 settings and that didn't help.  This
>is on an IBM Thinkpad in a docking station.  I can read from the serial
>port using bios calls that come with another (proprietary) compiler, so
>I know there is data getting to the serial port.
>
>Attached is the code.  Any ideas?
>
>--
>Scott Post    spost AT koptss03 DOT delcoelect DOT com
>
>--------------------------------------------------------------------------
>#include <stdio.h>
>#include <pc.h>
>#include <keys.h>
>#include <dpmi.h>
>#include "serio.h"
>
>#define b2400        48
>#define com1         0x3f8
>
>int main()
>{
>	int done=0,c;
>	SioPort *comPort;
>
>	/* Required by BCSerio */
>	extern char sltext[] asm ("sltext");
>	extern char eltext[] asm ("eltext");
>	extern char sldata[] asm ("sldata");
>	extern char eldata[] asm ("eldata");
>	_go32_dpmi_lock_code(sltext,eltext-sltext);
>	_go32_dpmi_lock_data(sldata,eldata-sldata);
>
>	comPort = sio_openport(com1, 3);
>	sio_setparms(comPort, sio8Bits, sioNoParity, sio1StopBit);
>	sio_setspeed(comPort, b2400);
>	do {
>	   if (sio_charready(comPort)) {
>		c = sio_get(comPort);
>		printf("%02X ",c);
>		fflush(stdout);
>	   }
>	} while (!done);
>
>	printf("Closing COM port...\n");
>	sio_closeport(comPort);
>	printf("Exiting...\n");
>	return(0);
>}

- Raw text -


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