From 99019721a9e147c49becc466c5427609b937aca8 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Wed, 21 Apr 2021 18:54:50 +0200 Subject: Enable interrupts --- src/core/int.S | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/core/int.S (limited to 'src/core/int.S') diff --git a/src/core/int.S b/src/core/int.S new file mode 100644 index 0000000..d5ad643 --- /dev/null +++ b/src/core/int.S @@ -0,0 +1,33 @@ +.extern printk + +.macro call_printk msg + mov \msg, %rdi + mov $0, %eax # Required for variadic functions + call printk +.endm + +.globl INT_DEFAULT +INT_DEFAULT: + iretq + +.globl INT_0 +INT_0: + call_printk $MSG_INT_0 + INT_0_INFINITE: + jmp INT_0_INFINITE + iretq + +.globl INT_14 +INT_14: + call_printk $MSG_INT_14 + mov $0, %eax + call printk + INT_14_INFINITE: + jmp INT_14_INFINITE + iretq + + +MSG_INT_0: +.asciz "Zero Division error!" +MSG_INT_14: +.asciz "Page fault!" -- cgit v1.2.3