public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Read/write IO ports on NT
@ 2001-07-24  3:57 Clive Mayo
  2001-07-24  4:44 ` Corinna Vinschen
  2001-07-26 19:07 ` Gunnar Andre Dalsnes
  0 siblings, 2 replies; 3+ messages in thread
From: Clive Mayo @ 2001-07-24  3:57 UTC (permalink / raw)
  To: cygwin

Hi

Trying to read and write directly at IO port on NT, using the following code

int main()
{
 __asm("mov $1, %al");
 __asm("mov $0x3f8, %dx");
 __asm("out %al, %dx");
 return 0;
}

also tried

int main()
{
 _outp(0x378, 1);
 return 0;
}

but get the following exception, Privileged instruction.
Any suggestions or pointers of how to code this.

Clive Mayo


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Read/write IO ports on NT
  2001-07-24  3:57 Read/write IO ports on NT Clive Mayo
@ 2001-07-24  4:44 ` Corinna Vinschen
  2001-07-26 19:07 ` Gunnar Andre Dalsnes
  1 sibling, 0 replies; 3+ messages in thread
From: Corinna Vinschen @ 2001-07-24  4:44 UTC (permalink / raw)
  To: cygwin

On Tue, Jul 24, 2001 at 11:15:40AM +0100, Clive Mayo wrote:
> Hi
> 
> Trying to read and write directly at IO port on NT, using the following code
> 
> int main()
> {
>  __asm("mov $1, %al");
>  __asm("mov $0x3f8, %dx");
>  __asm("out %al, %dx");
>  return 0;
> }
> 
> also tried
> 
> int main()
> {
>  _outp(0x378, 1);
>  return 0;
> }
> 
> but get the following exception, Privileged instruction.
> Any suggestions or pointers of how to code this.

You can't on NT. Use standard file IO.

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Read/write IO ports on NT
  2001-07-24  3:57 Read/write IO ports on NT Clive Mayo
  2001-07-24  4:44 ` Corinna Vinschen
@ 2001-07-26 19:07 ` Gunnar Andre Dalsnes
  1 sibling, 0 replies; 3+ messages in thread
From: Gunnar Andre Dalsnes @ 2001-07-26 19:07 UTC (permalink / raw)
  To: cygwin

At 24.07.01 12:15 , you wrote:
>Hi
>
>Trying to read and write directly at IO port on NT, using the following code
>
>int main()
>{
>  __asm("mov $1, %al");
>  __asm("mov $0x3f8, %dx");
>  __asm("out %al, %dx");
>  return 0;
>}
>
>also tried
>
>int main()
>{
>  _outp(0x378, 1);
>  return 0;
>}
>
>but get the following exception, Privileged instruction.
>Any suggestions or pointers of how to code this.
>
>Clive Mayo

You need a kernel-mode device driver to do this.
Get sample source from Dr. Dobb's Journal.
ftp://ftp.ddj.com/1996/1996.05/directio.zip

Gunnar.


>--
>Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>Bug reporting:         http://cygwin.com/bugs.html
>Documentation:         http://cygwin.com/docs.html
>FAQ:                   http://cygwin.com/faq/


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-07-26 19:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-24  3:57 Read/write IO ports on NT Clive Mayo
2001-07-24  4:44 ` Corinna Vinschen
2001-07-26 19:07 ` Gunnar Andre Dalsnes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).