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:56:23
I wrote some code for my custom ISA interface card. It has a 8 bit output
mapped at 0x320.
When I run this code, I get "bus error (core dumped)"
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <curses.h>
#include <sys/types.h>
#include <machine/joystick.h>
#include <machine/pio.h>
#define DEVICE_0 "/dev/joy0"
#define DEVICE_1 "/dev/joy1"
#define EXIT_FAILURE -1
[...]
/* Initialize Isa interface */
baseaddr = 0x320;
porta = baseaddr;
portb = baseaddr + 1;
portc = baseaddr + 2;
contr = baseaddr + 3;
/* put a high state on 8 pins of port A*/
outb(baseaddr, 255);
[...]
What is wrong with this raw i/o ? What do I need ?
_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE*
http://join.msn.com/?page=features/junkmail