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

Last change on this file since 4154 was 4154, checked in by Jean-Yves Lamoureux, 10 years ago
  • Total kernel rewrite
File size: 1.7 KB
Line 
1#include "kernel.h"
2#include "klibc.h"
3#include "drivers/timer.h"
4
5
6void idt_default_int(void) {
7        print("!! Unknown interrupt\n");
8}
9
10void idt_int0(void) {
11        print("!! Divide by 0\n ");
12}
13void idt_int1(void) {
14        print("!! Debug exception ");
15}
16void idt_int2(void) {
17        print("!! NMI ");
18}
19void idt_int3(void) {
20        print("!! Breakpoint ");
21}
22void idt_int4(void) {
23        print("!! Overflow ");
24}
25void idt_int5(void) {
26        print("!! BoundCheck ");
27}
28void idt_int6(void) {
29        print("!! Invalid Opcode ");
30}
31void idt_int7(void) {
32        print("!! Coprocessor not available ");
33}
34void idt_int8(void) {
35        print("!! Double Fault ");
36}
37void idt_int9(void) {
38        print("!! Coprocessor segment overrun ");
39}
40void idt_int10(void) {
41        print("!! Invalid TSS ");
42}
43void idt_int11(void) {
44        print("!! Segment not present ");
45}
46void idt_int12(void) {
47        print("!! Stack exception ");
48}
49void idt_int13(void) {
50        print("!! General protection exception ");
51}
52void idt_int14(void) {
53        print("!! Page fault ");
54}
55void idt_int15(void) {
56        print("!! Intel reserved int ");
57}
58void idt_int16(void) {
59        print("!! Coprocessor error ");
60}
61void idt_int17(void) {
62        print("!! Intel reserved (2) ");
63}
64void idt_int18(void) {
65        print("i18 ");
66}
67
68
69/* Used by Channel0 timer */
70void idt_irq0(void) {
71    ticks++;
72}
73void idt_irq2(void) {
74        print("IRQ 2");
75}
76void idt_irq3(void) {
77        print("IRQ 3");
78}
79void idt_irq4(void) {
80        print("IRQ 4");
81}
82void idt_irq5(void) {
83        print("IRQ 5");
84}
85void idt_irq6(void) {
86        print("IRQ 6");
87}
88void idt_irq7(void) {
89        print("IRQ 7");
90}
91void idt_irq8(void) {
92        print("IRQ 8");
93}
94
95
96extern unsigned char kbdmap[];
97
98/* Keyboard irq is 1 */
99void kbd_int(void) {
100        unsigned char i;
101        do {
102                i=inb(0x64);
103        } while((i & 0x01) == 0);
104   
105        i=inb(0x60);
106        i--;
107   
108        if(i<0x80){
109                putcar(kbdmap[i*4]);
110        }
111}
112
Note: See TracBrowser for help on using the repository browser.