summaryrefslogtreecommitdiffhomepage
path: root/dev/kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-05-13 08:46:49 +0200
committerAmlal El Mahrouss <amlal@nekernel.org>2025-05-13 08:50:20 +0200
commitf5f62b145d472a2a2c388c385be9d1c4e5b5d84c (patch)
treecf7fef087fd16ea345f44bb9e796327462141b98 /dev/kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc
parent609698e032f4d110004908d4eefcc77c43553258 (diff)
feat(kernel): see below for the commit's details.
what? - UserProcessScheduler and CoreProcessScheduler have been extended for FILE_TREE and also HEAP_TREE structures. - DDK device's API will use dk_ calls instead of sk_ calls. - SIGTRAP and Interrupt handlers have been fixed to handle when no process is being run, and the kernel is instead raising the interrupt. - Add file for HeFS formating in DiskImage.fwrk - Replace generic handler with breakpoint handler in int 3. why? - These changes are bug fixes and improvements. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc')
-rw-r--r--dev/kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc26
1 files changed, 19 insertions, 7 deletions
diff --git a/dev/kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc b/dev/kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc
index 84c35615..c72a109a 100644
--- a/dev/kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc
+++ b/dev/kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc
@@ -16,7 +16,9 @@ STATIC BOOL kIsScheduling = NO;
EXTERN_C void idt_handle_gpf(Kernel::UIntPtr rsp) {
auto process = Kernel::UserProcessScheduler::The().CurrentProcess();
- if (process.Leak().Status != Kernel::ProcessStatusKind::kRunning) return;
+ if (process.Leak().Status != Kernel::ProcessStatusKind::kRunning) {
+ MUST_PASS(NO);
+ }
kIsScheduling = NO;
@@ -38,7 +40,9 @@ EXTERN_C void idt_handle_gpf(Kernel::UIntPtr rsp) {
EXTERN_C void idt_handle_pf(Kernel::UIntPtr rsp) {
auto process = Kernel::UserProcessScheduler::The().CurrentProcess();
- if (process.Leak().Status != Kernel::ProcessStatusKind::kRunning) return;
+ if (process.Leak().Status != Kernel::ProcessStatusKind::kRunning) {
+ MUST_PASS(NO);
+ }
kIsScheduling = NO;
@@ -83,7 +87,9 @@ EXTERN_C void idt_handle_scheduler(Kernel::UIntPtr rsp) {
EXTERN_C void idt_handle_math(Kernel::UIntPtr rsp) {
auto process = Kernel::UserProcessScheduler::The().CurrentProcess();
- if (process.Leak().Status != Kernel::ProcessStatusKind::kRunning) return;
+ if (process.Leak().Status != Kernel::ProcessStatusKind::kRunning) {
+ MUST_PASS(NO);
+ }
kIsScheduling = NO;
@@ -105,7 +111,9 @@ EXTERN_C void idt_handle_math(Kernel::UIntPtr rsp) {
EXTERN_C void idt_handle_generic(Kernel::UIntPtr rsp) {
auto process = Kernel::UserProcessScheduler::The().CurrentProcess();
- if (process.Leak().Status != Kernel::ProcessStatusKind::kRunning) return;
+ if (process.Leak().Status != Kernel::ProcessStatusKind::kRunning) {
+ MUST_PASS(NO);
+ }
kIsScheduling = NO;
@@ -126,10 +134,12 @@ EXTERN_C Kernel::Void idt_handle_breakpoint(Kernel::UIntPtr rip) {
auto process = Kernel::UserProcessScheduler::The().CurrentProcess();
if (process.Leak().Status != Kernel::ProcessStatusKind::kRunning) {
+ (Void)(Kernel::kout << "Kernel: Kernel RIP: " << Kernel::hex_number(rip) << Kernel::kendl);
Kernel::kout << "Kernel: SIGTRAP\r";
- while (YES)
- ;
+ kIsScheduling = NO;
+
+ while (YES);
}
kIsScheduling = NO;
@@ -152,7 +162,9 @@ EXTERN_C Kernel::Void idt_handle_breakpoint(Kernel::UIntPtr rip) {
EXTERN_C void idt_handle_ud(Kernel::UIntPtr rsp) {
auto process = Kernel::UserProcessScheduler::The().CurrentProcess();
- if (process.Leak().Status != Kernel::ProcessStatusKind::kRunning) return;
+ if (process.Leak().Status != Kernel::ProcessStatusKind::kRunning) {
+ MUST_PASS(NO);
+ }
kIsScheduling = NO;