From owner-freebsd-hardware@FreeBSD.ORG Wed Jul 9 11:00:55 2003 Return-Path: Delivered-To: freebsd-hardware@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EE6B837B401 for ; Wed, 9 Jul 2003 11:00:55 -0700 (PDT) Received: from server.zaleo.homeunix.net (fia99-99.dsl.hccnet.nl [62.251.99.99]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6875743F75 for ; Wed, 9 Jul 2003 11:00:54 -0700 (PDT) (envelope-from FreeBSD@Zaleo.nl) Received: from zeo.Zaleo.nl ([192.168.0.2])h69I1uG6023703; Wed, 9 Jul 2003 20:01:57 +0200 (CEST) (envelope-from FreeBSD@Zaleo.nl) Message-Id: <5.1.1.6.2.20030709195346.00b257f8@pop3.zaleo.homeunix.net> X-Sender: freebsd@pop3.zaleo.homeunix.net (Unverified) X-Mailer: QUALCOMM Windows Eudora Version 5.1.1 Date: Wed, 09 Jul 2003 20:00:52 +0200 To: freebsd-hardware@freebsd.org From: FreeBSD-Lis Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Content-Filtered-By: Mailman/MimeDel 2.1.1 cc: Zeo@Zaleo.nl Subject: machine/pio.h: No such file or directory X-BeenThere: freebsd-hardware@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: General discussion of FreeBSD hardware List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jul 2003 18:00:56 -0000 Dear people, after installing FreeBSD 5.0 I wand to start programming, to start with some simple examples I have my first problem. I'm missing a include file that just isn't on my system. /usr/include/machine/pio.h Can you guys give me a hint how to install the PIO library ? Error message : # cc sh2lpt.c sh2lpt.c:1: syntax error before '.' token sh2lpt.c:5:25: machine/pio.h: No such file or directory sh2lpt.c: In function `ioport': sh2lpt.c:13: storage size of `ioperm' isn't known Source (a basic example) : # cat sh2lpt.c #include #include #include #include #include /* ioport(port) permit access to an I/O port. * port I/O address to enable */ void ioport(int port) { u_long iomap[32]; struct i386_set_ioperm_args ioperm; ioperm.iomap = iomap; syscall(SYS_sysarch, I386_GET_IOPERM, (char *) &ioperm); iomap[port >> 5] &= ~(1 << (port & 0x1f)); syscall(SYS_sysarch, I386_SET_IOPERM, (char *) &ioperm); } int main() { int i; ioport(0x378); /* Enable access to the port */ for(i = 0; i < 256; i++) { outb(0x378, i); /* Set the output register */ sleep(1); /* Sleep a tick */ } return 0; } Kind regards, -- Zeo Smeijsters http://www.zaleo.homeunix.net/ http://www.zaleo.nl.