xref: /original-bsd/sbin/mknod/mknod.8 (revision 95ecee29)
1.\" Copyright (c) 1980, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)mknod.8	8.2 (Berkeley) 12/11/93
7.\"
8.Dd
9.Dt MKNOD 8
10.Os BSD 4
11.Sh NAME
12.Nm mknod
13.Nd build special file
14.Sh SYNOPSIS
15.Nm mknod
16.Ar name
17.Op Cm c | Cm b
18.Ar major minor
19.Sh DESCRIPTION
20The
21.Nm mknod
22command creates device special files.
23Normally the shell script
24.Pa /dev/MAKEDEV
25is used to create special files for commonly known devices; it executes
26.Nm mknod
27with the appropriate arguments and can make all the files required for the
28device.
29.Pp
30To make nodes manually, the four required arguments are:
31.Pp
32.Bl -tag -width majorx
33.It Ar name
34Device name, for example
35.Dq sd
36for a SCSI disk on an HP300 or a
37.Dq pty
38for pseudo-devices.
39.It Cm b | Cm c
40Type of device. If the
41device is a block type device such as a tape or disk drive which needs
42both cooked and raw special files,
43the type is
44.Cm b .
45All other devices are character type devices, such as terminal
46and pseudo devices, and are type
47.Cm c .
48.It Ar major
49The major device number is an integer number which tells the kernel
50which device driver entry point to use.  To learn what
51major device number to use for a particular device, check the file
52.Pa /dev/MAKEDEV
53to see if the device is known, or check
54the system dependent device configuration file:
55.Bd -filled -offset indent
56.Dq Pa /usr/src/sys/conf/device. Ns Em architecture
57.Ed
58.Pp
59(for example
60.Pa device.hp300 ) .
61.It Ar minor
62The minor device number tells the kernel which subunit
63the node corresponds to on the device; for example,
64a subunit may be a filesystem partition
65or a tty line.
66.El
67.Sh SEE ALSO
68.Xr mknod 2 ,
69.Xr makedev 8
70.Sh HISTORY
71A
72.Nm
73command appeared in Version 6 AT&T UNIX.
74