From 58d2af14429be02b580cde5b3e23978530d8ab74 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Wed, 21 May 2025 10:19:07 +0200 Subject: feat(kernel): Architectural changes, and introducing a kKernelVM. see code for more details. Signed-off-by: Amlal El Mahrouss --- .../HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc | 51 +--------------------- 1 file changed, 1 insertion(+), 50 deletions(-) (limited to 'dev/kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc') diff --git a/dev/kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc b/dev/kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc index 51fc4f0e..633adccb 100644 --- a/dev/kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc +++ b/dev/kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc @@ -37,14 +37,6 @@ EXTERN_C Kernel::Void idt_handle_gpf(Kernel::UIntPtr rsp) { auto& process = Kernel::UserProcessScheduler::The().TheCurrentProcess(); - if (!process) { - ke_panic(RUNTIME_CHECK_BAD_BEHAVIOR, "General Access Fault."); - } - if (process.Leak().Signal.SignalID == SIGKILL || process.Leak().Signal.SignalID == SIGABRT || - process.Leak().Signal.SignalID == SIGTRAP) { - dbg_break_point(); - } - Kernel::kout << "Kernel: General Access Fault.\r"; process.Leak().Signal.SignalArg = rsp; @@ -63,15 +55,6 @@ EXTERN_C void idt_handle_pf(Kernel::UIntPtr rsp) { auto& process = Kernel::UserProcessScheduler::The().TheCurrentProcess(); - if (!process) { - ke_panic(RUNTIME_CHECK_BAD_BEHAVIOR, "Access Fault."); - } - - if (process.Leak().Signal.SignalID == SIGKILL || process.Leak().Signal.SignalID == SIGABRT || - process.Leak().Signal.SignalID == SIGTRAP) { - dbg_break_point(); - } - Kernel::kout << "Kernel: Page Fault.\r"; Kernel::kout << "Kernel: SIGKILL\r"; @@ -104,14 +87,6 @@ EXTERN_C void idt_handle_math(Kernel::UIntPtr rsp) { auto& process = Kernel::UserProcessScheduler::The().TheCurrentProcess(); - if (!process) { - ke_panic(RUNTIME_CHECK_BAD_BEHAVIOR, "Math Fault."); - } - if (process.Leak().Signal.SignalID == SIGKILL || process.Leak().Signal.SignalID == SIGABRT || - process.Leak().Signal.SignalID == SIGTRAP) { - dbg_break_point(); - } - Kernel::kout << "Kernel: Math error (division by zero?).\r"; process.Leak().Signal.SignalArg = rsp; @@ -130,15 +105,6 @@ EXTERN_C void idt_handle_generic(Kernel::UIntPtr rsp) { auto& process = Kernel::UserProcessScheduler::The().TheCurrentProcess(); - if (!process) { - ke_panic(RUNTIME_CHECK_BAD_BEHAVIOR, "Generic Fault."); - } - - if (process.Leak().Signal.SignalID == SIGKILL || process.Leak().Signal.SignalID == SIGABRT || - process.Leak().Signal.SignalID == SIGTRAP) { - dbg_break_point(); - } - (Void)(Kernel::kout << "Kernel: Process RSP: " << Kernel::hex_number(rsp) << Kernel::kendl); Kernel::kout << "Kernel: Access Process Fault.\r"; @@ -152,19 +118,9 @@ EXTERN_C void idt_handle_generic(Kernel::UIntPtr rsp) { } EXTERN_C Kernel::Void idt_handle_breakpoint(Kernel::UIntPtr rip) { - auto& process = Kernel::UserProcessScheduler::The().TheCurrentProcess(); - - if (!process) { - while (YES) - ; - } - hal_idt_send_eoi(3); - if (process.Leak().Signal.SignalID == SIGKILL || process.Leak().Signal.SignalID == SIGABRT || - process.Leak().Signal.SignalID == SIGTRAP) { - dbg_break_point(); - } + auto& process = Kernel::UserProcessScheduler::The().TheCurrentProcess(); (Void)(Kernel::kout << "Kernel: Process RIP: " << Kernel::hex_number(rip) << Kernel::kendl); @@ -189,11 +145,6 @@ EXTERN_C void idt_handle_ud(Kernel::UIntPtr rsp) { auto& process = Kernel::UserProcessScheduler::The().TheCurrentProcess(); - if (!process) { - while (YES) - ; - } - if (process.Leak().Signal.SignalID == SIGKILL || process.Leak().Signal.SignalID == SIGABRT || process.Leak().Signal.SignalID == SIGTRAP) { dbg_break_point(); -- cgit v1.2.3