aboutsummaryrefslogtreecommitdiff
path: root/src/core/int.S
blob: d5ad64346b0f6fa7a803c03c0e010be1b17d2b66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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!"