HP Visualize J210XC IRIX to HP-UX Migration Guide - Page 22
Major and Minor Numbers
View all HP Visualize J210XC manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 22 highlights
Devices C is the controller unit number of the MUX card. P is the port number on the MUX card. Ports are numbered starting with 0. Printers are usually numbered starting at 0 or 1. Examples /dev/tty0p3 /dev/lp0 Character device file for a terminal port on the first MUX at port 3 Character special file for the first printer (using a special printer card) added to the system Major and Minor Numbers Special files are identified by their name and major and minor numbers. You can look at this information when you do a long listing of the /dev directory. Consider the command # ls -l /dev/console /dev/*dsk and its output: crw--w--w- 1 root sys 0 0x000000 Aug 15 16:11 /dev/console /dev/dsk: total 0 brw-r----- 1 bin sys 31 0x002000 Aug 11 11:50 c0t2d0 brw-r----- 1 bin sys 31 0x005000 Aug 11 13:54 c0t5d0 brw-r----- 1 root sys 31 0x006000 Aug 11 11:56 c0t6d0 /dev/rdsk: total 0 crw-r----- 1 bin sys 188 0x002000 Aug 11 11:50 c0t2d0 crw-r----- 1 bin sys 188 0x005000 Aug 11 13:54 c0t5d0 crw-r----- 1 root sys 188 0x006000 Aug 11 11:50 c0t6d0 The first character of each line identifies the type of device file. A b denotes a block device, and a c indicates a character device. A block device transfers data a block at a time by using the system buffers. A disk drive holding a mountable file system is an example of a block device. A character device reads or writes data one character at a time. Tape drives are usually character devices. Some devices are capable of I/O in both block and character mode. Such devices require two device files: one for block and one for character mode. A hard disk is an example of a device which uses both character and block device files. For purposes of mounting the disk as a file system, use the block device file. For purposes of accessing the disk for backups, use the character device file. The major and minor numbers appear immediately before the date. The major number identifies what kernel driver is being referred to by the device file. The value chosen for the major number is based on both the device driver and the access method (block or character). For devices needing both a character and block device file, there are different character major numbers and block major numbers. You can use the lsdev command to list the device drivers and their major numbers in the system. For # lsdev, for example: Character 0 1 3 16 17 46 52 56 60 64 66 Block -1 -1 -1 -1 -1 -1 -1 -1 -1 64 -1 Driver cn asio0 mm ptym ptys netdiag1 lan2 ni netman lv audio Class pseudo tty pseudo ptym ptys unknown lan unknown unknown lvm audio 17