www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/04/16:10:57

Message-Id: <m0vrm5T-000S1iC@natacha.inti.edu.ar>
Comments: Authenticated sender is <salvador AT natacha DOT inti DOT edu DOT ar>
From: "Salvador Eduardo Tropea (SET)" <salvador AT natacha DOT inti DOT edu DOT ar>
Organization: INTI
To: G DOT Ohrner AT t-online DOT de
Date: Tue, 4 Feb 1997 17:54:20 +0000
MIME-Version: 1.0
Subject: Re: serial ports: library supported?
CC: djgpp AT delorie DOT com

> Bill Murphy wrote:
> > A friend of mine asked me to dig up information regarding rs232 (serial
> > or com port) use with dgjpp -- and though I dug (read the dgjpp faq,
> > stuff about capturing interupts, etc...) I just didn't see anything
> > appropriate.
> >         How can you set port parameters {baud, parity, etc}?
Depends on your needs, for low speed communications just use the int 14h as 
Gunter said, for high speed (19200 or more) the BIOS doesn't work, you can make 
2 things:
1) Get a library there are one for DJGPP, search in the v2tk and in the DJ 
server.
2) Get the manual of the 8250 UART and program the chip by yourself. (You'll be 
interested on the 16550 UART too because all the new motherboards use a clon of 
it).

> >         How can you send/recieve a character to/from a com port?
I don't understand you. The answer seems yo be trivial OF COURSE you can send a 
character. Are you asking if you must send bits?, if yes the answer is NO, you 
must send bytes.

> >         Will he need to catch the interupt, and look at some icky
> >           absolute memory location?
If he needs high speed he will need to catch the interrupt, even if he need low 
speed and needs to do something while waiting a char he will need interrupts. 
He doesn't need to look any "icky" absolute location when sending or receiving 
just an I/O port to know what's the origin of the interrupt. But again try a 
lib.

> >         Where can I find the hex location for common com1 com2 ports?
> >           IRQ numbers?
The ports are in the BIOS DATA AREA, take a look at the Ralf Brown Interrupt 
list or any BIOS reference. The BIOS detects the ports at startup and saves the 
values in the data area.

About the Gunter answers:
> You can access the serial port via the BIOS.
True but isn't good for high-speed as I said before.

> I don't know if DJGPP already has special functions but using int 14h
You can use the DOS using fprintf, etc but ... is worst than BIOS.

> you'll be able to access the com-port from any language.
> For details (int 14 interface description, etc) just send a mail to me.
> I only fear I cannot help you implementing the int calls in DJGPP for
> I'm a C newbie...
> I don't know how to call realmode interrupts from protected mode. (I
> think you'll have to use the DPMI)
Use __dpmi_int, even int86 could work.

SET 
--------------- 0 --------------------------------
Salvador Eduardo Tropea (SET).
Address: Curapaligue 2124, Caseros, 3 de Febrero
Buenos Aires, (1678), ARGENTINA
TE: +(541) 759 0013

- Raw text -


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