Standard Operations for Character Devices

The situation with character devices is initially very unclear because only a single file operation is made available.

6 For the sake of simplicity, I omit the creation of inodes for sockets and fifos as these are not relevant in this context.

fs/devices.c struct file_operations def_chr_fops = { .open = chrdev_open,

Character devices differ considerably. The kernel cannot therefore initially provide more than one operation because each device file requires a separate, custom set of operations. The main task of the chrdev_open function is therefore to fill the structure with the missing function pointers appropriate to the opened device so that meaningful operations can be performed on the device file and ultimately on the device itself.

Continue reading here: Standard Operations for Block Devices

Was this article helpful?

0 0