Your Ad Here
首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 操作系统 > Linux > vmware 4.5.2 下测试 linux console 重定向到串口的功能
【标  题】:vmware 4.5.2 下测试 linux console 重定向到串口的功能
【关键字】:vmware,4.5.2,linux,console
【来  源】:http://blog.chinaunix.net/article.php?articleId=19918&blogId=5724

vmware 4.5.2 下测试 linux console 重定向到串口的功能

Your Ad Here 今天作的有意义的一件事就是测试了在 vmware 4.5.2 下测试 linux console 重定向到串口的功能

测试环境:
Host OS: SUSE Pro 9.3
vmware: 4.5.2 for linux (any-any-update89)
Virtual OS: SLES9 两台 (SLES9serv1, SLES9serv2)

关键词:
Linux, console, serial, vmware, console loglevel

Linux 的系统的 console 可以重定向到串口,系统的 console 消息可以通过终端软件记录下来,对分析系统的故障
很有帮助。 由于没有串口线,所以只好借助 vmware 来测试这个功能了。

vmware 4.5.2 支持将串口创建为命名管道(在 linux 下实际是socket)
具体的做法如 vmware 文档 file:///usr/lib/vmware/help-manual/devices_serial_ws.htm 所介绍的方法

In the server virtual machine

  1. Open the virtual machine settings editor (VM > Settings).
  2. Click Add to start the Add Hardware Wizard.
  3. Select Serial Port, then click Next.
  4. Select Output to named pipe, then click Next.
  5. In the Path field, enter /tmp/ or another Unix socket name of your choice.
  6. Select This end is the server.
  7. Select The other end is a virtual machine.
  8. By default, the device status setting is Connect at power on. You may deselect this setting if you wish.

In the client virtual machine

  1. Open the virtual machine settings editor (VM > Settings).
  2. Click Add to start the Add Hardware Wizard.
  3. Select Serial Port, then click Next.
  4. Select Output to named pipe, then click Next.
  5. In the Path field, enter /tmp/ or another Unix socket name of your choice. The pipe name must be the same on both server and client.
  6. Select This end is the client.
  7. Select The other end is a virtual machine.
  8. By default, the device status setting is Connect at power on. You may deselect this setting if you wish.

别忘了保存相应的配置。:-)

启动虚拟机之后,VM SLES9serv1 作为串口使用中的服务器端,它的终端会重定向到串口
1) 在 VM SLES9serv1 的 /boot/grub/menu.lst 文件 kernel 对应的行上添加 console=ttyS0,9600 console=tty0,要令它生效需要重启系统。

2) 如果希望在另外一台 VM SLES9serv2 上登录这台 VM SLES9serv1,
在 VM SLES9serv1 的 /etc/inittab 中添加行:

S0:2345:respawn:/sbin/agetty -L 9600 ttyS0 vt102

然后运行命令: # init q

3)在 VM SLES9serv2 上配置 minicom 设置串口为 /dev/ttyS0 参数为 9600 8N1
然后连接上去,应该一切ok了

4) 如果希望把尽可能多的消息通过串口发送出去,需要调整 VM SLES9serv1 的 console loglevel
# echo 8 > /proc/sys/kernel/printk

5) 在 VM SLES9serv1 上插入会产生 kernel msg 的内核模块,测试内核消息发送是否正常


参见:
1. /usr/src/linux/Documentation/serial-console.txt
2. /usr/src/linux/Documentation/sysctl/kernel.txt
3. vmware/help-manual/devices_serial_ws.htm
4. man 1 minicom
5. man 8 init


Linux下进行MONO开发和使用Beagle的Flash演示:【上一篇】
syslogd 接受远程的机器发送来的日志:【下一篇】
【相关文章】
  • Linux下进行MONO开发和使用Beagle的Flash演示
  • 如何使用Linux的tftp功能上下载cisco router的配置
  • Porting cluster test from Linux-ha to open-ais
  • linux就是比Windows牛!
  • 2005-4-4 Linux新闻与流言 (盈利与亏损)
  • 2005-4-6 Linux新闻与流言 (成名要赶早)
  • 中国桌面LINUX的现状及展望
  • 另类商业模式助 Linux 挑战微软
  • linux命令说明
  • 请教linux新手应该怎样上路
  • 【随机文章】
  • Windows Mobile 6 SDK 中的 GPS 工具
  • 在Eclipse+WebLogic下开发J2EE应用程序
  • Photoshop高级图层技巧进阶篇(上)
  • MRPII/ERP软件系统的实现
  • ASCII码全接触
  • Oracle9i for windows安装1
  • 实例解析C++/CLI线程之多任务
  • [原创]如何在Delphi中调用.Net编写的DLL中的函数(Function)、过程(Procedure)
  • MySQL ROOT用户可得到系统ROOT权限
  • 连到SQL数据库
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 bbb软讯网络 All Rigths Reserved.