简体   繁体   中英

Implementing a kernel debugging module for a Linux guest OS inside a VmWare VM

Sorry for the rather long post.

I need some input regarding a project that I am going to undertake.

I am trying to make an application that collects kernel debugging information from a guest Linux OS, located inside a VmWare Virtual Machine, and send them to a host OS efficiently.

So far, I have found a similar project, but written for Windows[1]. The author of the project wrote a DLL that is loaded into memory, and replaces the implementation of the KdSendPacket and KdReceivePacket functions, to use the VmWare GuestRpc[2] mechanism, instead of the slow serial port. The data are then send to a debugging application on the host(Kd or WinDbg) trough a named pipe.

The author claims that there is a speed-up up to 45%, by avoiding the serial port transmission.

I am trying to achieve something similar ,but for Linux, and try to make the debugging process a little faster, than using the serial port.

My concrete questions are :

  1. Do any similar applications exist? I didn't manage to find any.
  2. Would such an application be worth it ,comparing its functionality to netconsole[3], for example?
  3. What method of intercepting printk messages would you suggest ?
  4. Is there an equivalent of KdSendPacket/KdReceivePacket on Linux ?

[1]. http://virtualkd.sysprogs.org/dox/operation.html

[2]. http://articles.sysprogs.org/kdvmware/guestrpc.shtml

[3]. http://www.kernel.org/doc/Documentation/networking/netconsole.txt

many approaches can use to achieve your goal, below methods can be applied if network is connected:

  1. use syslog service and transfer log though network to your server: syslogd, syslogng seems support sending log to a log server with some filter critiera.

  2. directly call tcp/udp socket functions in your kernel module to sends your collected data back to server.

other approaches, you may write application on host machine that calls hypervisor's share memory access function to read the memory buffer of your kernel module. However, the xen/kvm hypervisor both support these apis and i am not sure about weather vmware have this kind of library.

使用串口实际上并不是最理想的。即使(虚拟)网络也会比这更好,但回到主客户IPC频道,VMware的VMCI浮现在脑海中。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM