Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Steve Dum <steve_dum@mentorg.com>
To: axp-list@redhat.com
Cc: steve_dum@mentorg.com
Subject: io port programming on alpha on redhat 5.0
Date: Fri, 17 Apr 1998 10:51:54 -0700	[thread overview]
Message-ID: <199804171751.KAA17854@drdoom.wv.mentorg.com> (raw)

Is anyone doing any io programming on the alpha.
I tried a simple test - map in the parallel port and try to read a register.
My simple test case ran just fine on x86 redhat 5.0

On axp, I couldn't find a set of headers that I could include because the
files like <linux/lp.h> and <linux/delay.h> are incompatible with 
things like <sys/types.h> - so I ended up just cuting and pasting the
necessary definitions.

But even then, I immediately get a segfault in ioperm().  Does anyone have
a simple example that runs on Redhat 5.0?

Here is esentially what I tried (c++).
-----------------------------------------------------------
#include <iostream.h>
#include <sys/types.h>

extern "C" void             _outb (unsigned char b,unsigned long port);
extern "C" int ioperm (unsigned long int __from, unsigned long int __num,
                        int __turn_on);

int base = 0x378;
int main()
{
    if (ioperm(base,3,1)<0) {
        cout << "unable to access port 0x"<< hex << base << endl;
	exit (1);
    }
    int status = inb(base+1);
    cout << "Status for lp port 0x" << hex << base << endl;
}
---------------------------------------------------------------


--------------
Stephen Dum            steve_dum@mentorg.com    (503)-685-7743
Mentor Graphics Corp.  8005 S.W. Boeckman Rd.   Wilsonville, Or 97070-7777


                 reply	other threads:[~1998-04-17 17:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox