Subject: Re: 2 Driver related questions
To: None <port-i386@netbsd.org>
From: Christos Zoulas <christos@zoulas.com>
List: port-i386
Date: 07/20/1999 16:57:09
In article <81F5585A3B93D111A8D10080ADB4CBB90E8C2F@DC>,
Bruce Martin <BruceM@cat.co.za> wrote:
>This message is in MIME format. Since your mail reader does not understand
>this format, some or all of this message may not be legible.
>
>------ =_NextPart_001_01BED297.10B469E0
>Content-Type: text/plain
>
>We have written a driver for a piece if hardware that uses the ISA bus.
>At startup, it allocated port 0x390-0x985! We need it to start at 0x390,
>but only allocate to 0x397 - where is this set?
>
>Also, how do you use inb, outb functions in NetBSD - I have tried to
>#include<machine/pio.h> but I get a syntax error on line 67 of the
>included file - do I need to set any compiler switches for this?
>

The inb/outb functions have been replaced by the bus_space(9) functions.
As far as allocation goes, you should tell it in the probe/attach functions:

#define YOUR_NPORTS	8

	if (bus_space_map(iot, iobase, YOUR_NPORTS, 0, &ioh)) {

iobase you get from the driver definition line in your kernel config.
Look at drivers in /usr/src/sys/dev/isa for examples.

christos