*BSD News Article 80731


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!spool.mu.edu!newspump.sol.net!howland.erols.net!newsfeed.internetmci.com!in1.uu.net!news.ultranet.com!usenet
From: moncrg@ultranet.com (Gregory D. Moncreaff)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: need help accessing device i/o memory from device driver
Date: Mon, 14 Oct 1996 20:54:36 GMT
Organization: UltraNet Communications, Inc.
Lines: 25
Message-ID: <3262a767.1807782@news.ma.ultranet.com>
References: <325b02fd.1625642@news.ma.ultranet.com> <53l1ef$4ia@uriah.heep.sax.de>
NNTP-Posting-Host: dominus.ultranet.com
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Newsreader: Forte Agent .99f/32.299

j@uriah.heep.sax.de (J Wunsch) wrote:

>moncrg@ultranet.com (Gregory D. Moncreaff) wrote:
>
>> I'm working on a device driver for a serial board under Freebsd.  I
>> did a hack and slash on a similar driver that used the same serial
>> chips as the board I'm working with.  The only difference is that the
>> new board has a dual-port ram and the old board/driver didn't.
>> 
>> What I don't understand is how you "wire" pages of, virtual I guess,
>> memory to a physical location.
>
>Is your memory located in the ``ISA hole'', or somewhere in the upper
>memory?  The ISA hole is already mapped.  For the upper memory area,
>you could perhaps adopt the algorithm used in the /dev/mem
>implementation.
>

It worked, eventually.

I assume that the kernel performs the appropriate vm/paging based on
the isa_device->id_maddr, id_msize if the probe reports success,  I
just needed to use the appropriate virtual to physical address
conversion to program the device's view of the address of the memory.