Basic Concepts of Devices
Devices are either block devices or character devices. A character device is one from which you can read a sequence of characters—for example, the sequence of keys typed at a keyboard or the sequence of bytes sent over a serial line. Character devices are sometimes referred to as sequentially accessed devices. A block device is one that stores data and offers access to all parts of it equally; diskettes and hard disks are block devices. Block devices are sometimes called random access devices.
When you perform some operation on a file, the kernel can tell that the file involved is a device by looking at its file mode (not its location). Different major and minor device numbers distinguishes the device nodes. The major ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access