]> git.dujemihanovic.xyz Git - nameless-os.git/blob - kernel/arch/x86/irq/sample_handler.c
d9bd8f9c953a3e48a46b6695957e28d6650aed0d
[nameless-os.git] / kernel / arch / x86 / irq / sample_handler.c
1 #include <tty.h>
2 #include <irq/i8259a.h>
3 #include <io.h>
4 #include <stdint.h>
5
6 typedef uint32_t uword_t;
7
8 struct interrupt_frame {
9 uword_t ip;
10 uword_t cs;
11 uword_t flags;
12 };
13
14 struct abort_frame;
15
16 __attribute__((interrupt))
17 void keyb_handler(struct interrupt_frame *frame)
18 {
19 pic_send_eoi(1);
20 kprint("Got a keyboard interrupt!\n", 0);
21 inb(0x60);
22 }
23
24
25 __attribute__((interrupt))
26 void double_fault(struct abort_frame *frame)
27 {
28 *(volatile char *) (0xb8000) = ":";
29 *(volatile char *) (0xb8002) = "(";
30 asm volatile ("cli; hlt");
31 while(1);
32 }
33