public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Question about copy_from_user/copy_to_user
@ 2004-07-10 20:44 Qiuyu Zhang
  2004-07-11  1:59 ` Richard B. Johnson
  0 siblings, 1 reply; 3+ messages in thread
From: Qiuyu Zhang @ 2004-07-10 20:44 UTC (permalink / raw)
  To: linux-kernel

Hi all,

I am working on a module driver. A user application alloc a bunch of
memory for storing packet. And module driver can read /write data
from/into the memory in user space. I use ioctl function to pass the
pointer of memory of user space to module driver.  What I want to do
is to store the pointer in kernel space and when I need to write or
read data from memory of user space, I try to use copy_from_user or
copy_to_user to get/put data. But I always get wrong data. I don't
know the reason. Would you guys give me some help?

Simple description of the code:

device_ioctl() {
     // get the pointer of memory of user space, and assign the
pointer to kernel variable.
}



device_xmit(){
     // when upper layer send a packet to this device.
     //  I try to use the copy_from_user to get some information from
user space buf
     // but I cannot get correct information.   
}

Thx

^ permalink raw reply	[flat|nested] 3+ messages in thread
* Re: Question about copy_from_user/copy_to_user
@ 2004-07-10 23:09 Paul Zimmerman
  0 siblings, 0 replies; 3+ messages in thread
From: Paul Zimmerman @ 2004-07-10 23:09 UTC (permalink / raw)
  To: qiuyu.zhang; +Cc: linux-kernel

>Hi all,
>
>I am working on a module driver. A user application alloc a bunch of

See http://www.xml.com/ldd/chapter/book/index.html

--
Paul

_________________________________________________________________
Get tips for maintaining your PC, notebook accessories and reviews in 
Technology 101. http://special.msn.com/tech/technology101.armx


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-07-11  1:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-10 20:44 Question about copy_from_user/copy_to_user Qiuyu Zhang
2004-07-11  1:59 ` Richard B. Johnson
  -- strict thread matches above, loose matches on Subject: below --
2004-07-10 23:09 Paul Zimmerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox