Kernel: Switch back to kernel address space on kernel panic
This commit is contained in:
parent
92d8c9d4d5
commit
48d68a3e31
@ -5,7 +5,9 @@
|
|||||||
#include "interrupts/IDT.h"
|
#include "interrupts/IDT.h"
|
||||||
#include "io/PIC.h"
|
#include "io/PIC.h"
|
||||||
#include "log/Log.h"
|
#include "log/Log.h"
|
||||||
|
#include "memory/VMM.h"
|
||||||
#include "misc/MSR.h"
|
#include "misc/MSR.h"
|
||||||
|
#include "render/Framebuffer.h"
|
||||||
#include "render/TextRenderer.h"
|
#include "render/TextRenderer.h"
|
||||||
#include "std/stdio.h"
|
#include "std/stdio.h"
|
||||||
#include "thread/Scheduler.h"
|
#include "thread/Scheduler.h"
|
||||||
@ -25,6 +27,8 @@ void dump_registers(Context* context)
|
|||||||
|
|
||||||
[[noreturn]] void __panic_stub(Context* context)
|
[[noreturn]] void __panic_stub(Context* context)
|
||||||
{
|
{
|
||||||
|
VMM::switch_back_to_kernel_address_space();
|
||||||
|
VMM::apply_address_space();
|
||||||
if (context) dump_registers(context);
|
if (context) dump_registers(context);
|
||||||
|
|
||||||
if (InitRD::is_initialized())
|
if (InitRD::is_initialized())
|
||||||
@ -73,6 +77,8 @@ extern "C" [[noreturn]] bool __do_int_panic(Context* context, const char* file,
|
|||||||
|
|
||||||
TextRenderer::reset();
|
TextRenderer::reset();
|
||||||
|
|
||||||
|
framebuffer0.clear(Color::Black);
|
||||||
|
|
||||||
if (context->number >= 0x20 && context->number < 0x30) { PIC::send_eoi((uint8_t)(context->irq_number & 0xFF)); }
|
if (context->number >= 0x20 && context->number < 0x30) { PIC::send_eoi((uint8_t)(context->irq_number & 0xFF)); }
|
||||||
|
|
||||||
Task* task;
|
Task* task;
|
||||||
@ -93,6 +99,8 @@ extern "C" [[noreturn]] bool __do_panic(const char* file, int line, const char*
|
|||||||
|
|
||||||
TextRenderer::reset();
|
TextRenderer::reset();
|
||||||
|
|
||||||
|
framebuffer0.clear(Color::Black);
|
||||||
|
|
||||||
Task* task;
|
Task* task;
|
||||||
if ((task = Scheduler::current_task()))
|
if ((task = Scheduler::current_task()))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user