This is the following step of "Character Device".
Implement the read and write interface between user and kernel space of the file operation.
-
copy_from_user: Copy a block of data from user space into kernel space.
-
copy_to_user: Copy a block of data into user space from kernel space.
-
Why not access the buffer in the arguments directly? http://stackoverflow.com/questions/12666493/why-do-you-have-to-use-copy-to-user-copy-from-user-to-access-user-space-from
makeinsmod example.kodmesgmknod /dev/example c 60 0chmod 666 /dev/example(for accessing from other users)- Do some file operations with the /dev/example, like file open, read, write, close.
dmesgrmmod example.korm /dev/examplemake clean