怎么切换到linux串口调试控制台?
利用串口终端作为Linux控制台,可以免去额外的键盘,显示卡和显示器,同时可将Linux主机作为一个任意用途的嵌入式黑匣。那么LINUX控制台怎么定向到串口终端?下面跟着学习啦小编一起来了解一下吧。 LINUX控制台怎么定向到串口终端
目的: 台机已经装好Linux,显示器有问题,平时一般都SSH控制,当Linux网络挂的时候,想通过串口来管理。
硬件:台机自带两个串口(上面的是COM1) or ttyS0# cat /boot/grub/menu.lst
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/vg00/lv_root
# initrd /initrd-version.img
#boot=/dev/hdb1
serial –unit=0 –speed=9600 –word=8 –parity=no –stop=1
terminal –timeout=10 serial console
default=2
timeout=20
#splashimage=(hd0,0)/grub/splash.xpm.gz =>这些在console下会工作不正常,注释掉。
#hiddenmenu
title CentOS (2.6.18-92.1.22.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-92.1.22.el5 ro root=/dev/vg00/lv_root rhgb quiet
initrd /initrd-2.6.18-92.1.22.el5.img
title CentOS Serial – Console (2.6.18-92.1.22.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-92.1.22.el5 ro root=/dev/vg00/lv_root console=ttyS0,9600 console=tty0
initrd /initrd-2.6.18-92.1.22.el5.img
title CentOS Console – serial (2.6.18-92.1.22.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-92.1.22.el5 ro root=/dev/vg00/lv_root console=tty0 console=ttyS0,9600
initrd /initrd-2.6.18-92.1.22.el5.img
title CentOS Xen (2.6.18-92.1.2