Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Apr 1996 10:01:06 -0400 (EDT)
From:      Sujal Patel <smpatel@umiacs.umd.edu>
To:        Hollerer <eeg@telecom.at>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: How can I read/write from/to an I/O-port?
Message-ID:  <Pine.NEB.3.92.960419095909.1260C-100000@xi.dorm.umd.edu>
In-Reply-To: <317764B2.6DCC0261@telecom.at>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 19 Apr 1996, Hollerer wrote:

> Under Linux a /dev/port exits to write/read to/from an I/O-port.
> Does a similar /dev/??? exits under FreeBSD or must I write
> a little device driver for this?

After you open /dev/io as read-only, you can then use inb & outb from
machine/cpufunc.h--

#include <stdio.h>
#include <sys/fcntl.h>
#include <machine/cpufunc.h>

main()
{
	open ("/dev/io", O_RDONLY);
	outb (0x3f8, 0xff);
}


Sujal




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.92.960419095909.1260C-100000>