When we introduced device drivers we said that they lay under the Unix file abstraction; that is, in a Unix-like OS, everything is a file. Now, it's time to verify it, so let's see what happens if we try to execute some file-related utility programs against our new driver.
Thanks to our latest modifications to the chrdev_legacy.c file, our driver simulates a file 300 bytes long (see the chrdev_buf[BUF_LEN] buffer where BUF_LEN is set to 300), where we're able to execute read() and write() system calls on it, just as we do on a normal file.
However, we may still have some doubts, so let's consider standard cat or dd commands, as we know they are utilities useful to manipulate files content. For example...