Re: IOUserClient and IOExternalMethodArguments
Re: IOUserClient and IOExternalMethodArguments
- Subject: Re: IOUserClient and IOExternalMethodArguments
- From: Godfrey van der Linden <email@hidden>
- Date: Thu, 18 Jun 2009 09:26:50 +1000
I'll take some of that thanks, thanks ;-)
But you should reconsider map()ing the descriptor into the kernel's
address space. This operation has traditionally been extraordinarily
slow. I definitely would NOT do this on I/O path. If you are mapping
memory with every I/O then try using the IOMD::read/writeBytes
routines copy data into pre-allocated internal buffers, I'll bet the
performance difference will be significant.
Cheers
Godfrey
On 2009-06-18, at 4:49 AM, Duane Murphy wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
I must have been doing something wrong with my testing. It works
great!
Thank you to the developer at Apple that decided to build this very
useful and helpful interface.
On Jun 16, 2009, at 3:33 PM, Duane Murphy wrote:
I would like to take advantage of the structureInputDescriptor and
structureOutputDescriptor fields of IOExternalMethodArguments to
memory map the data passed from user space to the kernel.
I have done this by hand myself and it works just fine. However, I
can't seem to get this to work with these fields. It makes the code
much simpler if I can take advantage of these fields.
I make sure that the source memory in user space uses an anonymous
mmap() to make sure the memory is aligned and available for mapping.
When I detect that one of the descriptor fields is being used in my
kext, I prepare(), then map() the memory. Then I call
getVirtualAddress() using the resulting IOMemoryMap. No errors are
returned by any of the calls. But the resulting address can not be
accessed by the kernel. I get a kernel panic if I let my code run or
in gdb I simply get a "cannot access memory at address 0x34346000"
error.
Is it possible to use these descriptors for memory mapping? My
examination of the code seems to indicate that it should work.
What is it that I am doing wrong? What am I missing?
Thanks!
...Duane
-----BEGIN PGP SIGNATURE-----
Version: PGP Desktop 9.10.0 (Build 500)
Charset: US-ASCII
wsBVAwUBSjk6vkrg9acQ4r2CAQhm4Af/YOeqxcKXXLAmjpmLdJC7pCJRdJsPlyfD
XvB9Xkw7Abs9sLr0YwuPOnl2gS4KX0Q3EmnT0xuhoxazQSYZdx2+wL1qLBBGRAQf
vmFkD74hBXLNkRqq6pIR6sTdvMWMsay4EjapPOqB1J4tcsZvKYyQ0dM+BfqmACls
MC6o85mYUo4UE/SCri8MKQAplHW7jtXVxve8Qp2oTZdgb12htAZfP/2xImDGjQ5V
kNoG4M8fL/lgDNgnd2jg59SrDMwHePskO0gHmKJrTcaQKrNtYGzdzTsbN4404AU0
cCrfBMjm6D0D8jCsHY+VwQ6ZS26YOPI0+8NKPcRo7qGDQKny+6UCOQ==
=EPoD
-----END PGP SIGNATURE-----
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden