Subject: Re: Outb() call
To: Sami Kantoluoto <sami.kantoluoto@embedtronics.fi>
From: ML <ml@rz.uni-potsdam.de>
List: port-i386
Date: 03/06/2004 23:38:40
Hello,

> > I am trying to access // port using outb()
> > Using this simple code:
> > 
> > #include <sys/types.h>
> > #include <fcntl.h>
> > #include "/usr/include/x86/pio.h"
> > 
> > int main() {
> >         int fHndl;
> >         fHndl = open("/dev/io", O_RDONLY);
> >         outb(0x378,255);
> >         close(fHndl);
> > }
> 
> Are you sure you have the permiossion to open the device? Check the
> return value (of open()) before doing anything else ;-).

from man io:

NAME
     io - I/O privilege file

DESCRIPTION
     This device is obsolete and is provided for compatibility purposes only;
     use i386_iopl(2) instead.

...
     I/O privilege on access to /dev/io is only granted if the kernel was
     built with the COMPAT_10 option.

hope that helps
Michael