Page 1 of 1
Debugging bootsector code (VMWare/WinDbg)
Posted: Wed Mar 26, 2008 3:27 am
by mrnicelife
Hi,
Is it possible to debug (step by step) bootsector code ( for an experimental OS ) using VMWare and WinDbg attached to the VMWare?
I am using VMWare Server 1.0.4 and WinDbg 6.8.0004.
Kind Regards,
Miguel Lopes
Posted: Wed Mar 26, 2008 7:57 am
by proxy
to my knowledge, vmware does not have a built in kernel debugging interface (i WISH it at least provided an API to do so
).
qemu is likely what you want as it runs near the speed of vmware but you can hook gdb up to it and stepi instruction by instruction.
proxy
Posted: Wed Mar 26, 2008 9:09 am
by JAAman
awhile back, someone claiming to work for VMware posted on here, said that it does have debugging features similar to those in bochs, and he said he was going to update the wiki with that information (although i havent been there to check whether or not he did...)
dont know any more than that
Posted: Wed Mar 26, 2008 9:59 pm
by Bobbias
[quote=http://www.osdev.org/wiki/VMWare]
Workstation 6.0 (Fusion 1.0/1.1). Useful feature: gdb-based guest debug stub support. Useful feature: record-replay (though difficult to use), which might be helpful for reproducing race conditions. [/quote]
There's some more info on how to use the Guest Debugging feature mentioned there on the page.
Posted: Fri Mar 28, 2008 9:12 pm
by kscguru
JAAman wrote:awhile back, someone claiming to work for VMware posted on here
Aye, 'twas me. VMware can handle attaching a gdb debugger, which is the best way to debug the kernel itself. The option is on the wiki page. BUT, I don't remember if the debug stub existed on Server1.0. (The stub was in the codebase then, but I think it is compiled out of all released builds. Sorry.)
Can't attach WinDbg to a virtual machine. I know of no software that runs the WinDbg debugger protocol outside MSFT - believe me, I and people I know have looked.
Honestly, I'd suggest finding yourself a Windows build of gdb and using that. It's what I use for my own debugging. Just be warned that debugging bootsector code is hard - GDB likes to assume all code is at least 32-bit, you need special options to convince it otherwise and it doesn't work as well in 16-bit mode.