From owner-freebsd-hackers Sun May 7 22:55:46 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from evil.2y.net (ztown2-2-46.adsl.one.net [216.23.15.46]) by hub.freebsd.org (Postfix) with ESMTP id D31EB37BCE5 for ; Sun, 7 May 2000 22:55:42 -0700 (PDT) (envelope-from cokane@evil.2y.net) Received: (from cokane@localhost) by evil.2y.net (8.9.3/8.9.3) id CAA10275 for hackers@freebsd.org; Mon, 8 May 2000 02:01:39 -0400 (EDT) (envelope-from cokane) Date: Mon, 8 May 2000 02:01:39 -0400 From: Coleman Kane To: hackers@freebsd.org Subject: mmap cdev function in device drivers Message-ID: <20000508020139.A10146@cokane.yi.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i X-Vim: vim:tw=70:ts=4:sw=4 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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