Date: Wed, 21 Jan 2004 12:21:02 +1030 From: "Daniel O'Connor" <doconnor@gsoft.com.au> To: Anand Subramanian <anand@pythagoras.math.uwaterloo.ca> Cc: freebsd-hackers@freebsd.org Subject: Re: mmap() on pseudo device Message-ID: <200401211221.02869.doconnor@gsoft.com.au> In-Reply-To: <Pine.GSO.4.58.0401191737400.22957@pythagoras.math.uwaterloo.ca> References: <Pine.GSO.4.58.0401191737400.22957@pythagoras.math.uwaterloo.ca>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday 20 January 2004 09:08, Anand Subramanian wrote: > 1. I'm creating a pseudo device and having a user space process mmap() the > device memory into its address space. So the mmap for the device has to be > implemented. Are there any useful driver/source files I could look at for > this? > > 2. How can I access the mmaped memory from another kernel loadable module? The bktr driver is probably reasonable to look at, although it needs contiguous address space and I suspect you don't. > 3. For the user space program, after it does a mmap() on the > pseudo-device, is there any way it can force malloc() to operate on the > mmaped memory? Or am I forced to write my own lightweight memory manager? > Most of the memory managers around seem to be way too complicated to > quickly fix or customize for a simple need. Why would you want to malloc from your mmap'd region? Once you have mmap'd it you can validly read/write (subject to memory protections) without having to malloc it first. -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 9A8C 569F 685A D928 5140 AE4B 319B 41F4 5D17 FDD5
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200401211221.02869.doconnor>