X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Farch%2Fx86%2Fkpanic.c;h=ccb107370d469d2240faafd67a28994de5d6cc66;hb=49a69690b65eb0e13530110bce5724967b55e140;hp=dc1a719b95181c26b71ac7fb92498cf46c4e2cc6;hpb=54592b96f7d673009c5efd7f3c559f9950d8bfd4;p=tpg%2Facess2.git diff --git a/Kernel/arch/x86/kpanic.c b/Kernel/arch/x86/kpanic.c index dc1a719b..ccb10737 100644 --- a/Kernel/arch/x86/kpanic.c +++ b/Kernel/arch/x86/kpanic.c @@ -6,11 +6,16 @@ #include + + #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 { @@ -52,6 +57,11 @@ const struct { }; #define NUM_REGVALUES (sizeof(caRegValues)/sizeof(caRegValues[0])) +// === PROTOTYPES === +void KernelPanic_SetMode(void); +void KernelPanic_PutChar(char Ch); + +// === CODE === /** * \brief Sets the screen mode for a kernel panic */ @@ -65,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 @@ -85,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)