Mail Archives: djgpp/1997/08/28/16:43:59
From: | Thomas Demmer <demmer AT LSTM DOT Ruhr-UNI-Bochum DOT De>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Re: COM-Schnittstelle mit Streams ansprechen ?
|
Date: | Thu, 28 Aug 1997 13:48:11 +0200
|
Organization: | Lehrstuhl fuer Stroemungsmechanik
|
Lines: | 51
|
Message-ID: | <3405657B.4DB2F673@LSTM.Ruhr-UNI-Bochum.De>
|
References: | <01bcb2f5$5e2d73e0$ab23e8c3 AT uk>
|
NNTP-Posting-Host: | c64.lstm.ruhr-uni-bochum.de
|
Mime-Version: | 1.0
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Uwe Klatt wrote:
>
> Hallo,
>
> wie kann ich in "C" (GCC) eine COM-Schnittstelle mit Streams ansprechen ?
> Bisher habe ich folgendes versucht:
> stream = fopen("COM2","a+b");
>
> allerding funktioniert hier nur das Schreiben.
> Das Lesen klappt nicht !?
>
> Wer kann mir da einen Tip geben ?
>
> (Unter LINUX mit dem GCC klappts !!!???)
>
> Tschau
> Uwe
This is an English speaking news group, so it is at least
unpolite to write in a different language. And it'll cut
down the number of people able and willing to answer.
The problem is that the usual BIOS does not handle reading
properly (i.e. Interrupt-driven), so simply opening
the device under plain DOS will get you nowhere.
The cure is either to find/buy/steal/write a good device driver
on OS level that allows doing what you want.
Or take Bill Curie's BCSERIO.ZIP and use the low-level access
functions.
Or add a layer using the __FSEXT* and bcserio for getting
unix-like behavior. See
ftp://ftp.lstm.ruhr-uni-bochum.de/pub/djgpp/bcserio.[ch]
for an example how use that stuff (Beware: It was wor djgpp2.0,
so some of the code won't act under 2.01 as it should)
--
Ciao
Tom
*************************************************************
* Thomas Demmer *
* Lehrstuhl fuer Stroemungsmechanik *
* Ruhr-Uni-Bochum *
* Universitaetsstr. 150 *
* D-44780 Bochum *
* Tel: +49 234 700 6434 *
* Fax: +49 234 709 4162 *
* http://www.lstm.ruhr-uni-bochum.de/~demmer *
*************************************************************
- Raw text -