-
Notifications
You must be signed in to change notification settings - Fork 0
/
isr.c
163 lines (137 loc) · 2.96 KB
/
isr.c
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
// Inspiration ISR Library
void enable_ints()
{
__asm__("sti");
}
void disable_ints()
{
__asm__("cli");
}
char misr0[]="\nException : Division by zero";
char misr1[]="\nException : Debug Exceptions";
char misr2[]="\nException : Intel Reserved (You shouldn\'t be seeing this!)";
char misr3[]="\nException : Breakpoint";
char misr4[]="\nException : Overflow";
char misr5[]="\nException : Bounds check";
char misr6[]="\nException : Invalid Opcode";
char misr7[]="\nException : Coprocessor Not Available";
char misr8[]="\nException : Double Fault";
char misr9[]="\nException : Coprocessor Segment Overrun";
char misr10[]="\nException : Invalid TSS";
char misr11[]="\nException : Segment Not Present";
char misr12[]="\nException : Stack Exception";
char misr13[]="\nException : General Protection Fault";
char misr14[]="\nException : Page Fault";
char misr15[]="\nException : Intel Reserved (You shouldn\'t be seeing this!)";
char misr16[]="\nException : Coprocessor Error";
char misr17_31[]="\nException : Intel Reserved (You shouldn\'t be seeing this!)";
void isr0()
{
kputs(misr0);
__asm__("cli;hlt;");
};
void isr1()
{
kputs(misr1);
__asm__("cli;hlt;");
};
void isr2()
{
kputs(misr2);
__asm__("cli;hlt;");
};
void isr3()
{
kputs(misr3);
__asm__("cli;hlt;");
};
void isr4()
{
kputs(misr4);
__asm__("cli;hlt;");
};
void isr5()
{
kputs(misr5);
__asm__("cli;hlt;");
};
void isr6()
{
kputs(misr6);
__asm__("cli;hlt;");
};
void isr7()
{
kputs(misr7);
__asm__("cli;hlt;");
};
void isr8()
{
kputs(misr8);
__asm__("cli;hlt;");
};
void isr9()
{
kputs(misr9);
__asm__("cli;hlt;");
};
void isr10()
{
kputs(misr10);
__asm__("cli;hlt;");
};
void isr11()
{
kputs(misr11);
__asm__("cli;hlt;");
};
void isr12()
{
kputs(misr12);
__asm__("cli;hlt;");
};
void isr13()
{
kputs(misr13);
__asm__("cli;hlt;");
};
void isr14()
{
kputs(misr14);
__asm__("cli;hlt;");
};
void isr15()
{
kputs(misr15);
__asm__("cli;hlt;");
};
void isr16()
{
kputs(misr16);
__asm__("cli;hlt;");
};
void isr17_31()
{
kputs(misr17_31);
__asm__("cli;hlt;");
};
void int46()
{
kputs("\n\t\t\t Inspiration v.1\n");
};
void int47()
{
unsigned char chi,chj,chk;
unsigned int ni,nj,nk;
__asm__("" : "=bh"(chi));
if(chi==0)
{
__asm__("" : "=ax"(chj),"=cx"(chk),"=edx"(ni));
memset((unsigned char *) ni,chj,(0+chk));
}
else if(chi==1)
{
__asm__("" : "=eax"(ni),"=ecx"(nj),"=dx"(nk));
memcopy((unsigned char *) ni,(unsigned char *) nj,nk);
}
};