From owner-freebsd-hardware Wed Mar 14 16:11: 6 2001 Delivered-To: freebsd-hardware@freebsd.org Received: from smtp2.mbox.com.au (smtp2.mbox.com.au [203.103.80.178]) by hub.freebsd.org (Postfix) with ESMTP id 2995937B71D; Wed, 14 Mar 2001 16:10:59 -0800 (PST) (envelope-from das@mbox.com.au) Received: from mbox.com.au (webmail.i7mail.com.au [192.168.20.4]) by smtp2.mbox.com.au (Sun Internet Mail Server sims.4.0.2000.05.17.04.13.p6) with ESMTP id <0GA700LOGP8YNR@smtp2.mbox.com.au>; Thu, 15 Mar 2001 07:58:10 +0800 (WST) Date: Thu, 15 Mar 2001 11:10:17 +1100 From: das@mbox.com.au Subject: Parallel Programing in FreeBSD To: freebsd-hardware@FreeBSD.ORG Cc: hackers@FreeBSD.ORG Message-id: <3eb86b3f2779.3f27793eb86b@mbox.com.au> MIME-version: 1.0 X-Mailer: Netscape Webmail Content-type: text/plain; charset=us-ascii Content-language: en Content-disposition: inline Content-transfer-encoding: 7BIT X-Accept-Language: en Sender: owner-freebsd-hardware@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Hi, i'm trying to do some programming on freebsd and i can't find 'asm/io.h'. this must be for security reasons. so how do i talk to the parallel port? Thanks, Dave Seddon here's the really simple bit of code i'm trying to use: #include #include /* needed for ioperm() */ #include /* for outb() and inb() */ #define DATA 0x378 #define STATUS DATA+1 #define CONTROL DATA+2 int main(void) { int x = 0x32; int y = 0x08; if (ioperm(DATA,3,1)) { printf("Sorry, you were not able to gain access to the ports\n"); printf("You must be root to run this program\n"); exit(1); } outb(DATA, x); /* Sends 0011 0010 to the Data Port */ outb(CONTROL, y^0x0b); /* SELECT_IN = 1, INIT = 0, /AUTO_FEED = 0, /STROBE = 0 */ return (0); } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hardware" in the body of the message