Hello,

I tried to pass "string" parameter from user to kernel and the driver
never get the parameter correctly.

I have read following link as a reference:

http://tldp.org/LDP/lkmpg/2.6/html/x892.html

Then I modify get_user() with copy_from_user() as follow:

char *tmp = kmalloc(sizeof(char), GFP_KERNEL);

if (copy_from_user(tmp, (unsigned long *) param), sizeof (tmp)) {
        return -EFAULT;
}

It always failed to copy user data. Did I miss anything?

In addition, I also tried it on embedded system to pass int and struct
data types with success but passing string always failed (I use 2.6.28
kernel on MIPS 4KSd family). What is the constraint on passing
parameter from user to kernel especially for "string" data type? Is it
a must to pass it via write() file operations?

I appreciate any comments or suggestions, Thanks in advance.

Regards,
DWI
-- 
"A mathematician is a device for turning coffee into theorems." - Paul Erdos

Contacts:
    +62 857 8038 8298
    +62 813 9876 6576

Skype: dwi.sasongko
GTalk: ruckuus

-- 
unsubscribe: [email protected]
website: http://groups.google.com/group/android-kernel

Reply via email to