From owner-freebsd-questions Thu Jun 1 1:57: 7 2000 Delivered-To: freebsd-questions@freebsd.org Received: from ngo.org.uk (ngo.org.uk [193.62.43.28]) by hub.freebsd.org (Postfix) with ESMTP id 1781437BFB2 for ; Thu, 1 Jun 2000 01:57:02 -0700 (PDT) (envelope-from mac@ngo.org.uk) Received: (from mac@localhost) by ngo.org.uk (8.9.3/8.9.3) id JAA20643; Thu, 1 Jun 2000 09:57:07 +0100 (BST) From: Mac Message-Id: <200006010857.JAA20643@ngo.org.uk> Subject: Re: Writing a value to an IO (mem mapped) port In-Reply-To: <20000531192931.Q99925@strontium.scientia.demon.co.uk> from Ben Smithurst at "May 31, 0 07:29:31 pm" To: ben@scientia.demon.co.uk (Ben Smithurst) Date: Thu, 1 Jun 2000 09:57:07 +0100 (BST) Cc: freebsd-questions@freebsd.org X-Mailer: ELM [version 2.4ME+ PL38 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Ben Smithurst Wrote > Mac wrote: > > > 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 > > #include > > > > main() > > { > > outb(0x181,0) > > } > > > > And compiles OKay. > > "man i386_set_ioperm" might help you. I'm guessing you'll want to call > > i386_set_ioperm(0x181, 1, 1); > > before the call to outb(), but as I've never used this function I can't > be sure exactly. > Right, next question. I can't get i386_{set,get}_ioperm to work. All attempts at calling these functions result in a return value of -1 (errno=22 (EINVAL)). Code I'm using looks like this:- #include #include main() { unsigned int port; unsigned int *length; int *enable; int res; port = 0x180; res = i386_get_ioperm(port,length,enable); [then a whole string of printf statements] } Any one know what I'm doing wrong? Mac To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message