Block Special File Shopping
Node
Website Links For
Device
 

Information About

Block Special File





IMPLEMENTATION

By definition, device nodes correspond to resources that have already been allocated by the operating system Kernel . The resources are identified by a ''major number'' and a ''minor number'', which are stored as part of the structure of a node. The assignment of these numbers is specific to different Operating System s and Computer Platform s.

Like other special file types, device nodes are accessed using standard System Call s and treated like regular files. There are two standard types of device files, differentiated by the type of hardware with which they are designed to interface and the way the operating system processes input and output operations.


CHARACTER DEVICES


''Character special files'' or ''character devices'' are used to correspond to devices through which data is transmitted one character at a time. These device nodes are often used for Serial Communications devices such as teletype machines, virtual terminals, and serial modems.

In most implementations, character devices use ''unbuffered'' input and output routines. Each character is read from, or written to, the device immediately.


BLOCK DEVICES


''Block special files'' or ''block devices'' are used to correspond to devices through which data is transmitted in the form of Blocks . These device nodes are often used for Parallel Communications devices such as Hard Disk s and CD-ROM drives.

The most significant difference between block and character devices is that block devices use ''buffered'' input and output routines. The operating system allocates a Data Buffer to hold a single block each for input and output. When a program sends a request for data to be read from, or written to, the device, each character of that data is stored in the appropriate buffer. When the buffer is full and a complete block is achieved, the appropriate operation is performed and the buffer is cleared.


PSEUDO-DEVICES

Device nodes on Unix-like systems do not necessarily have to correspond to physical devices. Nodes that lack this correspondance are known as ''pseudo-devices''. They are used for various functions that are handled by the operating system. The following are some of the most commonly-used pseudo-devices:
; /dev/null :Accepts and discards all input; produces no output.
; /dev/random :Produces a variable-length stream of pseudo-random characters.
; /dev/zero :Produces a continuous stream of null (zero value) characters.


SEE ALSO