On Sat, Nov 20, 2010 at 12:58:56PM -0500, Stefan Berger wrote:
On 11/20/2010 12:50 PM, Kevin O'Connor wrote:
I suppose one could implement a simple SMM gateway - write a magic IO bit to invoke the SMM handler, have the SMM handler backup the cpu state somewhere in BIOS owned memory, and then leave SMM mode with execution at a BIOS handler running in 32bit flat mode. The BIOS handler could then do its work and manually return the CPU to its initial state before returning to the guest. The BIOS would need to ensure that it didn't allow interrupts (or NMIs) while in this mode, but that's possible. One would probably want to ensure that the BIOS didn't touch any non-BIOS owned memory in this state as well, but that's also possible.
FWIW, I am currently working on a gateway for calling 32 bit functions in the relocated 32bit code from 16 bit code, opening up that are for more than the init functions. It works fine from what I can see also considering the mixture of register and stack passing of arguments. Would that be helpful here?
Is it something like stacks.c:call32() or is it via SMM?
BTW, are you reserving the relocated code or are you only doing this during the init phase?