summaryrefslogtreecommitdiffhomepage
path: root/Kernel/HALKit/AMD64/HalInterruptAPI.asm
diff options
context:
space:
mode:
authorAmlal EL Mahrouss <amlal@softwarelabs.com>2024-06-13 17:41:19 +0200
committerAmlal EL Mahrouss <amlal@softwarelabs.com>2024-06-13 17:41:19 +0200
commit349fe48baf941b2d1b571d3a5d0d796823bae312 (patch)
tree6258abfbede227d0a7806530ccbf3cdf3ca3699c /Kernel/HALKit/AMD64/HalInterruptAPI.asm
parent70ae21935c7c68ed8a380611481b553b94cee657 (diff)
MHR-31: New systemcall/kernelcall architecture.
Signed-off-by: Amlal EL Mahrouss <amlal@softwarelabs.com>
Diffstat (limited to 'Kernel/HALKit/AMD64/HalInterruptAPI.asm')
-rw-r--r--Kernel/HALKit/AMD64/HalInterruptAPI.asm59
1 files changed, 57 insertions, 2 deletions
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