On Sat Aug 04, 2007 at 11:50:36 +0200, Stefan Scheler wrote:
I'd suggest to use a task gate for your NMI and run it on a completely different stack. Because there are parts of code that are extremely sensible to NMIs and this is basically the sysenter path of the Fiasco kernel.
I tried that (see attached patch). Is that the correct way of implementing this? It works exactly once. When I reset the counters the second time I get "APIC error 00000000(00000000)" and the machine freezes.
-- Stefan Scheler
+++ src/kern/config_gdt.h (working copy) @@ -22,6 +22,7 @@ #define GDT_DATA_USER (0x20) // #4 #define GDT_TSS (0x28) // #5: hardware task segment #define GDT_TSS_DBF (0x30) // #6: tss for dbf handler +#define GDT_TSS_PMI (0x32) // #7: tss for pmi handler
JFYI, the 0x32 seems wrong, as you're overwriting the dbf slot. You need to use some free slot, e.g. 0x60.
Adam