Home  >  Article  >  Database  >  xen 4.1.2 串口调试

xen 4.1.2 串口调试

WBOY
WBOYOriginal
2016-06-07 15:20:251398browse

一 、用串口线链接xen主机和用于调式的电脑,不过注意在xen主机端不能用usb转串口链接,调试电脑可以用。 二、执行dmesg |grep ttyS获得串口信息 #dmesg |grep ttyS serial8250:ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A serial8250: ttyS1 at I/O0x2f8 (ir


   、用串口线链接xen主机和用于调式的电脑,不过注意在xen主机端不能用usb转串口链接,调试电脑可以用。


   二、执行dmesg |grep ttyS 获得串口信息

          #dmesg |grep ttyS

          serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A

          serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A

ttyS0代表COM1 ttyS1代表COM2。0x3f8 0x2f8是两个串口所使用的IO端口,irq是指对应的中断号。


   三、 修改/boot/grub/grub.cfg如下:

menuentry 'Ubuntu GNU/Linux, with Xen 4.1.2 and Linux 3.2.0-29-generic' --class ubuntu --class gnu-linux --class gnu --class os --class xen {

        insmod part_msdos

        insmod ext2

        set root='(hd0,msdos8)'

        search --no-floppy --fs-uuid --set=root 3c3309f1-c32e-4707-82e1-23d3e06bf3a2

        echo    'Loading Xen 4.1.2 ...'

        multiboot       /boot/xen-4.1.2.gz placeholder loglvl=all guest_loglvl=all com1=115200,8n1,0x3f8,4 console=com1,vga   #这里注意com1=115200,8n1,0x3f8,4 后面两个参数应与第二步获得的IO端口号和中断号保持一致。

        echo    'Loading Linux 3.2.0-29-generic ...'

        module  /boot/vmlinuz-3.2.0-29-generic placeholder root=UUID=3c3309f1-c32e-4707-82e1-23d3e06bf3a2 ro console=hvc0 earlyprintk=xen quiet splash

        echo    'Loading initial ramdisk ...'

        module  /boot/initrd.img-3.2.0-29-generic

}


    四、调试电脑显示信息

        1、如果为linux操作系统,可以使用minicom获得串口输出。

        #minicom

        将链接串口设置为当前与xen主机链接的串口,一般为/dev/ttyS0或/dev/ttyUSB0

        保存重启即可。


       2、如果为windows操作系统,请参考链接3


TROUBLE SHOOTING

    1、如果链接串口,调试电脑能够显示xen启动时的信息,但却无法显示minios的输出。

    解决方法:

          重新编译xen:

          #make xen debug=y

          #make install-xen

         重启xen主机,即可。这个问题在我的系统上颇为奇怪,最开始我用make xen编译安装的,我用串口显示调式信息时,却只能显示xen的启动信息,无法显示minios的输出。然后我用make xen debug=y编译后安装能输出minios信息了。然后我又再次使用make xen编译安装了两次,神奇的是两次安装过后调试电脑同样可以输出minios的输出。问题究竟在哪呢?


参考链接:

1、xen官网串口链接说明

http://wiki.xen.org/wiki/Xen_Serial_Console

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn