Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Aug 1995 13:29:15 -0400 (EDT)
From:      "Jonathan M. Bresler" <jmb@kryten.Atinc.COM>
To:        Robin Hunt <ROBIN@ptnsct.nis.za>
Cc:        questions@freebsd.org
Subject:   Re: Accessing i/o map space with freebsd 2.1.0
Message-ID:  <Pine.3.89.9508081334.C13865-0100000@kryten.atinc.com>
In-Reply-To: <950808145946.94e1@ptnsct.nis.za>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 8 Aug 1995, Robin Hunt wrote:

> 1) Is it required that I write I driver

	no.

> 2) If not, how can I use outb / inb without creating a bus error?

	open /dev/io.

#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <machine/cpufunc.h>
#include "if_smcreg.h"

int
main(int argc, char *argv[]) {
        if ( open("/dev/io", O_RDONLY, 0 ) != -1 ) {
                outw( 0x300 + BSR, BANK_2 );
                outw( 0x300 + MMUCR, RESET_MMU); /* XXX need to delay 
here ? */
        } else
                perror("");
                return -1;
}



	bizarre how O_RDONLY lets you write as well ;0


Jonathan M. Bresler  jmb@kryten.atinc.com       | Analysis & Technology, Inc.  
FreeBSD Postmaster   jmb@FreeBSD.Org            | 2341 Jeff Davis Hwy
play go.                                        | Arlington, VA 22202
ride bike. hack FreeBSD.--ah the good life      | 703-418-2800 x346




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.3.89.9508081334.C13865-0100000>