Message-ID: <19971010094530.18209.qmail@hotmail.com> From: "Alex Holden" To: eliz AT is DOT elta DOT co DOT il Cc: djgpp AT delorie DOT com Subject: Re: Writing code for both DJGPP and Linux. Content-Type: text/plain Date: Fri, 10 Oct 1997 02:45:29 PDT Precedence: bulk Eli Zaretskii wrote: >On Tue, 7 Oct 1997, Hartmut Schirmer wrote: > >> Isolate your serial routines in one source for for DJGPP and one >> for Linux. For Unix (incl. Linux) serial port programming see >> >> http://www.easysw.com/~mike/serial/ > >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... Hmm, sounds an interesting idea. I'll have a play with it over the weekend and let you know if I think I'll be able to do it on Monday (I don't have Internet access at home). If anyone else has any comments on whether this is feasible, a good idea, a Bad Idea(tm), or whatever, I'd like to hear from them. Thanks, Alex. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | Alex Holden- Electronics student, computer | | programmer, caver, and Land Rover nut. | | http://www.geocities.com/CapeCanaveral/Lab/1532/ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com