Subject: Re: Serial IO focusing
From: [email-masked] (Fergus Henderson)

24 Aug 1997 11:43:45 -0700
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Original-To: [email-masked] (mark koi)
Original-Cc: [email-masked] (Cygnus GNU-win32 mailing list)
In-Reply-To: <[email-masked]> from mark koi at "Aug 20, 97 04:31:39 pm"
X-Mailer: ELM [version 2.4ME+ PL15 (25)]
Original-Sender: [email-masked]

mark koi, you wrote:
> I had a program under DOS which controlled a serial port using a polling
> 
> method.  Now I am trying to use gnu-win32, and I see no libraries for
> things like outp(), inp().

I think you probably just need to define these using inline assembler.

#define outb(value, port) \
  ({ __asm__ __volatile__ ("outb %b0,%w1"::"a" (value), "d" (port)); })

#define inb(port) \
  ({ char _v; \
      __asm__ __volatile__ ("inb %w1,%0":"=a" (_v):"d" (port)); \
      _v; \
  })

However, I haven't tried this...
I don't know if Windows allows direct access to I/O ports like this.
You might have to write a Windows device driver (VxD).

-- 
Fergus Henderson <[email-masked]>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger [email-masked]         |     -- the last words of T. S. Garp.
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".