mknod
PURPOSE
Creates a special file.
SYNOPSIS
/etc/mknod name b major minor
/etc/mknod name c major minor
/etc/mknod name p
DESCRIPTION
The mknod command makes a directory entry and corre-
sponding i-node for a special file. The first parameter
is the name of the entry device. Select a name that is
descriptive of the device.
The mknod command has two forms. In the first case, the
second argument is b or c. b indicates that the special
file is a block-oriented device (disk, diskette, tape).
c indicates that it is a character-oriented device (other
devices). The last two parameters are numbers specifying
the major device, which helps the operating system find
the device driver code, and the minor device, that is,
the unit drive, or line number, which may be either
decimal or octal.
The assignment of major device numbers is specific to
each system. Device numbers are determined by examining
the system source file conf.c.
Note: If you change the contents of conf.c to add a
device driver, you must rebuild the operating system.
See the discussion of device drivers in AIX Operating
System Programming Tools and Interfaces and in AIX Oper-
ating System Technical Reference.
The second form of mknod is used to create FIFOs (named
pipes). The p flag after device indicates that you are
creating a named pipe. See the AIX Operating System
Technical Reference for an explanation of FIFOs and named
pipes.
EXAMPLE
To create the special file for a new diskette drive:
mknod /dev/fd2 b 1 2
This creates the special file /dev/fd2, which is a block
special file with major device number "1" and minor
device number "2".
RELATED INFORMATION
The mknod file and device driver description in AIX Oper-
ating System Technical Reference.
The discussion of device drivers in AIX Operating System
Programming Tools and Interfaces.