feature: clear registers when kpanic is called
This commit is contained in:
parent
6c8c158a1f
commit
81c54647d2
14
src/clear_register.s
Normal file
14
src/clear_register.s
Normal file
@ -0,0 +1,14 @@
|
||||
.intel_syntax noprefix
|
||||
|
||||
.section .text
|
||||
.global clear_registers
|
||||
|
||||
clear_registers:
|
||||
xor eax, eax
|
||||
xor ebx, ebx
|
||||
xor ecx, ecx
|
||||
xor edx, edx
|
||||
xor esp, esp
|
||||
xor ebp, ebp
|
||||
xor esi, esi
|
||||
xor edi, edi
|
@ -9,6 +9,7 @@
|
||||
|
||||
extern uint32_t page_table1[1024];
|
||||
extern const char *faults[];
|
||||
void clear_registers(void);
|
||||
|
||||
__attribute__((noreturn)) void kpanic(const char *format, ...)
|
||||
{
|
||||
@ -30,6 +31,7 @@ __attribute__((noreturn)) void kpanic(const char *format, ...)
|
||||
/* print_stack(); */
|
||||
/* kprintf("\n\n"); */
|
||||
/* kprintf("PRESS SPACE TO REBOOT"); */
|
||||
clear_registers();
|
||||
while (terminal_getkey().scan_code != KEY_SPACE)
|
||||
;
|
||||
reboot();
|
||||
|
Loading…
Reference in New Issue
Block a user