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

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