-
Notifications
You must be signed in to change notification settings - Fork 0
/
interruptstubs.s
54 lines (41 loc) · 970 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
48
49
50
51
52
53
54
.set IRQ_BASE, 0x20
.section .text
.extern _ZN16InterruptManager15handleInterruptEhj
.macro HandleException num
.global _ZN16InterruptManager16handleException\num\()Ev
_ZN16InterruptManager16handleException\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:
#save registers
pusha
pushl %ds
pushl %es
pushl %fs
pushl %gs
#call c++ header
pushl %esp
push (interruptnumber)
call _ZN16InterruptManager15handleInterruptEhj
addl %esp, 6
mov %eax, %esp
#load registers
pop %gs
pop %fs
pop %es
pop %ds
popa
.global _ZN16InterruptManager22ignoreInterruptRequestEv
_ZN16InterruptManager22ignoreInterruptRequestEv:
iret
.data
interruptnumber: .byte 0