Debugging bootsector code (VMWare/WinDbg)

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
mrnicelife
Posts: 1
Joined: Wed Mar 26, 2008 3:20 am

Debugging bootsector code (VMWare/WinDbg)

Post 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
User avatar
proxy
Member
Member
Posts: 108
Joined: Wed Jan 19, 2005 12:00 am
Contact:

Post 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
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Post 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
Bobbias
Posts: 14
Joined: Sun Mar 23, 2008 11:27 pm
Location: Midland, Ontario Canada

Post 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.
I've been writing miserably bad code since I was 12, and things haven't changed yet...
kscguru
Member
Member
Posts: 27
Joined: Sat Jan 19, 2008 12:29 pm

Post 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.
Post Reply