How to configure the kernel parameter "console"
2015-12-31 00:44
441 查看
The Linux kernel is configured to select the console by passing it theconsole parameter. The
console parameter can be given repeatedly, but the parameter can only be given once for each console technology. Soconsole=tty0 console=lp0 console=ttyS0 is acceptable butconsole=ttyS0 console=ttyS1
will not work.
When multiple consoles are listed output is sent to all consoles and input is taken from the last listed console. The lastconsole is the one Linux uses as the
/dev/console device.
The syntax of the console parameter is given in
Figure 5-1.
Figure 5-1. Kernel console syntax, in EBNF
console=ttyS<serial_port>[,<mode>]
console=tty<virtual_terminal>
console=lp<parallel_port>
console=ttyUSB[<usb_port>[,<mode>]
<serial_port> is the number of the serial port. This is defined inFigure
4-2 and discussed in
Section 2.2. The examples in this HOWTO use the first serial port, giving<serial_port> the value
0, which in turn gives kernel parameter
console=ttyS0.
If you are using the devfs device filesystem with your Linux installation the kernel parameter for the first serial port is stillttyS0, 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 noCTS/RTS flow control giving<mode>
the value of 9600n8. When the current kernel flow control bugs are corrected thisHOWTO will once again recommend the value
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=ttyS0,9600n8 when moved to a
USB serial dongle would be written as
console=ttyUSB0,9600n8. TheUSB subsystem is started rather late in the boot process, console messages printed during boot before theUSB 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 pressingCtrl-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 parameterconsole=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
Kernel messages will appear on both the first virtual terminal and the serial port. Messages from theinit system and the system logger will appear only on the first serial port. This can be slightly confusing when looking
at the attached monitor: the machine will appear to boot and then hang. Don't panic, theinit system has started but is now printing messages to the serial port but is printing nothing to the screen. If agetty
has been configured then a login: prompt will eventually appear on the attached monitor.
For PCs without a video card, this
HOWTO suggests the kernel parameters:
Figure 5-3. Recommended kernel parameters, PCs without video card
These parameters are passed to the booting kernel by the boot loader. Next we will configure the boot loader used by yourLinux installation to pass the
console parameters to the kernel.
console parameter can be given repeatedly, but the parameter can only be given once for each console technology. Soconsole=tty0 console=lp0 console=ttyS0 is acceptable butconsole=ttyS0 console=ttyS1
will not work.
When multiple consoles are listed output is sent to all consoles and input is taken from the last listed console. The lastconsole is the one Linux uses as the
/dev/console device.
The syntax of the console parameter is given in
Figure 5-1.
Figure 5-1. Kernel console syntax, in EBNF
console=ttyS<serial_port>[,<mode>]
console=tty<virtual_terminal>
console=lp<parallel_port>
console=ttyUSB[<usb_port>[,<mode>]
<serial_port> is the number of the serial port. This is defined inFigure
4-2 and discussed in
Section 2.2. The examples in this HOWTO use the first serial port, giving<serial_port> the value
0, which in turn gives kernel parameter
console=ttyS0.
If you are using the devfs device filesystem with your Linux installation the kernel parameter for the first serial port is stillttyS0, 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 noCTS/RTS flow control giving<mode>
the value of 9600n8. When the current kernel flow control bugs are corrected thisHOWTO will once again recommend the value
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=ttyS0,9600n8 when moved to a
USB serial dongle would be written as
console=ttyUSB0,9600n8. TheUSB subsystem is started rather late in the boot process, console messages printed during boot before theUSB 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 pressingCtrl-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 parameterconsole=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,9600n8 |
at the attached monitor: the machine will appear to boot and then hang. Don't panic, theinit system has started but is now printing messages to the serial port but is printing nothing to the screen. If agetty
has been configured then a login: prompt will eventually appear on the attached monitor.
For PCs without a video card, this
HOWTO suggests the kernel parameters:
Figure 5-3. Recommended kernel parameters, PCs without video card
console=ttyS0,9600n8 |
console parameters to the kernel.
相关文章推荐
- Linux socket 初步
- linux lsof详解
- linux 文件权限
- Linux 执行数学运算
- 10 篇对初学者和专家都有用的 Linux 命令教程
- Linux 与 Windows 对UNICODE 的处理方式
- Ubuntu12.04下QQ完美走起啊!走起啊!有木有啊!
- 解決Linux下Android开发真机调试设备不被识别问题
- 运维入门
- 运维提升
- Linux 自检和 SystemTap
- Ubuntu Linux使用体验
- c语言实现hashmap(转载)
- Linux 信号signal处理机制
- linux下mysql添加用户
- Scientific Linux 5.5 图形安装教程
- 基于 Linux 集群环境上 GPFS 的问题诊断
- 谁是桌面王者?Win PK Linux三大镇山之宝