The Linux kernel is configured to use a serial console by passing it the console parameter. The console parameter can be given repeatedly; in that case output is sent to all consoles and input is taken from the last listed console. The last console is the one Linux uses as the /dev/console device.
The syntax of the console parameter is given in Figure 5-1.
<port> is the number of the serial port. This is defined in Figure 4-2 and discussed in Section 2.2. The examples in this HOWTO use the first serial port, giving <port> the value ttyS0.
If you are using the devfs device filesystem with your Linux installation the kernel parameter for the first serial port is still ttyS0, even though the first serial device is no longer known as /dev/ttyS0 but as /dev/ttys/0.
<mode> is defined in Figure 2-7 and is discussed in Section 2.3. The examples in this HOWTO use 9600 bits per second, one start bit, eight data bits, no parity, one stop bit, and CTS/RTS flow control giving <mode> the value of 9600n8r.
<usb_port> can specify the address of a USB dongle containing a serial port to be used as a serial console.[1] For example, the serial port console=ttyS00,9600n8r when moved to a USB serial dongle would be written as console=ttyUSB0,9600n8r. The USB subsystem is started rather late in the boot process, console messages printed during boot before the USB subsystem is loaded will be lost.
With no console parameter the kernel will use the first virtual terminal, which is /dev/tty0. A user at the keyboard uses this virtual terminal by pressing Ctrl-Alt-F1.
If your computer contains a video card then we suggest that you also configure it as a console. This is done with the kernel parameter console=tty0.
For computers with both a video card and a serial console in the port marked ‘COM1:’ this HOWTO suggests the kernel parameters:
Figure 5-2. Recommended kernel parameters, PCs with video card
console=tty0 console=ttyS0,9600n8r |
For PCs without a video card, this HOWTO suggests the kernel parameters:
Figure 5-3. Recommended kernel parameters, PCs without video card
console=ttyS0,9600n8r |
[1] | A serial console attached to a USB dongle is only available in Linux kernel version 2.5.7 and later. The 2.5 series of kernels are developer's kernels and are not ready for production use. |