Configuring HP-UX For Peripherals

288 AppendixC
Major and Minor Numbers
Creating Device Special Files using mknod
Creating Device Special Files using mknod
To create device special files for any driver other than those listed on the
insf and mksf manpages, use mknod.
Step 1. Change directory to /dev.
Step 2. Determine the major number by invoking the lsdev command.
Step 3. Construct a minor numberfor the device by using the bit assignments for
the device driver. For HP devices, the bit assignments are found in tables
earlier in this Appendix. For custom device drivers, consult
documentation supplied with the driver.
Step 4. Create the device special files for the device using the following syntax:
/usr/sbin/mknod <file_name> b|c <major#> <minor#>
Name the file something easily associated with the device.
Use b for block device special file or c for character device special file.
Make files for both block and character if driver supports both.
Use the block or character major number reported by lsdev.
Use the minor number constructed from the bit assignment tables.
For example, the scope device driver has block and character major
numbers of 65 and 234 respectively. Its minor number of 0x026000 is
constructed like instr0 (see Table C-7, “Bit Assignments for
Miscellaneous Devices.”) Bits 8 through 15 encode 2 as the card instance
of the interface card and bits 16 through 19 encode 6 as the instrument
address.
/usr/sbin/mknod /dev/scope b 65 0x026000
/usr/sbin/mknod /dev/c_scope c 234 0x026000
Step 5. Verify the configuration by invoking ioscan with the -fun or fkn option.
If created properly, the new device special files will be displayed with the
configured device.