aboutsummaryrefslogtreecommitdiff
path: root/src/core/int.S
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2021-05-04 15:30:24 +0200
committerLoic Guegan <manzerbredes@mailbox.org>2021-05-04 15:30:24 +0200
commit1530a85d5aefcf6497ff2129023e9a0b002603dd (patch)
treeea6098d0dcafabba0ffc2f28ea5c136f731996b9 /src/core/int.S
parent64a17f3e0683a0a492a3fed9c4c17a4335d1f421 (diff)
Solving many issues: Aligning kernel stack, improve syscall mechanism,
DISABLING RED-ZONE !!!!
Diffstat (limited to 'src/core/int.S')
-rw-r--r--src/core/int.S22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/core/int.S b/src/core/int.S
index c8612dc..c552212 100644
--- a/src/core/int.S
+++ b/src/core/int.S
@@ -26,18 +26,29 @@
push %rbp
push %rsi
push %rdi
- mov %ds, %rax
+ xor %rax,%rax # Because I am picky
+ mov %gs, %rax
+ push %rax
+ mov %es, %rax
push %rax
- mov 56(%rsp), %rax # Restore %rax
+ mov %fs, %rax
+ push %rax
+ mov %ds, %rax
push %rax
mov $0x10, %ax
mov %ax, %ds
- pop %rax
+ mov 80(%rsp), %rax
.endm
.macro RESTORE_REGS
pop %rax
- mov %rax,%ds
+ mov %ax, %ds
+ pop %rax
+ mov %ax, %fs
+ pop %rax
+ mov %ax, %es
+ pop %rax
+ mov %ax, %gs
pop %rdi
pop %rsi
pop %rbp
@@ -77,6 +88,7 @@ INT_10:
.globl INT_14
INT_14:
+ pop %rsi
CALL_PRINTK $MSG_INT_14
INT_14_INFINITE:
jmp INT_14_INFINITE
@@ -113,7 +125,7 @@ MSG_INT_0:
MSG_INT_10:
.asciz "Invalid TSS!"
MSG_INT_14:
-.asciz "Page fault!"
+.asciz "Page fault: error %x !"
MSG_INT_KBD:
.asciz "Key press!"
MSG: