Difference between revisions of "Device"

From Hackepedia
Jump to navigationJump to search
(attempt at explanation of devices)
 
Line 1: Line 1:
devices are found in /dev, there is block devices and character devicesBlock devices are also called cooked devices because character devices are also called raw devices.  Confused yet?  Let's look at why there is block and character devices.  Terminals handle one character at a time so they are character devices.  Tape drives handle data in blocks so they are a block device.
+
Devices are found in the /dev directoryThere are several types of devices:
 +
 
 +
* '''block devices''' -- A.K.A "cooked" devices.  Data stored on the device is typically accessed in groups, instead of one byte at a time.  Hard drives, tape systems, and other mass-storage devices are almost always block devices.  Data is more or less random-access (although performance may suffer greatly, as in the case of a tape).
 +
* '''character devices''' -- Data is usually managed in a stream.  Serial, audio, and most other non-storage devices fall into this category.
 +
* '''sockets''' -- File-like interfaces to network resources.  Someone add more. :)
 +
* '''pipes''' -- A "named pipe."  See [[FIFO]]

Revision as of 15:30, 20 January 2006

Devices are found in the /dev directory. There are several types of devices:

  • block devices -- A.K.A "cooked" devices. Data stored on the device is typically accessed in groups, instead of one byte at a time. Hard drives, tape systems, and other mass-storage devices are almost always block devices. Data is more or less random-access (although performance may suffer greatly, as in the case of a tape).
  • character devices -- Data is usually managed in a stream. Serial, audio, and most other non-storage devices fall into this category.
  • sockets -- File-like interfaces to network resources. Someone add more. :)
  • pipes -- A "named pipe." See FIFO