aboutsummaryrefslogtreecommitdiff
path: root/src/core/int.S
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2021-04-12 10:28:04 +0200
committerLoic Guegan <manzerbredes@mailbox.org>2021-04-12 10:28:04 +0200
commit457a2117706cdaee34f894e67c89da7bf29f6143 (patch)
treee3a1a519c5360abcca95732500594c92af9af51c /src/core/int.S
parent39713a3736145483dd3310c3605f940ca34f05c3 (diff)
Refactoring
Diffstat (limited to 'src/core/int.S')
-rw-r--r--src/core/int.S72
1 files changed, 72 insertions, 0 deletions
diff --git a/src/core/int.S b/src/core/int.S
new file mode 100644
index 0000000..8ca8b7a
--- /dev/null
+++ b/src/core/int.S
@@ -0,0 +1,72 @@
+.macro SAVE_REGS
+pushal
+push %ds
+push %es
+push %fs
+push %gs
+push %ebx
+mov $0x10,%bx
+mov %bx,%ds
+pop %ebx
+.endm
+
+.macro RESTORE_REGS
+ pop %gs
+ pop %fs
+ pop %es
+ pop %ds
+ popal
+.endm
+
+.globl interrupt_enable
+interrupt_enable:
+ call idt_init
+ call pic_init
+ sti
+ ret
+
+.globl INT_DEFAULT
+INT_DEFAULT:
+ SAVE_REGS
+ movb $0x20, %al
+ outb %al, $0x20
+ RESTORE_REGS
+ iret
+
+.globl INT_KEYPRESS
+INT_KEYPRESS:
+ SAVE_REGS
+ call _8042_keypress
+ movb $0x20, %al
+ outb %al, $0x20
+ RESTORE_REGS
+ iret
+
+.globl INT_CLOCK
+INT_CLOCK:
+ SAVE_REGS
+ call clock
+ movb $0x20, %al
+ outb %al, $0x20
+ RESTORE_REGS
+ iret
+
+.globl INT_SYSCALL
+INT_SYSCALL:
+ SAVE_REGS
+ call syscall
+ movb $0x20, %al
+ outb %al, $0x20
+ RESTORE_REGS
+ iret
+
+.globl INT_PAGE_FAULT
+INT_PAGE_FAULT:
+ SAVE_REGS
+ call page_fault
+ hlt
+ movb $0x20, %al
+ outb %al, $0x20
+ RESTORE_REGS
+ iret
+