* io port programming on alpha on redhat 5.0
@ 1998-04-17 17:51 Steve Dum
0 siblings, 0 replies; only message in thread
From: Steve Dum @ 1998-04-17 17:51 UTC (permalink / raw)
To: axp-list; +Cc: steve_dum
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1998-04-17 17:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-04-17 17:51 io port programming on alpha on redhat 5.0 Steve Dum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox