DinDon
5. Re:Breakpointing Winice
(courtesy of fravia's searchlores.org ~ original thread here)


Would it be possible to debug a winice (with winice) running on a vmware virtual machine on the same computer??
Like i don't know how im gonna learn how it works if i can't debug it :-). (remote debugging??)
Again thanks for your help.
Latigo.

Hi Latigo,

I tried that kind of masochistic approach
some time ago, but since that project took me a lot more than the expected time, I threw it in the big list of my waiting projects. It was anyway a big fun. Here is what I did and what I learned.

You cannot debug Winice with Winice itself. You must use another kernel debugger. The only kernel debugger I am aware of, besides Softice (never tried with TRW2000, because at that time my platform was WindowsNT) is Microsoft WINDBG (take it for free at http://www.microsoft.com/ddk/debugging/).
Tip: I think TRW2000 could be a good solution for Win9x platforms, but I am not sure of...

Unfortunately WINDBG cannot debug the kernel on the same machine where it runs but it requires a remote computer.
The target machine will run the kernel with the /DEBUG option. In this way the serial port (COM1 or COM2) will be used by the kernel to send and receive information for the remote debugger, with a simple protocol nearly undocumented by Microsoft.
It seems that Windows Whistler could be debugged by WINDBG on the same machine...
So you have two chances:
(a) buy another PC and connect it to the target one with a null-modem cable
(b) put your hands on VMWARE

I followed the second chance, and after some troubles installing Softice on the VMWARE virtual machine (you must set a standard VGA driver on it, selecting only 16 colours in order to have a not-garbled screen when softice pops-up), another problem arose: how can the virtual machine dialogate with WINDBG? You have again two chances:
(a) use a null-modem cable to connect COM1 with COM2. Configure the virtual machine kernel in order to use one of them, and instruct WINDBG to use the other one. I did not try this solution: on the paper it should work... who knows?
(b) thanks to VMWARE facility of redirecting all the COMx flow to a named pipe, another way to connect the two machines would be via pipes. But this requires an NT driver (VMWARE runs only on Windows NT) in order to redirect the COM to a pipe, since WINDBG can use only a COM port to connect to the target machine.

Well, I wrote a filter NT driver on the top of the standard serial one, which simply redirects all the WINDBG I/O to a named pipe and gets there the answers from the VMWARE redirected kernel I/O. I was in the stage of debugging this one when I realized that VMWARE was yet full of bugs: a lot of times it crashed. I lost my patience and I decided to stop the project and to spend my time with some more interesting, waiting for some new releases of VMWARE.

In the following weeks I found another way to manage the problem. You could use Bochs (the Intel emulator with full source code) with its debugger built-in, in order to step inside Winice. Could it work? I would have the time to try... Grab a Windows version of Bochs with the debugger enabled at
http://www.reactos.com/tools/bochsget.html

Ok, please let me know if you have the time and the skillness to make some progress...
I would be very interested at it.
My best regards.

DinDon

Date: 12-11-2000 on 17:03

Petit image
Back to tools
(c) 2000: [fravia+], all rights reserved