delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/13/08:36:21

Message-ID: <19971013123422.14430.qmail@hotmail.com>
From: "Alex Holden" <bigal2000 AT hotmail DOT com>
To: djgpp AT delorie DOT com
Subject: Re: Writing code for both DJGPP and Linux.
Date: Mon, 13 Oct 1997 05:34:20 PDT

On Friday, I wrote:
>Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> 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.

Okay, after spending the weekend immersed in DPMI, assembly code, man 
pages, info pages, LIBC source, Linux kernel source, etc. I think I can 
say that Eli was being a bit optimistic when he said it shouldn't be too 
hard. But, what the heck, I'm going to have a go anyway.

I would still welcome advice from anyone who knows how to use the DJGPP 
file system extensions. The other main thing I have not been able to 
track down is a proper spec on just how serial communication is supposed 
to happen under Unix. I have the Linux serial programming howto, but 
after reading it, I was just more confused than when I started. I had a 
look at the tutorial at easysw.com (see above for the address), but it 
is not available for direct download (it's in a fancy frames arrangement 
so you can't simply save it from the browser). Also, the guy does not 
give his email address, and when I tried to send one to him C/O the 
site's webmaster, it turned out they wouldn't accept email from hotmail. 
How they expect to get any business without giving out their Email I 
don't know!

Thanks again, 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

- Raw text -


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