delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/10/07:46:32

From: Thomas Demmer <demmer AT LSTM DOT Ruhr-UNI-Bochum DOT De>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Writing code for both DJGPP and Linux.
Date: Fri, 10 Oct 1997 10:40:14 +0200
Organization: Lehrstuhl fuer Stroemungsmechanik
Lines: 37
Message-ID: <343DE9EE.65BFF3E@LSTM.Ruhr-UNI-Bochum.De>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 971008103827 DOT 28262C-100000 AT is>
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

Eli Zaretskii wrote:
[...]
> I'd like to suggest another approach here?  Since on Linux, the ``correct''
> way of accessing devices is through `ioctl' and "/dev/ttyX", why not
> add this to DJGPP?  It shouldn't be too hard: all Alex has to do is to
> use the DJGPP Filesystem Extension feature.  Using it, Alex will need
> to install a handler for several functions, like `open', `close',
> `ioctl', `lseek', `read' and `write', and when they reference
> "/dev/ttyX" file, redirect them to some serial code (e.g., Bills
> `bcserio' package which is available from the DJGPP archives).  On
> Linux, these calls will just work as usual.
> 
> That way, Alex gets a portable program, while DJGPP gets
> POSIX-compliant serial port support.  And they all live happily ever
> after...
And furthermore there is on 
ftp://ftp.lstm.ruhr-uni-bochum.de/pub/djgpp/fsxcom.[ch]
a probably usable template (it was bases on another serial
package) that pretty much explains how it could be done. 

It would need some overhaul, but someone with knowledge how
to access ports under Linux could easily fit this to djgpp.

-- 
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 -


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