From 349fe48baf941b2d1b571d3a5d0d796823bae312 Mon Sep 17 00:00:00 2001 From: Amlal EL Mahrouss Date: Thu, 13 Jun 2024 17:41:19 +0200 Subject: MHR-31: New systemcall/kernelcall architecture. Signed-off-by: Amlal EL Mahrouss --- Kernel/HALKit/AMD64/HalInterruptAPI.asm | 59 +++++++++++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 2 deletions(-) (limited to 'Kernel/HALKit/AMD64/HalInterruptAPI.asm') diff --git a/Kernel/HALKit/AMD64/HalInterruptAPI.asm b/Kernel/HALKit/AMD64/HalInterruptAPI.asm index ef5a8319..e88ffc0d 100644 --- a/Kernel/HALKit/AMD64/HalInterruptAPI.asm +++ b/Kernel/HALKit/AMD64/HalInterruptAPI.asm @@ -195,15 +195,69 @@ IntNormal 47 IntNormal 48 IntNormal 49 +[extern hal_system_call_enter] +[extern hal_kernel_call_enter] + __NEW_INT_50: cli - ;; todo handle system calls. + push rax + + call hal_system_call_enter + + pop rax + + sti + iretq + +__NEW_INT_51: + cli + + push 0 + push 51 + push rax + push rcx + push rdx + push rbx + push rbp + push rsi + push rdi + push r8 + push r9 + push r10 + push r11 + push r12 + push r13 + push r14 + push r15 + push gs + push fs + + mov rcx, rbp + + call hal_kernel_call_enter + + pop fs + pop gs + pop r15 + pop r14 + pop r13 + pop r12 + pop r11 + pop r10 + pop r9 + pop r8 + pop rdi + pop rsi + pop rbp + pop rbx + pop rdx + pop rcx + pop rax sti iretq -IntNormal 51 IntNormal 52 IntNormal 53 IntNormal 54 @@ -223,6 +277,7 @@ IntNormal 60 ;; this one is doing a POST for us. ;; testing interrupts. _ke_power_on_self_test: + mov rcx, 0x10 int 0x32 int 0x32 int 0x32 -- cgit v1.2.3