find . -name 'mystring*'

There are 2 ways to implement communicationn between user and kernel program:

(1) via a file in the /proc file system. /proc is a pseudo-file system, where reads from files return data manufactured by the kernel, and data written to files is read and handled by the kernel. Before /proc, all user-kernel communication had to happen through a system call. Using a system call meant choosing between finding a system call that already behaved the way you needed (often not possible),

(register with the /proc subsystem in our module initialization function.)

(2)using a device special file

e.g hello_read() is the function called when a process calls read() on /dev/hello. It writes "Hello, world!" to the buffer passed in theread() call.

through special files,in our example test_chardev.c

ret = write(fd, buf, strlen(buf));

it will uses the function device_write()

static ssize_t

device_write(struct file *filp, const char *buff, size_t len, loff_t * off)


printk(KERN_ALERT "Sorry, this operation isn't supported.\n");

return -EINVAL;


realized copy data from user buffer to kernel buffer through special file