Kernel - x86 Fixed a couple of bugs
[tpg/acess2.git] / Kernel / arch / x86 / kpanic.c
index 0950be8..ccb1073 100644 (file)
@@ -6,11 +6,16 @@
 
 #include <acess.h>
 
+
+
 #define        FB      ((Uint16 *)(KERNEL_BASE|0xB8000))
 #define BGC    0x4F00  // White on Red
 //#define BGC  0xC000  // Black on Bright Red
 //#define BGC  0x1F00  // White on Blue (BSOD!)
 
+extern Uint32  GetEIP(void);
+extern void    Error_Backtrace(Uint32 eip, Uint32 ebp);
+
  int   giKP_Pos = 0;
 
 const struct {
@@ -70,7 +75,7 @@ void KernelPanic_SetMode(void)
        if( giKP_Pos )  return ;
        
        // Restore VGA 0xB8000 text mode
-       #if 0
+       #if 1
        for( i = 0; i < NUM_REGVALUES; i++ )
        {
                // Reset Flip-Flop
@@ -90,6 +95,13 @@ void KernelPanic_SetMode(void)
        {
                FB[i] = BGC;
        }
+       
+       {
+               Uint32  eip = GetEIP();
+               Uint32  ebp;
+               __asm__ __volatile__ ("mov %%ebp, %0" : "=r" (ebp));
+               Error_Backtrace(eip, ebp);
+       }
 }
 
 void KernelPanic_PutChar(char Ch)

UCC git Repository :: git.ucc.asn.au