In Chapter 3, Working with Char Drivers, we discussed the file abstraction and mentioned that a char driver is very similar to a usual file, from the user space point of view. However, it's not a file at all; it is used as a file but it belongs to a peripheral, and, usually, peripherals need to be configured to work correctly, due to the fact they may support different methods of operation.
Let's consider, for instance, a serial port; it looks like a file where we can (forever) read or write using both the read() and write() system calls, but to do so, in most cases, we must also set some communication parameters such as the baud rate, parity bit, and so on. Of course, these parameters can't be set with read() or write(), nor by using the open() system call (even if it can set some accessing modes as read or write only), so the...