*BSD News Article 82839


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!feed1.news.erols.com!howland.erols.net!surfnet.nl!tudelft.nl!elektron.et.tudelft.nl!news
From: Joost Nieuwenhuijse <joostn@nedernet.nl>
Newsgroups: comp.unix.bsd.bsdi.misc
Subject: Port I/O (parallel port) on 486 - HOW?
Date: Thu, 14 Nov 1996 19:09:19 +0100
Organization: Delft University of Technology, Dept. of Electrical Engineering
Lines: 30
Message-ID: <328B604F.1B47@nedernet.nl>
NNTP-Posting-Host: joost.et.tudelft.nl
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 3.0Gold (Win95; I)

Hi,

I'm writing an application that needs to access the parallel port of a
486 PC directly (for controlling the 8 I/O lines of this port). I've
managed to get it working on my own Linux PC, but it really should run
on a BSDI (2.0.1) system. I must admit that I have very little
experience with BSD.
Here's how I did it in Linux:

#include <unistd.h>
#include <asm/io.h>
r = ioperm (IOBASE,3,1);
outb (data, PORT);
data = inb (PORT);

with PORT and IOBASE being port addresses for the printer port.

Apparently BSDI doesn't know inb and outb, and <asm/io.h> isn't present
either.

There is a man page on 'ioport' but it doesn't make things clearer to
me.

Do I have to write assembler to get it working? Hope not.
If anybody knows, please help me, I'm really stuck.

Best regards,
Joost Nieuwenhuijse