From owner-freebsd-questions Tue Nov 7 12:32:49 2000 Delivered-To: freebsd-questions@freebsd.org Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by hub.freebsd.org (Postfix) with ESMTP id 06D0937B479 for ; Tue, 7 Nov 2000 12:32:47 -0800 (PST) Received: (from dan@localhost) by dan.emsphone.com (8.11.1/8.11.1) id eA7KWg509301; Tue, 7 Nov 2000 14:32:42 -0600 (CST) (envelope-from dan) Date: Tue, 7 Nov 2000 14:32:41 -0600 From: Dan Nelson To: Howard Blue Cc: questions@FreeBSD.ORG Subject: Re: C Programming using FreeBSD Message-ID: <20001107143241.A4569@dan.emsphone.com> References: <3A085E29.4BA73D22@oaklandnet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.11i In-Reply-To: <3A085E29.4BA73D22@oaklandnet.com>; from "Howard Blue" on Tue Nov 7 11:55:22 GMT 2000 X-OS: FreeBSD 5.0-CURRENT Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In the last episode (Nov 07), Howard Blue said: > How to use outb( ) and inb( ) with gcc and FreeBSD? > > int main() > { > /* Getting accesss to io port. */ > if (ioperm(BASEPORT, 3, 1) {perror("ioperm"); exit(1);} > > again: > outb(0, BASEPORT); > sleep(1); > outb(0xFF, BASEPORT); > sleep(1); > printf("Testing...\n");\ > goto again; > } > > What changes would be necessary for a simillar program to work with > FreeBSD? #include , call i386_set_ioperm() to enable access to an i/o port, and swap the arguments to outb. -- Dan Nelson dnelson@emsphone.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message