Working with disks, tapes, and CD-ROMs

Using UNIX devices

The SCO OpenServer system sees every piece of equipment attached to the computer as a file; it communicates with it by reading from and writing to a special device file located in the /dev directory. Each type of device has its own device file, which in turn points to a piece of software called a device driver, which is linked into the kernel.

A huge number of device drivers have been written for UNIX systems. One way of controlling the ``footprint'' of a UNIX implementation (the amount of memory taken up by the system) is to limit the number of device drivers in the kernel: for example, a normal office system is unlikely to require the driver for a barcode reader. There are, however, device drivers that can be loaded into the system when needed. The SCO OpenServer system supports ``boot-time loadable drivers'' (BTLD's): these are described in ``Using Boot-Time Loadable Drivers''.

Two types of device file are supplied in /dev, those for the character devices (also known as ``raw'' devices), and those for the block devices (also known as ``buffered''). The former handle input/output operations of arbitrary size while the latter operate through fixed size buffers.

Some devices may supply both types of interface, and thus have two separate device files in /dev. Typically, disk devices supply both, and the following entries will appear in a long listing:

   $ ls -l
   brw-rw-rw-   6 bin      bin        2, 52 Mar 24  1993 fd096ds15
   crw-rw-rw-   5 bin      bin        2, 52 Mar 24  1993 rfd096ds15
In this case, the one floppy disk drive supplies both a block interface, fd096ds15, and a raw interface, rfd096ds15. Note also the first character position of the listing: the ``b'' and ``c'' indicate ``block'' and ``character'' respectively. See ls(C) for more details of file types; for more information on devices, refer to the SCO OpenServer Handbook.
Next topic: Identifying device files
Previous topic: Working with disks, tapes, and CD-ROMs

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003