diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2021-04-12 10:13:21 +0200 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2021-04-12 10:13:21 +0200 |
| commit | 39713a3736145483dd3310c3605f940ca34f05c3 (patch) | |
| tree | d4dcdf0f3b667a5d706aa4b04501a71facf186bd /src/int/int.S | |
| parent | 6edeba8fe208fb019aec00fdc72b97407a8078d3 (diff) | |
Refactoring
Diffstat (limited to 'src/int/int.S')
| -rw-r--r-- | src/int/int.S | 72 |
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 + |
