Subject: Re: Outb problem
To: Alexander Nazarenko <sasha@deimos.ldc.net>
From: Jason R Thorpe <thorpej@zembu.com>
List: current-users
Date: 09/26/2000 08:16:03
On Tue, Sep 26, 2000 at 06:10:04PM +0300, Alexander Nazarenko wrote:
> I have little programm for working with io :
> #include <machine/types.h>
> #include <machine/pio.h>
> ...
>
> if (dummy=fopen("/dev/io", "r")) {
> outb(port_addr, byte);
> fclose(dummy);
> }
This isn't how it works in NetBSD. In NetBSD, do:
...
i386_iopl(1); /* enable I/O access */
outb(port_addr, byte);
i386_iopl(0); /* disable I/O access */
...
Make sure you link with -li386.
--
-- Jason R. Thorpe <thorpej@zembu.com>