summaryrefslogtreecommitdiffhomepage
path: root/Private/HALKit/AMD64/HalCoreInterruptHandler.cpp
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlalelmahrouss@icloud.com>2024-02-28 17:48:25 +0100
committerAmlal El Mahrouss <amlalelmahrouss@icloud.com>2024-02-28 17:49:13 +0100
commit1ab61e6bb20dd39f85fca30c1d0a83db12fea9d6 (patch)
tree3c3912c242e8dc822ce3cbe9871b4b5e7363f336 /Private/HALKit/AMD64/HalCoreInterruptHandler.cpp
parentf77a876e0ac2611079ee188933f0f3de222dd08a (diff)
HCoreKrnl: Fix IDT, will get the rt_handle_interrupts right, and not
corrupt the registers, see below. - New register layout in Stackframe. - Thinking about a way to wrap this handler into a valid win64 call. Signed-off-by: Amlal El Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Private/HALKit/AMD64/HalCoreInterruptHandler.cpp')
-rw-r--r--Private/HALKit/AMD64/HalCoreInterruptHandler.cpp30
1 files changed, 16 insertions, 14 deletions
diff --git a/Private/HALKit/AMD64/HalCoreInterruptHandler.cpp b/Private/HALKit/AMD64/HalCoreInterruptHandler.cpp
index 2acfc454..9f2e37d8 100644
--- a/Private/HALKit/AMD64/HalCoreInterruptHandler.cpp
+++ b/Private/HALKit/AMD64/HalCoreInterruptHandler.cpp
@@ -50,22 +50,24 @@ static const char* kExceptionMessages[32] = {
#define kKernelSyscallInterrupt (0x21)
EXTERN_C {
+ HCore::Void rt_handle_interrupts(
+ HCore::HAL::StackFramePtr stack) {
+ switch (stack->IntNum) {
+ case kKernelSyscallInterrupt: {
+ HCore::kcout << "HCoreKrnl: System call raised, checking.."
+ << HCore::end_line();
+ rt_syscall_handle(nullptr);
+ break;
+ }
-HCore::UIntPtr rt_handle_interrupts(HCore::HAL::StackFramePtr sf) {
- MUST_PASS(sf);
+ default:
+ break;
+ }
- if (sf->IntNum < 32) {
- } else if (sf->IntNum == 0x21) {
- rt_syscall_handle(sf);
- }
+ if ((stack->IntNum - 32) >= 12) {
+ HCore::HAL::Out8(0xA0, 0x20);
+ }
- if ((sf->IntNum - 32) >= 12) {
- HCore::HAL::Out8(0xA0, 0x20);
+ HCore::HAL::Out8(0x20, 0x20);
}
-
- HCore::HAL::Out8(0x20, 0x20);
-
- return (HCore::UIntPtr)sf;
-}
-
} \ No newline at end of file