~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/Documentation/admin-guide/serial-console.rst

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /Documentation/admin-guide/serial-console.rst (Version linux-6.12-rc7) and /Documentation/admin-guide/serial-console.rst (Version linux-4.18.20)


  1 .. _serial_console:                                 1 .. _serial_console:
  2                                                     2 
  3 Linux Serial Console                                3 Linux Serial Console
  4 ====================                                4 ====================
  5                                                     5 
  6 To use a serial port as console you need to co      6 To use a serial port as console you need to compile the support into your
  7 kernel - by default it is not compiled in. For      7 kernel - by default it is not compiled in. For PC style serial ports
  8 it's the config option next to menu option:         8 it's the config option next to menu option:
  9                                                     9 
 10 :menuselection:`Character devices --> Serial d     10 :menuselection:`Character devices --> Serial drivers --> 8250/16550 and compatible serial support --> Console on 8250/16550 and compatible serial port`
 11                                                    11 
 12 You must compile serial support into the kerne     12 You must compile serial support into the kernel and not as a module.
 13                                                    13 
 14 It is possible to specify multiple devices for     14 It is possible to specify multiple devices for console output. You can
 15 define a new kernel command line option to sel     15 define a new kernel command line option to select which device(s) to
 16 use for console output.                            16 use for console output.
 17                                                    17 
 18 The format of this option is::                     18 The format of this option is::
 19                                                    19 
 20         console=device,options                     20         console=device,options
 21                                                    21 
 22         device:         tty0 for the foregroun     22         device:         tty0 for the foreground virtual console
 23                         ttyX for any other vir     23                         ttyX for any other virtual console
 24                         ttySx for a serial por     24                         ttySx for a serial port
 25                         lp0 for the first para     25                         lp0 for the first parallel port
 26                         ttyUSB0 for the first      26                         ttyUSB0 for the first USB serial device
 27                                                    27 
 28         options:        depend on the driver.      28         options:        depend on the driver. For the serial port this
 29                         defines the baudrate/p     29                         defines the baudrate/parity/bits/flow control of
 30                         the port, in the forma     30                         the port, in the format BBBBPNF, where BBBB is the
 31                         speed, P is parity (n/     31                         speed, P is parity (n/o/e), N is number of bits,
 32                         and F is flow control      32                         and F is flow control ('r' for RTS). Default is
 33                         9600n8. The maximum ba     33                         9600n8. The maximum baudrate is 115200.
 34                                                    34 
 35 You can specify multiple console= options on t     35 You can specify multiple console= options on the kernel command line.
 36                                                !!  36 Output will appear on all of them. The last device will be used when
 37 The behavior is well defined when each device  !!  37 you open ``/dev/console``. So, for example::
 38 In this case, the output will appear on all re << 
 39 the last device will be used when you open ``/ << 
 40 So, for example::                              << 
 41                                                    38 
 42         console=ttyS1,9600 console=tty0            39         console=ttyS1,9600 console=tty0
 43                                                    40 
 44 defines that opening ``/dev/console`` will get     41 defines that opening ``/dev/console`` will get you the current foreground
 45 virtual console, and kernel messages will appe     42 virtual console, and kernel messages will appear on both the VGA
 46 console and the 2nd serial port (ttyS1 or COM2     43 console and the 2nd serial port (ttyS1 or COM2) at 9600 baud.
 47                                                    44 
 48 The behavior is more complicated when the same !!  45 Note that you can only define one console per device type (serial, video).
 49 times. In this case, there are the following t << 
 50                                                << 
 51 1. The output will appear only on the first de << 
 52                                                << 
 53 2. ``/dev/console`` will be associated with th << 
 54    Where the registration order depends on how << 
 55    subsystems.                                 << 
 56                                                << 
 57    This rule is used also when the last consol << 
 58    for other reasons. For example, because of  << 
 59    the hardware is not available.              << 
 60                                                << 
 61 The result might be surprising. For example, t << 
 62 lines have the same result::                   << 
 63                                                << 
 64         console=ttyS1,9600 console=tty0 consol << 
 65         console=tty0 console=ttyS1,9600 consol << 
 66                                                << 
 67 The kernel messages are printed only on ``tty0 << 
 68 ``/dev/console`` gets associated with ``tty0`` << 
 69 tries to register graphical consoles before se << 
 70 because of the default behavior when no consol << 
 71 see below.                                     << 
 72                                                << 
 73 Note that the last ``console=tty1`` parameter  << 
 74 The kernel command line is used also by system << 
 75 defined ``tty1`` as the login console.         << 
 76                                                    46 
 77 If no console device is specified, the first d     47 If no console device is specified, the first device found capable of
 78 acting as a system console will be used. At th     48 acting as a system console will be used. At this time, the system
 79 first looks for a VGA card and then for a seri     49 first looks for a VGA card and then for a serial port. So if you don't
 80 have a VGA card in your system the first seria     50 have a VGA card in your system the first serial port will automatically
 81 become the console.                                51 become the console.
 82                                                    52 
 83 You will need to create a new device to use ``     53 You will need to create a new device to use ``/dev/console``. The official
 84 ``/dev/console`` is now character device 5,1.      54 ``/dev/console`` is now character device 5,1.
 85                                                    55 
 86 (You can also use a network device as a consol     56 (You can also use a network device as a console.  See
 87 ``Documentation/networking/netconsole.rst`` fo !!  57 ``Documentation/networking/netconsole.txt`` for information on that.)
 88                                                    58 
 89 Here's an example that will use ``/dev/ttyS1``     59 Here's an example that will use ``/dev/ttyS1`` (COM2) as the console.
 90 Replace the sample values as needed.               60 Replace the sample values as needed.
 91                                                    61 
 92 1. Create ``/dev/console`` (real console) and      62 1. Create ``/dev/console`` (real console) and ``/dev/tty0`` (master virtual
 93    console)::                                      63    console)::
 94                                                    64 
 95      cd /dev                                       65      cd /dev
 96      rm -f console tty0                            66      rm -f console tty0
 97      mknod -m 622 console c 5 1                    67      mknod -m 622 console c 5 1
 98      mknod -m 622 tty0 c 4 0                       68      mknod -m 622 tty0 c 4 0
 99                                                    69 
100 2. LILO can also take input from a serial devi     70 2. LILO can also take input from a serial device. This is a very
101    useful option. To tell LILO to use the seri     71    useful option. To tell LILO to use the serial port:
102    In lilo.conf (global section)::                 72    In lilo.conf (global section)::
103                                                    73 
104      serial  = 1,9600n8 (ttyS1, 9600 bd, no pa     74      serial  = 1,9600n8 (ttyS1, 9600 bd, no parity, 8 bits)
105                                                    75 
106 3. Adjust to kernel flags for the new kernel,      76 3. Adjust to kernel flags for the new kernel,
107    again in lilo.conf (kernel section)::           77    again in lilo.conf (kernel section)::
108                                                    78 
109      append = "console=ttyS1,9600"                 79      append = "console=ttyS1,9600"
110                                                    80 
111 4. Make sure a getty runs on the serial port s     81 4. Make sure a getty runs on the serial port so that you can login to
112    it once the system is done booting. This is     82    it once the system is done booting. This is done by adding a line
113    like this to ``/etc/inittab`` (exact syntax     83    like this to ``/etc/inittab`` (exact syntax depends on your getty)::
114                                                    84 
115      S1:23:respawn:/sbin/getty -L ttyS1 9600 v     85      S1:23:respawn:/sbin/getty -L ttyS1 9600 vt100
116                                                    86 
117 5. Init and ``/etc/ioctl.save``                    87 5. Init and ``/etc/ioctl.save``
118                                                    88 
119    Sysvinit remembers its stty settings in a f     89    Sysvinit remembers its stty settings in a file in ``/etc``, called
120    ``/etc/ioctl.save``. REMOVE THIS FILE befor     90    ``/etc/ioctl.save``. REMOVE THIS FILE before using the serial
121    console for the first time, because otherwi     91    console for the first time, because otherwise init will probably
122    set the baudrate to 38400 (baudrate of the      92    set the baudrate to 38400 (baudrate of the virtual console).
123                                                    93 
124 6. ``/dev/console`` and X                          94 6. ``/dev/console`` and X
125    Programs that want to do something with the     95    Programs that want to do something with the virtual console usually
126    open ``/dev/console``. If you have created      96    open ``/dev/console``. If you have created the new ``/dev/console`` device,
127    and your console is NOT the virtual console     97    and your console is NOT the virtual console some programs will fail.
128    Those are programs that want to access the      98    Those are programs that want to access the VT interface, and use
129    ``/dev/console instead of /dev/tty0``. Some     99    ``/dev/console instead of /dev/tty0``. Some of those programs are::
130                                                   100 
131      Xfree86, svgalib, gpm, SVGATextMode          101      Xfree86, svgalib, gpm, SVGATextMode
132                                                   102 
133    It should be fixed in modern versions of th    103    It should be fixed in modern versions of these programs though.
134                                                   104 
135    Note that if you boot without a ``console=`    105    Note that if you boot without a ``console=`` option (or with
136    ``console=/dev/tty0``), ``/dev/console`` is    106    ``console=/dev/tty0``), ``/dev/console`` is the same as ``/dev/tty0``.
137    In that case everything will still work.       107    In that case everything will still work.
138                                                   108 
139 7. Thanks                                         109 7. Thanks
140                                                   110 
141    Thanks to Geert Uytterhoeven <geert@linux-m6    111    Thanks to Geert Uytterhoeven <geert@linux-m68k.org>
142    for porting the patches from 2.1.4x to 2.1.    112    for porting the patches from 2.1.4x to 2.1.6x for taking care of
143    the integration of these patches into m68k,    113    the integration of these patches into m68k, ppc and alpha.
144                                                   114 
145 Miquel van Smoorenburg <miquels@cistron.nl>, 11    115 Miquel van Smoorenburg <miquels@cistron.nl>, 11-Jun-2000
                                                      

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php