Subject: outb() gives bus error
To: None <port-i386@netbsd.org>
From: Philippe St-Jacques <h0ho@hotmail.com>
List: port-i386
Date: 01/24/2003 04:45:49
I wrote a code for a custom ISA peripherical interface. The 8bit outpout I
want to send data is mapped at 0x320.
I get a "Bus error (core dumped)" when I run my app with this code inside.
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <curses.h>
#include <sys/types.h>
#include <machine/joystick.h>
#include <machine/pio.h>
...
int baseaddr, porta, portb, portc, contr;
/* Initialize Isa interface */
baseaddr = 0x320;
porta = baseaddr;
portb = baseaddr + 1;
portc = baseaddr + 2;
contr = baseaddr + 3;
/* put high state on 8 pins of port a */
outb(porta, 255);
...
It should work since it's raw data in/out. What do I need to make this work
? i/o permission ?
_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE*
http://join.msn.com/?page=features/junkmail