My question is related to the way device nodes are implemented in Linux. I know there are pseudo files systems like udev or devtmpfs available - in this case there is no real storage behind and the file system is an illusion presented to applications by kernel drivers. However, my questions remain valid for:
- The way /dev is visible to user space in case devtmpfs or udev is used.
- The case where /dev is a regular directory containing manually created device nodes.
The questions are:
- Are device nodes files stored in file systems (inodes used) or are they just special entries in directories?
- If they are stored as files, how are they distinguished from binary files? Do device nodes have special magic number assigned?