The device directory contains all of the device files. Device files are used to represent devices attached to the system. Each device file has a major and a minor number. The major number of a device file represents a device driver built into the HP-UX kernel, while the minor number represents the device's hardware address and ( optionally ) certain device-specific options. An instance means a logical numbering of the same type of devices. For example, there may be more than one SCSI disk in a system. All of these SCSI disks use the same device drivers but represent different instances of disks and have different minor numbers .
We will be discussing more about device files in Chapter 17. At the moment, however, it is useful to mention that the device directory contains many subdirectories depending on the types of devices. This is used to group device files in a more logical way. Files related to one type of device are kept in one subdirectory under /dev . Figure 8-2 shows some of these subdirectories.
As an example, the directory /dev/rdsk contains all of the device files that represent character-based or raw devices related to physical disks. The directory /dev/dsk contains block devices for these disks. Similarly, all volume groups have their own directories in /dev that contain device files for logical volumes. We will see more about logical volumes in Chapter 18. Files starting with tty in the /dev directory represent terminal types.
Almost all of the files in the /dev directory are special files, and if you take a listing with the ll command, you will find a special character in the first column of the output showing whether a file represents a character-type device, block device, or something else. A listing of /dev/rdsk is presented as an example here.
$ ll /dev/rdsk total 0 crw-r----- 1 bin sys 188 0x003000 Nov 25 1998 c0t3d0 crw-r----- 1 bin sys 188 0x004000 Nov 25 1998 c0t4d0 crw-r----- 1 bin sys 188 0x005000 Nov 25 1998 c0t5d0 crw-r----- 1 bin sys 188 0x006000 Oct 5 16:57 c0t6d0 crw-r----- 1 bin sys 188 0x0a0000 Aug 31 13:40 c10t0d0 crw-r----- 1 bin sys 188 0x0a0100 Aug 31 13:40 c10t0d1 crw-r----- 1 bin sys 188 0x0a0200 Aug 31 13:40 c10t0d2 crw-r----- 1 bin sys 188 0x0a0300 Aug 31 13:40 c10t0d3 crw-r----- 1 bin sys 188 0x0a0400 Aug 31 13:40 c10t0d4 crw-r----- 1 bin sys 188 0x0a0500 Aug 31 13:40 c10t0d5 crw-r----- 1 bin sys 188 0x0a0600 Aug 31 13:40 c10t0d6 crw-r----- 1 bin sys 188 0x0a0700 Aug 31 13:40 c10t0d7 crw-r----- 1 bin sys 188 0x0a1000 Aug 31 13:40 c10t1d0 crw-r----- 1 bin sys 188 0x0a1100 Sep 19 04:58 c10t1d1 $
As you can see, all of these are character-type devices.