summaryrefslogtreecommitdiffhomepage
path: root/dev/zka/HALKit/AMD64/HalInterruptAPI.asm
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-10-21 09:35:23 +0200
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-10-21 09:35:23 +0200
commit0bb0eb7952edbe2d14a071abe9eeff6e8b1b51ee (patch)
tree754cb3da25aa7a22c30beed40b417f3622c6866c /dev/zka/HALKit/AMD64/HalInterruptAPI.asm
parent94bb3c0e7bdca4e5cd85a576a98b0b19847b597c (diff)
IMP: Improved many things, and looking at how to fix the interrupts
issue. Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/zka/HALKit/AMD64/HalInterruptAPI.asm')
-rw-r--r--dev/zka/HALKit/AMD64/HalInterruptAPI.asm82
1 files changed, 20 insertions, 62 deletions
diff --git a/dev/zka/HALKit/AMD64/HalInterruptAPI.asm b/dev/zka/HALKit/AMD64/HalInterruptAPI.asm
index 936f71c8..e611fdf1 100644
--- a/dev/zka/HALKit/AMD64/HalInterruptAPI.asm
+++ b/dev/zka/HALKit/AMD64/HalInterruptAPI.asm
@@ -16,16 +16,18 @@
%macro IntExp 1
global __ZKA_INT_%1
__ZKA_INT_%1:
- cli
- sti
+ mov al, 0x20
+ out 0x21, al
+
o64 iret
%endmacro
%macro IntNormal 1
global __ZKA_INT_%1
__ZKA_INT_%1:
- cli
- sti
+ mov al, 0x20
+ out 0x21, al
+
o64 iret
%endmacro
@@ -54,38 +56,24 @@ IntNormal 5
;; Invalid opcode interrupt
__ZKA_INT_6:
- cli
-
mov al, 0x20
out 0x20, al
- push rax
-
mov rcx, rsp
call idt_handle_ud
- pop rax
-
- sti
o64 iret
IntNormal 7
;; Invalid opcode interrupt
__ZKA_INT_8:
- cli
-
mov al, 0x20
out 0x21, al
- push rax
-
mov rcx, rsp
call idt_handle_generic
- pop rax
-
- sti
o64 iret
IntNormal 9
@@ -95,36 +83,21 @@ IntExp 11
IntExp 12
__ZKA_INT_13:
- cli
-
mov al, 0x20
out 0x21, al
- push rax
-
mov rcx, rsp
call idt_handle_gpf
- pop rax
-
- sti
o64 iret
__ZKA_INT_14:
- cli
-
mov al, 0x20
out 0x21, al
- push rax
-
mov rcx, rsp
call idt_handle_pf
- pop rax
-
- sti
-
o64 iret
IntNormal 15
@@ -153,17 +126,8 @@ __ZKA_INT_32:
mov al, 0x20
out 0x21, al
- push rbp
- push rsp
- push rcx
- push rdx
- push r8
- jmp idt_handle_scheduler
- pop rsp
- pop rbp
- pop rcx
- pop rdx
- pop r8
+ mov rcx, rsp
+ call idt_handle_scheduler
o64 iret
@@ -192,40 +156,32 @@ IntNormal 49
[extern hal_kernel_call_enter]
__ZKA_INT_50:
+ cli
+
mov al, 0x20
out 0x21, al
- push r8
- push r9
- push r10
- push rsp
+ mov rcx, r8
+ mov rdx, r9
jmp hal_system_call_enter
- add rsp, 16
- pop rsp
- pop r10
- pop r9
- pop r8
+ sti
o64 iret
__ZKA_INT_51:
+ cli
+
mov al, 0x20
out 0x21, al
- push r8
- push r9
- push r10
- push rsp
+ mov rcx, r8
+ mov rdx, r9
call hal_kernel_call_enter
- add rsp, 16
- pop rsp
- pop r10
- pop r9
- pop r8
+ sti
o64 iret
@@ -352,6 +308,8 @@ hal_load_idt:
out 0x21, al
out 0xA1, al
+ sti
+
ret
section .data