From 8b14d5db84ffe44e0092afd610c216a6f36d7058 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Wed, 28 Feb 2024 22:53:57 +0100 Subject: HCoreKrnl: Interrupts are now working. Signed-off-by: Amlal El Mahrouss --- Private/HALKit/AMD64/HalCoreInterruptHandler.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'Private/HALKit/AMD64/HalCoreInterruptHandler.cpp') diff --git a/Private/HALKit/AMD64/HalCoreInterruptHandler.cpp b/Private/HALKit/AMD64/HalCoreInterruptHandler.cpp index 9f2e37d8..e568aa4d 100644 --- a/Private/HALKit/AMD64/HalCoreInterruptHandler.cpp +++ b/Private/HALKit/AMD64/HalCoreInterruptHandler.cpp @@ -50,13 +50,18 @@ static const char* kExceptionMessages[32] = { #define kKernelSyscallInterrupt (0x21) EXTERN_C { - HCore::Void rt_handle_interrupts( - HCore::HAL::StackFramePtr stack) { + HCore::Void rt_handle_interrupts(HCore::HAL::StackFramePtr stack) { + HCore::kcout << "HCoreKrnl: Interrupting Hart...\r\n"; + + if (stack->IntNum < 32) { + HCore::kcout << "HCoreKrnl: " << kExceptionMessages[stack->IntNum] << HCore::end_line(); + } + switch (stack->IntNum) { case kKernelSyscallInterrupt: { HCore::kcout << "HCoreKrnl: System call raised, checking.." << HCore::end_line(); - rt_syscall_handle(nullptr); + rt_syscall_handle(stack); break; } @@ -65,9 +70,11 @@ EXTERN_C { } if ((stack->IntNum - 32) >= 12) { + HCore::kcout << "HCoreKrnl: EOI Master PIC...\r\n"; HCore::HAL::Out8(0xA0, 0x20); } + HCore::kcout << "HCoreKrnl: EOI Slave PIC...\r\n"; HCore::HAL::Out8(0x20, 0x20); } } \ No newline at end of file -- cgit v1.2.3