Hi Mario,
Ok, some more off topic
please see the discussion, at
<
http://groups.google.de/group/micro...c945?lnk=st&q=bcpauli&rnum=5#8a8863d71625c945>
there is a solution.
But the problem is the implementation of the NMI handling with a TaskGate.
There is no way in Windows XP to be sure that the state of the math Co
processor is correct after the iretd when you do it with a TaskGate ( it has
to do with the windows implementation of the INT07 and the EM-Bit handling in
CR0 by the TaskGate, remember NMIs can occure at any moment).
The only way to use NMIs, is to install a InterruptGate for the NMI and if
you want to use the FPU during NMI you have to save the FPU on entering and
restore it on before you iretd.
And be sure to disbale SMIs (System Management Interrupts), because they are
executed during an NMI and if you return from SMM the state that one NMI
can't be interuppted by another NMI is lost!
See Intel Docu "Intel Architecture Software Developer’s Manual, Volume 3:
System Programming Guide (Order Number 243192)"
Chapter 11.7 NMI HANDLING WHILE IN SMM
....
A special case can occur if an SMI handler nests inside an NMI handler and
then another NMI
occurs. During NMI interrupt handling, NMI interrupts are disabled, so
normally NMI interrupts
are serviced and completed with an IRET instruction one at a time. When the
processor
enters SMM while executing an NMI handler, the processor saves the SMRAM
state save map
but does not save the attribute to keep NMI interrupts disabled.
Potentially, an NMI could be
latched (while in SMM or upon exit) and serviced upon exit of SMM even
though the previous
NMI handler has still not completed. One or more NMIs could thus be nested
inside the first
NMI handler. The NMI interrupt handler should take this possibility into
consideration.
....
Regards,
Burkhard