blob: 7fadc05330dd7c6be3c689cd63bf671c80300e5b [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -03002Linux allocated devices (4.x+ version)
3======================================
Linus Torvalds1da177e2005-04-16 15:20:36 -07004
5This list is the Linux Device List, the official registry of allocated
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -03006device numbers and ``/dev`` directory nodes for the Linux operating
Linus Torvalds1da177e2005-04-16 15:20:36 -07007system.
8
Linus Walleijebdf4042016-02-19 21:17:36 +01009The LaTeX version of this document is no longer maintained, nor is
10the document that used to reside at lanana.org. This version in the
11mainline Linux kernel is the master document. Updates shall be sent
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -030012as patches to the kernel maintainers (see the
Mauro Carvalho Chehab8c27ceff32016-10-18 10:12:27 -020013:ref:`Documentation/process/submitting-patches.rst <submittingpatches>` document).
Linus Walleijebdf4042016-02-19 21:17:36 +010014Specifically explore the sections titled "CHAR and MISC DRIVERS", and
15"BLOCK LAYER" in the MAINTAINERS file to find the right maintainers
16to involve for character and block devices.
Linus Torvalds1da177e2005-04-16 15:20:36 -070017
18This document is included by reference into the Filesystem Hierarchy
19Standard (FHS). The FHS is available from http://www.pathname.com/fhs/.
20
21Allocations marked (68k/Amiga) apply to Linux/68k on the Amiga
22platform only. Allocations marked (68k/Atari) apply to Linux/68k on
23the Atari platform only.
24
Linus Walleijebdf4042016-02-19 21:17:36 +010025This document is in the public domain. The authors requests, however,
Linus Torvalds1da177e2005-04-16 15:20:36 -070026that semantically altered versions are not distributed without
Linus Walleijebdf4042016-02-19 21:17:36 +010027permission of the authors, assuming the authors can be contacted without
Linus Torvalds1da177e2005-04-16 15:20:36 -070028an unreasonable effort.
29
Linus Torvalds1da177e2005-04-16 15:20:36 -070030
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -030031.. attention::
Linus Torvalds1da177e2005-04-16 15:20:36 -070032
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -030033 DEVICE DRIVERS AUTHORS PLEASE READ THIS
Linus Walleijebdf4042016-02-19 21:17:36 +010034
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -030035 Linux now has extensive support for dynamic allocation of device numbering
36 and can use ``sysfs`` and ``udev`` (``systemd``) to handle the naming needs.
37 There are still some exceptions in the serial and boot device area. Before
38 asking for a device number make sure you actually need one.
Linus Torvalds1da177e2005-04-16 15:20:36 -070039
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -030040 To have a major number allocated, or a minor number in situations
41 where that applies (e.g. busmice), please submit a patch and send to
42 the authors as indicated above.
Linus Torvalds1da177e2005-04-16 15:20:36 -070043
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -030044 Keep the description of the device *in the same format
45 as this list*. The reason for this is that it is the only way we have
46 found to ensure we have all the requisite information to publish your
47 device and avoid conflicts.
Linus Torvalds1da177e2005-04-16 15:20:36 -070048
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -030049 Finally, sometimes we have to play "namespace police." Please don't be
50 offended. We often get submissions for ``/dev`` names that would be bound
51 to cause conflicts down the road. We are trying to avoid getting in a
52 situation where we would have to suffer an incompatible forward
53 change. Therefore, please consult with us **before** you make your
54 device names and numbers in any way public, at least to the point
55 where it would be at all difficult to get them changed.
Linus Torvalds1da177e2005-04-16 15:20:36 -070056
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -030057 Your cooperation is appreciated.
Linus Torvalds1da177e2005-04-16 15:20:36 -070058
Jani Nikula07c7e302016-11-03 12:11:50 +020059.. include:: devices.txt
60 :literal:
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -030061
62Additional ``/dev/`` directory entries
63--------------------------------------
Linus Torvalds1da177e2005-04-16 15:20:36 -070064
65This section details additional entries that should or may exist in
66the /dev directory. It is preferred that symbolic links use the same
67form (absolute or relative) as is indicated here. Links are
68classified as "hard" or "symbolic" depending on the preferred type of
69link; if possible, the indicated type of link should be used.
70
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -030071Compulsory links
72++++++++++++++++
Linus Torvalds1da177e2005-04-16 15:20:36 -070073
74These links should exist on all systems:
75
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -030076=============== =============== =============== ===============================
Linus Torvalds1da177e2005-04-16 15:20:36 -070077/dev/fd /proc/self/fd symbolic File descriptors
78/dev/stdin fd/0 symbolic stdin file descriptor
79/dev/stdout fd/1 symbolic stdout file descriptor
80/dev/stderr fd/2 symbolic stderr file descriptor
81/dev/nfsd socksys symbolic Required by iBCS-2
82/dev/X0R null symbolic Required by iBCS-2
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -030083=============== =============== =============== ===============================
Linus Torvalds1da177e2005-04-16 15:20:36 -070084
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -030085Note: ``/dev/X0R`` is <letter X>-<digit 0>-<letter R>.
Linus Torvalds1da177e2005-04-16 15:20:36 -070086
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -030087Recommended links
88+++++++++++++++++
Linus Torvalds1da177e2005-04-16 15:20:36 -070089
90It is recommended that these links exist on all systems:
91
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -030092
93=============== =============== =============== ===============================
Linus Torvalds1da177e2005-04-16 15:20:36 -070094/dev/core /proc/kcore symbolic Backward compatibility
95/dev/ramdisk ram0 symbolic Backward compatibility
96/dev/ftape qft0 symbolic Backward compatibility
97/dev/bttv0 video0 symbolic Backward compatibility
98/dev/radio radio0 symbolic Backward compatibility
99/dev/i2o* /dev/i2o/* symbolic Backward compatibility
100/dev/scd? sr? hard Alternate SCSI CD-ROM name
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -0300101=============== =============== =============== ===============================
Linus Torvalds1da177e2005-04-16 15:20:36 -0700102
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -0300103Locally defined links
104+++++++++++++++++++++
Linus Torvalds1da177e2005-04-16 15:20:36 -0700105
106The following links may be established locally to conform to the
107configuration of the system. This is merely a tabulation of existing
108practice, and does not constitute a recommendation. However, if they
109exist, they should have the following uses.
110
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -0300111=============== =============== =============== ===============================
Linus Torvalds1da177e2005-04-16 15:20:36 -0700112/dev/mouse mouse port symbolic Current mouse device
113/dev/tape tape device symbolic Current tape device
114/dev/cdrom CD-ROM device symbolic Current CD-ROM device
115/dev/cdwriter CD-writer symbolic Current CD-writer device
116/dev/scanner scanner symbolic Current scanner device
117/dev/modem modem port symbolic Current dialout device
118/dev/root root device symbolic Current root filesystem
119/dev/swap swap device symbolic Current swap device
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -0300120=============== =============== =============== ===============================
Linus Torvalds1da177e2005-04-16 15:20:36 -0700121
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -0300122``/dev/modem`` should not be used for a modem which supports dialin as
Linus Torvalds1da177e2005-04-16 15:20:36 -0700123well as dialout, as it tends to cause lock file problems. If it
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -0300124exists, ``/dev/modem`` should point to the appropriate primary TTY device
Linus Torvalds1da177e2005-04-16 15:20:36 -0700125(the use of the alternate callout devices is deprecated).
126
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -0300127For SCSI devices, ``/dev/tape`` and ``/dev/cdrom`` should point to the
128*cooked* devices (``/dev/st*`` and ``/dev/sr*``, respectively), whereas
129``/dev/cdwriter`` and /dev/scanner should point to the appropriate generic
Linus Torvalds1da177e2005-04-16 15:20:36 -0700130SCSI devices (/dev/sg*).
131
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -0300132``/dev/mouse`` may point to a primary serial TTY device, a hardware mouse
133device, or a socket for a mouse driver program (e.g. ``/dev/gpmdata``).
Linus Torvalds1da177e2005-04-16 15:20:36 -0700134
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -0300135Sockets and pipes
136+++++++++++++++++
Linus Torvalds1da177e2005-04-16 15:20:36 -0700137
138Non-transient sockets and named pipes may exist in /dev. Common entries are:
139
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -0300140=============== =============== ===============================================
Linus Torvalds1da177e2005-04-16 15:20:36 -0700141/dev/printer socket lpd local socket
142/dev/log socket syslog local socket
143/dev/gpmdata socket gpm mouse multiplexer
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -0300144=============== =============== ===============================================
Linus Torvalds1da177e2005-04-16 15:20:36 -0700145
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -0300146Mount points
147++++++++++++
Linus Torvalds1da177e2005-04-16 15:20:36 -0700148
149The following names are reserved for mounting special filesystems
150under /dev. These special filesystems provide kernel interfaces that
151cannot be provided with standard device nodes.
152
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -0300153=============== =============== ===============================================
Linus Torvalds1da177e2005-04-16 15:20:36 -0700154/dev/pts devpts PTY slave filesystem
155/dev/shm tmpfs POSIX shared memory maintenance access
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -0300156=============== =============== ===============================================
Linus Torvalds1da177e2005-04-16 15:20:36 -0700157
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -0300158Terminal devices
159----------------
Linus Torvalds1da177e2005-04-16 15:20:36 -0700160
161Terminal, or TTY devices are a special class of character devices. A
162terminal device is any device that could act as a controlling terminal
163for a session; this includes virtual consoles, serial ports, and
164pseudoterminals (PTYs).
165
166All terminal devices share a common set of capabilities known as line
Matt LaPlantefff92892006-10-03 22:47:42 +0200167disciplines; these include the common terminal line discipline as well
Linus Torvalds1da177e2005-04-16 15:20:36 -0700168as SLIP and PPP modes.
169
170All terminal devices are named similarly; this section explains the
171naming and use of the various types of TTYs. Note that the naming
172conventions include several historical warts; some of these are
173Linux-specific, some were inherited from other systems, and some
174reflect Linux outgrowing a borrowed convention.
175
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -0300176A hash mark (``#``) in a device name is used here to indicate a decimal
Linus Torvalds1da177e2005-04-16 15:20:36 -0700177number without leading zeroes.
178
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -0300179Virtual consoles and the console device
180+++++++++++++++++++++++++++++++++++++++
Linus Torvalds1da177e2005-04-16 15:20:36 -0700181
182Virtual consoles are full-screen terminal displays on the system video
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -0300183monitor. Virtual consoles are named ``/dev/tty#``, with numbering
184starting at ``/dev/tty1``; ``/dev/tty0`` is the current virtual console.
185``/dev/tty0`` is the device that should be used to access the system video
Linus Torvalds1da177e2005-04-16 15:20:36 -0700186card on those architectures for which the frame buffer devices
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -0300187(``/dev/fb*``) are not applicable. Do not use ``/dev/console``
Linus Torvalds1da177e2005-04-16 15:20:36 -0700188for this purpose.
189
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -0300190The console device, ``/dev/console``, is the device to which system
Linus Torvalds1da177e2005-04-16 15:20:36 -0700191messages should be sent, and on which logins should be permitted in
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -0300192single-user mode. Starting with Linux 2.1.71, ``/dev/console`` is managed
Linus Torvalds1da177e2005-04-16 15:20:36 -0700193by the kernel; for previous versions it should be a symbolic link to
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -0300194either ``/dev/tty0``, a specific virtual console such as ``/dev/tty1``, or to
195a serial port primary (``tty*``, not ``cu*``) device, depending on the
Linus Torvalds1da177e2005-04-16 15:20:36 -0700196configuration of the system.
197
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -0300198Serial ports
199++++++++++++
Linus Torvalds1da177e2005-04-16 15:20:36 -0700200
201Serial ports are RS-232 serial ports and any device which simulates
202one, either in hardware (such as internal modems) or in software (such
203as the ISDN driver.) Under Linux, each serial ports has two device
204names, the primary or callin device and the alternate or callout one.
205Each kind of device is indicated by a different letter. For any
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -0300206letter X, the names of the devices are ``/dev/ttyX#`` and ``/dev/cux#``,
207respectively; for historical reasons, ``/dev/ttyS#`` and ``/dev/ttyC#``
208correspond to ``/dev/cua#`` and ``/dev/cub#``. In the future, it should be
Linus Torvalds1da177e2005-04-16 15:20:36 -0700209expected that multiple letters will be used; all letters will be upper
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -0300210case for the "tty" device (e.g. ``/dev/ttyDP#``) and lower case for the
211"cu" device (e.g. ``/dev/cudp#``).
Linus Torvalds1da177e2005-04-16 15:20:36 -0700212
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -0300213The names ``/dev/ttyQ#`` and ``/dev/cuq#`` are reserved for local use.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700214
215The alternate devices provide for kernel-based exclusion and somewhat
216different defaults than the primary devices. Their main purpose is to
217allow the use of serial ports with programs with no inherent or broken
218support for serial ports. Their use is deprecated, and they may be
219removed from a future version of Linux.
220
221Arbitration of serial ports is provided by the use of lock files with
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -0300222the names ``/var/lock/LCK..ttyX#``. The contents of the lock file should
Linus Torvalds1da177e2005-04-16 15:20:36 -0700223be the PID of the locking process as an ASCII number.
224
225It is common practice to install links such as /dev/modem
226which point to serial ports. In order to ensure proper locking in the
227presence of these links, it is recommended that software chase
228symlinks and lock all possible names; additionally, it is recommended
229that a lock file be installed with the corresponding alternate
230device. In order to avoid deadlocks, it is recommended that the locks
231are acquired in the following order, and released in the reverse:
232
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -0300233 1. The symbolic link name, if any (``/var/lock/LCK..modem``)
234 2. The "tty" name (``/var/lock/LCK..ttyS2``)
235 3. The alternate device name (``/var/lock/LCK..cua2``)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700236
237In the case of nested symbolic links, the lock files should be
238installed in the order the symlinks are resolved.
239
240Under no circumstances should an application hold a lock while waiting
241for another to be released. In addition, applications which attempt
242to create lock files for the corresponding alternate device names
243should take into account the possibility of being used on a non-serial
244port TTY, for which no alternate device would exist.
245
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -0300246Pseudoterminals (PTYs)
247++++++++++++++++++++++
Linus Torvalds1da177e2005-04-16 15:20:36 -0700248
249Pseudoterminals, or PTYs, are used to create login sessions or provide
Matt LaPlantefff92892006-10-03 22:47:42 +0200250other capabilities requiring a TTY line discipline (including SLIP or
Linus Torvalds1da177e2005-04-16 15:20:36 -0700251PPP capability) to arbitrary data-generation processes. Each PTY has
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -0300252a master side, named ``/dev/pty[p-za-e][0-9a-f]``, and a slave side, named
253``/dev/tty[p-za-e][0-9a-f]``. The kernel arbitrates the use of PTYs by
Linus Torvalds1da177e2005-04-16 15:20:36 -0700254allowing each master side to be opened only once.
255
256Once the master side has been opened, the corresponding slave device
257can be used in the same manner as any TTY device. The master and
258slave devices are connected by the kernel, generating the equivalent
259of a bidirectional pipe with TTY capabilities.
260
261Recent versions of the Linux kernels and GNU libc contain support for
262the System V/Unix98 naming scheme for PTYs, which assigns a common
Mauro Carvalho Chehabd9f92f92016-09-21 15:47:58 -0300263device, ``/dev/ptmx``, to all the masters (opening it will automatically
264give you a previously unassigned PTY) and a subdirectory, ``/dev/pts``,
265for the slaves; the slaves are named with decimal integers (``/dev/pts/#``
Linus Torvalds1da177e2005-04-16 15:20:36 -0700266in our notation). This removes the problem of exhausting the
267namespace and enables the kernel to automatically create the device
268nodes for the slaves on demand using the "devpts" filesystem.