Re: How To?: Kernel Memory Mapped to User Space
Re: How To?: Kernel Memory Mapped to User Space
- Subject: Re: How To?: Kernel Memory Mapped to User Space
- From: Scott Taggart <email@hidden>
- Date: Thu, 06 Jun 2002 17:39:25 -0700
yea, but that does not satisfy my requirements:
1) My driver have the buffer available before any apps start
2) The buffer be persistent when apps come and go.
Maybe something is far easier, but it is not of use if it doesn't meet the
requirements. So, is what I ask for doable or not?
Scott
At 10:19 AM 6/6/2002, you wrote:
G'day Scott,
At 18:08 -0700 02-6-5, Scott Taggart wrote:
Hi,
I have seen various posts, responses, etc. on this subject, but quite
frankly, I got lost. I have the need to take a slug of kernel memory in
my driver and make it available to my user app so that my app can access
it directly (I'll take care of arbitration and protection with my
driver). Can someone give me the simplest set of calls I need to do
this? I am willing to research the calls but just need the general set
of calls required and order they should be called along with the
appropriate caveats. The memory I need to map to user land is allocated
by my driver at startup and is wired.
As Jim said it is usually better to map user memory into the kernel and
have the driver wire and unwire it. You don't really have to worry about
the app aborting without your being aware of it as the act of wiring means
that the memory stays valid until the DRIVER is ready to get rid of it.
By far the easiest way of doing this sort of thing is to pass a buffer in
with an open style routine. Wrap it in a memory descriptor and register
it with your driver. Your driver can then prepare() (i.e. wire) it and
map() it to get a virtual address to access the memory. Now is also a
good time to grab the physical addresses for any future DMA you may want to do.
Godfrey
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.