22#include "vga_text.h"
33#include "debug.h"
44#include "process.h"
5+ #include "logdisk.h"
56
67int isLessMSG = 0 ;
78
@@ -91,6 +92,7 @@ void exception_handler(registers_t cps)
9192 else
9293 {
9394 text_chcolor (VGA_RED , VGA_BLACK );
95+ logdisk_change_policy (LOG_OFF );
9496 printf ("KERNEL PANIC. EXCEPTION OCCURRED %d: %s\n" , cps .ino , exception_messages [cps .ino ]);
9597 printf ("Extended stack pointer = 0x%06x\n" , cps .esp );
9698 printf ("Extended instruction pointer = 0x%06x\n" , cps .eip );
@@ -106,6 +108,20 @@ void exception_handler(registers_t cps)
106108 printf ("ESI = 0x%06x\n" , cps .esi );
107109 printf ("EDI = 0x%06x\n" , cps .edi );
108110 printf ("EBP = 0x%06x\n" , cps .ebp );
111+ ldprintf ("KERNEL" , LOG_ERR , "KERNEL PANIC. EXCEPTION OCCURRED %d: %s" , cps .ino , exception_messages [cps .ino ]);
112+ ldprintf ("KERNEL" , LOG_ERR , "Extended stack pointer = 0x%06x" , cps .esp );
113+ ldprintf ("KERNEL" , LOG_ERR , "Extended instruction pointer = 0x%06x" , cps .eip );
114+ ldprintf ("KERNEL" , LOG_ERR , "Code segment selector = 0x%06x" , cps .cs );
115+ ldprintf ("KERNEL" , LOG_ERR , "Extended flags = 0x%06x" , cps .eflags );
116+ ldprintf ("KERNEL" , LOG_ERR , "Error code = 0x%06x" , cps .ecode );
117+ ldprintf ("KERNEL" , LOG_ERR , "Registers:" );
118+ ldprintf ("KERNEL" , LOG_ERR , "EAX = 0x%06x" , cps .eax );
119+ ldprintf ("KERNEL" , LOG_ERR , "EBX = 0x%06x" , cps .ebx );
120+ ldprintf ("KERNEL" , LOG_ERR , "ECX = 0x%06x" , cps .ecx );
121+ ldprintf ("KERNEL" , LOG_ERR , "EDX = 0x%06x" , cps .edx );
122+ ldprintf ("KERNEL" , LOG_ERR , "ESI = 0x%06x" , cps .esi );
123+ ldprintf ("KERNEL" , LOG_ERR , "EDI = 0x%06x" , cps .edi );
124+ ldprintf ("KERNEL" , LOG_ERR , "EBP = 0x%06x" , cps .ebp );
109125 serialprintf ("KERNEL PANIC. EXCEPTION OCCURRED %d: %s\n" , cps .ino , exception_messages [cps .ino ]);
110126 serialprintf ("Extended stack pointer = 0x%06x\n" , cps .esp );
111127 serialprintf ("Extended instruction pointer = 0x%06x\n" , cps .eip );
0 commit comments