Passing 40KB data from user to kernel space. How??
Passing 40KB data from user to kernel space. How??
- Subject: Passing 40KB data from user to kernel space. How??
- From: "rohit dhamija" <email@hidden>
- Date: Wed, 4 Jul 2007 17:46:37 +0530
Dear All,
Developing a USB KEXT for my bulk USB device and wanted suggestions
from this group. The device has two bulk endpoints
I continously pass around 40KB data from the user level application -
Write 40K data from OUT EP– Read single byte data. This
is a continous process.
Since the data amount is huge, I need a mechanism which takes minimum
memory and time to pass this data to device.
Below are my thoughts for the same:
1. I cannot pass/copy the entire data from IOConnect methods since
these methods cannot pass more than 512kb data. Please
correct me if I am wrong
2. Send the address of the buffer and buffer size from the user
application. At kernel level, we will get this address and
length, Then use copyin function to copy this buffer at kernel level
and use further.
status = copyin((user_addr_t)Bufferaddr, Buffer, Buflen);
I am able to pass the data correctly using this procedure, but i
suppose this is not the preffered way because
(a) I am developing the buffer at user level
(b) then again at kernel level , i copyin the entire buffer
So this process is much time and space consuming.
B/w is it required to get the entire memory buffer at kernel level and
then pass to the driver? Can we use the user level
address and size and use the user space itself? IF yes, please detail
how it is possible?
3. Can we use IOConnectMapMemory to map the user level buffer with the
kernel memory ?? If yes, please detail.
As per Apple documentation, we can only map the device registers to
map with user level. Please refer
http://developer.apple.com/documentation/DeviceDrivers/Conceptual/AccessingHardware/AH_IOKitLib_API/chapter_5_section_5.html
Please suggest the most optimal way to pass this user buffer at kernel level.
Thanks and Regards,
Rohit Dhamija
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden