Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 May 2000 02:01:39 -0400
From:      Coleman Kane <cokane@one.net>
To:        hackers@freebsd.org
Subject:   mmap cdev function in device drivers
Message-ID:  <20000508020139.A10146@cokane.yi.org>

next in thread | raw e-mail | index | archive | help
Hello,
I have taken it upon myself to write a device driver to access the 3dfx voodoo
cards, just like the 3dfx linux driver that is available. I am using the linux
code as a reference and have come to a brick wall while writing the cdev mmap
function. What exactly is the return value of the device_mmap(...) function
supposed to be? What the linux driver basically does is it maps the device's
memory directly into userland memory, that part of the mmap functionality in
FreeBSD 4.0 seems to be handled by the vm, all it seem to want is an address
returned, type int, from looking at the other drivers. Is this the address of
the memory region mapped by the PCI BIOS (in this case the 0x1000000 region
between 0xec000000 and 0xecffffff), or an address of a mapped region within the
kernel memory area? I had it return the former and it crashed the machine, and
trying to use bus_alloc_resource(...) with the SYS_RES_MEMORY parameter just
won't map any memory

-- 
Coleman Kane
President, 
UC Free O.S. Users Group - http://pohl.ececs.uc.edu


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000508020139.A10146>