blob: 756eed4f648f9c4fd509e5441b18359b3bdd5a70 [file] [log] [blame]
swissChilid8137922021-02-17 15:34:07 -08001 [bits 32]
2 [global idt_flush]
3
4idt_flush:
5 mov eax, [esp + 4]
6 lidt [eax]
7 ret
8
9%macro ISRNOERR 1
10 [global isr%1]
11isr%1:
12 cli
13 push byte 0
14 push byte %1
15 jmp isr_common
16%endmacro
17
18%macro ISRERR 1
19 [global isr%1]
20isr%1:
21 cli
22 push byte %1
23 jmp isr_common
24%endmacro
25
26ISRNOERR 0
27ISRNOERR 1
28ISRNOERR 2
29ISRNOERR 3
30ISRNOERR 4
31ISRNOERR 5
32ISRNOERR 6
33ISRNOERR 7
34ISRERR 8
35ISRNOERR 9
36ISRERR 10
37ISRERR 11
38ISRERR 12
39ISRERR 13
40ISRERR 14
41ISRNOERR 15
42ISRNOERR 16
43ISRNOERR 17
44ISRNOERR 18
45ISRNOERR 19
46ISRNOERR 20
47ISRNOERR 21
48ISRNOERR 22
49ISRNOERR 23
50ISRNOERR 24
51ISRNOERR 25
52ISRNOERR 26
53ISRNOERR 27
54ISRNOERR 28
55ISRNOERR 29
56ISRNOERR 30
57ISRNOERR 31
58
59
60 [extern isr_handler]
61isr_common:
62 pusha ; Save all registers
63
64 mov ax, ds
65 push eax
66
67 mov ax, 0x10
68 mov ds, ax
69 mov es, ax
70 mov fs, ax
71 mov gs, ax
72
73 call isr_handler
74
75 pop eax
76 mov ds, ax
77 mov es, ax
78 mov fs, ax
79 mov gs, ax
80
81 popa
82 add esp, 8 ; Passed arguments
83 sti
84 iret ; Return from interrupt