Subject: Re: mmap()'ing the I/O page
To: Eric Smith <eric@brouhaha.com>
From: Anders Magnusson <ragge@ludd.luth.se>
List: port-vax
Date: 03/28/2000 13:03:32
> On x86 Linux boxes I've been able to access the memory on PCI cards from
> user space by mmap()'ing the right region of /dev/kmem.
> 
> Can I do this on NetBSD on a KA655?  I want to access the CSR, etc. of
> a Qbus card from user space.  I'd just try it, but I have no idea where
> the Qbus I/O page (bus addresses 17 760 000 to 17 777 777) is mapped in
> the VAX kernel virtual address space (or VAX physical address space, for
> that matter).
> 
Some history:

Traditionally in BSD (before mmap() was invented) there was a device called
kUmem that was the device I/O space word-accessible. I once wrote some support
for doing the same with mmap(), but I never finished it because: accessing
a nonexisting mapped device would cause a machine check, and I wasn't sure
how to just send a SIGBUS to the process and then continue. (A machine 
check is normally fatal).

It would be simple to just add mmap() support to /dev/mem, but then you
must keep track of what you access yourself (wrong address will crash
the machine :-)

-- Ragge