aboutsummaryrefslogtreecommitdiff
path: root/src/int/int.S
diff options
context:
space:
mode:
Diffstat (limited to 'src/int/int.S')
-rw-r--r--src/int/int.S72
1 files changed, 72 insertions, 0 deletions
diff --git a/src/int/int.S b/src/int/int.S
index e69de29..8ca8b7a 100644
--- a/src/int/int.S
+++ b/src/int/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
+