source: libcaca/trunk/kernel/boot/interruptions.c @ 4333

Last change on this file since 4333 was 4333, checked in by Sam Hocevar, 10 years ago

Large source code cleanup, getting rid of spaces, tabs, and svn keywords.

File size: 2.4 KB
Line 
1/*
2 *  libcaca       Colour ASCII-Art library
3 *  Copyright (c) 2006 Sam Hocevar <sam@hocevar.net>
4 *                2009 Jean-Yves Lamoureux <jylam@lnxscene.org>
5 *                All Rights Reserved
6 *
7 *  This library is free software. It comes without any warranty, to
8 *  the extent permitted by applicable law. You can redistribute it
9 *  and/or modify it under the terms of the Do What The Fuck You Want
10 *  To Public License, Version 2, as published by Sam Hocevar. See
11 *  http://sam.zoy.org/wtfpl/COPYING for more details.
12 */
13
14
15#include "kernel.h"
16#include "klibc.h"
17#include "drivers/timer.h"
18
19
20void idt_default_int(void)
21{
22    print("!! Unknown interrupt\n");
23}
24
25void idt_int0(void)
26{
27    print("!! Divide by 0\n ");
28}
29
30void idt_int1(void)
31{
32    print("!! Debug exception ");
33}
34
35void idt_int2(void)
36{
37    print("!! NMI ");
38}
39
40void idt_int3(void)
41{
42    print("!! Breakpoint ");
43}
44
45void idt_int4(void)
46{
47    print("!! Overflow ");
48}
49
50void idt_int5(void)
51{
52    print("!! BoundCheck ");
53}
54
55void idt_int6(void)
56{
57    print("!! Invalid Opcode ");
58}
59
60void idt_int7(void)
61{
62    print("!! Coprocessor not available ");
63}
64
65void idt_int8(void)
66{
67    print("!! Double Fault ");
68}
69
70void idt_int9(void)
71{
72    print("!! Coprocessor segment overrun ");
73}
74
75void idt_int10(void)
76{
77    print("!! Invalid TSS ");
78}
79
80void idt_int11(void)
81{
82    print("!! Segment not present ");
83}
84
85void idt_int12(void)
86{
87    print("!! Stack exception ");
88}
89
90void idt_int13(void)
91{
92    print("!! General protection exception ");
93}
94
95void idt_int14(void)
96{
97    print("!! Page fault ");
98}
99
100void idt_int15(void)
101{
102    print("!! Intel reserved int ");
103}
104
105void idt_int16(void)
106{
107    print("!! Coprocessor error ");
108}
109
110void idt_int17(void)
111{
112    print("!! Intel reserved (2) ");
113}
114
115void idt_int18(void)
116{
117    print("i18 ");
118}
119
120
121/* Used by Channel0 timer */
122void idt_irq0(void)
123{
124    ticks++;
125}
126
127void idt_irq2(void)
128{
129    print("IRQ 2");
130}
131
132void idt_irq3(void)
133{
134    print("IRQ 3");
135}
136
137void idt_irq4(void)
138{
139    print("IRQ 4");
140}
141
142void idt_irq5(void)
143{
144    print("IRQ 5");
145}
146
147void idt_irq6(void)
148{
149    print("IRQ 6");
150}
151
152void idt_irq7(void)
153{
154    print("IRQ 7");
155}
156
157void idt_irq8(void)
158{
159    print("IRQ 8");
160}
161
162
163extern unsigned char kbdmap[];
164
165/* Keyboard irq is 1 */
166void kbd_int(void)
167{
168    unsigned char i;
169    do
170    {
171        i = inb(0x64);
172    }
173    while ((i & 0x01) == 0);
174
175    i = inb(0x60);
176    i--;
177
178    if (i < 0x80)
179    {
180        putcar(kbdmap[i * 4]);
181    }
182}
Note: See TracBrowser for help on using the repository browser.