Date: Tue, 2 Jun 1998 22:10:16 -0600 (MDT) From: "Kenneth D. Merry" <ken@plutotech.com> To: dg@root.com Cc: cc@swing.ca.sandia.gov, freebsd-hackers@FreeBSD.ORG Subject: Re: VM Questions Message-ID: <199806030410.WAA20525@panzer.plutotech.com> In-Reply-To: <199806030335.UAA19842@implode.root.com> from David Greenman at "Jun 2, 98 08:35:34 pm"
next in thread | previous in thread | raw e-mail | index | archive | help
David Greenman wrote... > >First, I was wondering if it is possible given a physical address, > >to copy data to it from a virtual address. Or is a virtual mapping > >necessary? > > There must be a virtual mapping. > > >The other question is how may I map user pages into the kernel? I've > >looked through vm_map.c, and it seems that support for this is > >lacking. To get around this for now, I am attempting to use almost > >exclusively physical address--although am now sure how it will work > >out. > > vm_map.c isn't really the right place to look. A better place would be > physio/vmapbuf/vunmapbuf in kern_physio.c and vm_machdep.c. One example of this is in the CAM passthrough driver. The passmapmem() function uses vmapbuf() to map the user data buffer into kernel memory. (the passthrough driver is sys/cam/scsi/scsi_pass.c) Obviously, though, you're limited by MAXPHYS as far as what you can map into kernel memory. If you want to do more than that, you've gotta either use physical addresses, or go through the effort to implement buffer chaining or some other similar mechanism. Ken -- Kenneth Merry ken@plutotech.com 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?199806030410.WAA20525>