Page 1 of 1

Reboot without hardware reset?

Posted: Wed Mar 28, 2012 11:27 am
by srpape
Bear with me, I know this is kind of a strange request.

I'm looking for a way to restart the BIOS code without actually resetting the CPU. Is there an address I could jump to (after some configuration) that would let me start re-executing the BIOS? The CPU starts executing at 0xfffffff0, correct?

I'm aware there will be some problems along the way, for example the SMBIOS won't be able to be reloaded once it's locked.

The reason I'm asking is that I'm interested in trying to enable VMX to virtualize/single step the computer from the first instruction in the BIOS. I would potentially be able to catch certain problems (like the SMBIOS one) with my hypervisor. The first hurdle is just figuring out how to start running the BIOS without resetting the CPU and losing my VMX settings.

My concept is to start the computer, select my option in GRUB (or directly from a USB drive, etc) which loads the hypervisor and set up the environment, and then sets the VMCS EIP to the address of the BIOS (0xfffffff0?) with the monitor trap flag set to start single stepping.

Any thoughts? I'm well aware this might not even be possible.

Thanks!

-Stephen

Re: Reboot without hardware reset?

Posted: Wed Mar 28, 2012 11:44 am
by Brendan
Hi,
srpape wrote:Any thoughts? I'm well aware this might not even be possible.
It should (in theory) be entirely possible; as long as (during "power on") the BIOS sets up the virtual hardware and not the real hardware. This means emulating the chipset (including memory controllers, etc) exactly, and emulating SMM, the entire PCI hierarchy (PCI host/s, bridges, devices), etc.

Of course it would be a huge amount of work, and when you're finished it'll only work for one motherboard.

Intel manuals describe the startup state of the CPU. The CPU starts in real mode. CS:EIP is set to "CS.base = 0xFFFF0000" (in a special "unreal mode" type of way) and EIP is set to 0xFFF0; and various other registers are set in specific ways.


Cheers,

Brendan