-
Notifications
You must be signed in to change notification settings - Fork 0
/
interruptstubs.s
47 lines (38 loc) · 964 Bytes
/
interruptstubs.s
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
.set IRQ_BASE, 0x20
.section .text
.extern _ZN16InterruptManager15HandleInterruptEhj
.macro HandleException num
.global _ZN16InterruptManager19HandleException\num\()Ev
_ZN16InterruptManager19HandleException\num\()Ev:
movb $\num, (interruptnumber)
jmp int_bottom
.endm
.macro HandleInterruptRequest num
.global _ZN16InterruptManager26HandleInterruptRequest\num\()Ev
_ZN16InterruptManager26HandleInterruptRequest\num\()Ev:
movb $\num + IRQ_BASE, (interruptnumber)
jmp int_bottom
.endm
HandleInterruptRequest 0x00
HandleInterruptRequest 0x01
int_bottom:
pusha
pushl %ds
pushl %es
pushl %fs
pushl %gs
pushl %esp
push (interruptnumber)
call _ZN16InterruptManager15HandleInterruptEhj
add %esp, 6
mov %eax, %esp
pop %gs
pop %fs
pop %esp
pop %ds
popa
.global _ZN16InterruptManager15InterruptIgnoreEv
_ZN16InterruptManager15InterruptIgnoreEv:
iret
.data
interruptnumber: .byte 0