Hi,
I'm trying to use the copy_from_user in kernel mode to copy a message from user's buffer
this is the function for copy from user:
Code:
asmlinkage long copyFrom(unsigned char *data, long length){
unsigned char *content;
content = kmalloc(length, GFP_KERNEL);
copy_from_user(content, data, length);
...
return 0;
}
Now I'm trying to display the data passed by user but if keeps giving me weird number
I tried using printk with %c %x %s but none works
Code:
printk("data: %c" *content");
printk("data: %x" *content");
The data I passed to this function is something like
data[]{0x34, 0x65, 0x14} and sizeof(data)
So how should I retrieve the correct data in the kernel mode? what should the printk be like?
thanks