Date: Wed, 31 May 2000 18:47:35 +0100 (BST) From: Mac <mac@ngo.org.uk> To: freebsd-questions@freebsd.org Subject: Writing a value to an IO (mem mapped) port Message-ID: <200005311747.SAA19114@ngo.org.uk>
next in thread | raw e-mail | index | archive | help
Hi all,
Basically, I have a simple IO card installed in my PC and I control it
by writing to a (fixed I/O) port.
Under QBASIC I'd use:-
OUT(&H181,0)
and under Visual C I use something like:-
_outp(0x181,0)
However under FreeBSD, although the function seems to exist to do this
in /usr/include/machine/cpufunc.h, I get Bus Errors every time I try.
fred.c looks like this:-
#include <sys/types.h>
#include <machine/cpufunc.h>
main()
{
outb(0x181,0)
}
And compiles OKay.
I'm assuming I'm missing something fairly fundamental here. I've done
all my testing whilst logged in as 'root' on a 3.2-RELEASE box.
(without the actusl card installed just yet).
Any ideas? (The core dump shows the Bus Error (signal 10) as occuring
in outbv() )
Mac
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200005311747.SAA19114>
