From: Thomas Demmer 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: NNTP-Posting-Host: c64.lstm.ruhr-uni-bochum.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk 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 * *************************************************************