Skip to main content
GameDev.net gamedev.net
🔒 Locked

Debuggers and Virtual PC

Started by _Sigma Dec 13, 2005 at 12:41 PM 9 replies 950+ views
Original Post
_Sigma
_Sigma
Can you install kernal(ring-0) debuggers on a virtual machine using Virtual PC 2004?
frob
frob
Quote:
Original post by _Sigma
Can you install kernal(ring-0) debuggers on a virtual machine using Virtual PC 2004?


You can interact with the virtual machine as though it were a real machine. I don't believe you can have the hosting machine debug inside the virtual machine, but you can use debugging tools inside the virtual machine. I've never tried kerenl level debugging, but I don't see why it would not work.

frob.
doynax
doynax
Unlike Wine for instance Virtual PC is a full IA-32 emulator, so the hosted operating system assumes that it's alone and sets up all the usual protection measures against it's own user-mode application.
Quote:
Original post by _Sigma
Can you install kernal(ring-0) debuggers on a virtual machine using Virtual PC 2004?
Say.. You're not a Commodore user by any chance?
_Sigma
_Sigma
No....why?

So anything I can do on a comp, i can do on the VM?
doynax
doynax
Quote:
Original post by _Sigma
No....why?
That kernal typo, someone decided to name the kernel on Commodore's 8-bit systems KERNAL (Keyboard Entry Read, Network, And Link). And it's screwed up the spelling of the word for C64 users ever since..
Quote:
Original post by _Sigma
So anything I can do on a comp, i can do on the VM?
Well, mostly. The emulator isn't perfect and it obviously doesn't support all hardware.
But it's generally good enough unless you need performance or are developing drivers for some new hardware.
Spoonbender
Spoonbender
Yeah, that's the entire reason for VM's. [wink]

You should even be able to set up some kind of remote debugging. Virtual PC supports emulation of all the usual I/O ports, as far as I remember. So you should be able to hook up some debugging tools to that from the host OS.
Extrarius
Extrarius
If you experiment with this and find that Virtual PC 2004 does indeed support full kernele-mode development including driver development and that it sufficiently protects the host computer from errors in the emulated code (that I believe still runs on the real processor), let me know because I'm still looking for an inexpensive way to develop drivers without cratering my main machine.
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
Monder
Monder
Quote:
that I believe still runs on the real processor


Have you any reason to believe this? I don't see anything about it in the documentation and I don't see how running ring-0 code on a processor without interfering with the current OS would be possible.

I also see no reason why driver development and kernel debugging shouldn't work just fine as Virtual PC does fully emulate the hardware. Though any drivers you write would have to be for the emulated hardware because AFAIK the Virtual PC cannot access real hardware in any way.
Spoonbender
Spoonbender
Original post by Monder
Quote:
that I believe still runs on the real processor


Quote:

Have you any reason to believe this? I don't see anything about it in the documentation and I don't see how running ring-0 code on a processor without interfering with the current OS would be possible.

It doesn't actually run in ring-0.
What it might do (Don't know exactly how they've implemented it) is run in normal userspace, and simply catch any exceptions that occur (because you try to execute ring-0 code), and then emulate that in software before resuming the application.
Extrarius
Extrarius
Quote:
Original post by Monder
Quote:
that I believe still runs on the real processor


Have you any reason to believe this? I don't see anything about it in the documentation and I don't see how running ring-0 code on a processor without interfering with the current OS would be possible.[...]
My reason for beleiving this is twofold: First, the claims of performance pretty much eliminate a complete emulator on the scale bochs. Second, there is very little mention of emulation in the product information, and no mention of cpu emulation that I see anywhere.

Then there are sentences such as "Standard USB input devices such as keyboards and mice are supported through PS/2 emulation, but Virtual PC does not support USB devices that require their own drivers" (in MS VPC 2004 Technical Overview) that indicate there is very limited emulation of kernel-level code. In fact, now that I found this (I hadn't noticed this particular one before), I'm inclined to think that driver development on VPC is not possible.
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
doynax
doynax
Quote:
Original post by Extrarius
Quote:
Original post by Monder
Quote:
that I believe still runs on the real processor


Have you any reason to believe this? I don't see anything about it in the documentation and I don't see how running ring-0 code on a processor without interfering with the current OS would be possible.[...]
My reason for beleiving this is twofold: First, the claims of performance pretty much eliminate a complete emulator on the scale bochs. Second, there is very little mention of emulation in the product information, and no mention of cpu emulation that I see anywhere.
I know that the similar VMWare product uses the CPU directly at least. And I'm almost certain that VirtualPC does too.

However there's a thin line between emulators based on dynamic recompilation and running on "the real thing", especially when you're emulating the native architecture. Don't forget that VirtualPC was originally a Mac (PowerPC) based product and still performed exceptionally well.

Bochs just happens to be generally inefficient..

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.