]>
git.dujemihanovic.xyz Git - nameless-os.git/blob - kernel/arch/x86/irq/sample_handler.c
2 #include <irq/i8259a.h>
8 typedef uint32_t uword_t
;
10 struct interrupt_frame
{
17 struct pf_errcode error_code
;
25 __attribute__((interrupt
))
26 void keyb_handler(struct interrupt_frame
*frame
)
29 kprint("Got a keyboard interrupt!\n", 0);
31 int a
= *(int *) (0xa0000000);
34 __attribute__((interrupt
))
35 void pf_handler(struct fault_frame
*frame
)
38 struct pf_errcode errcode
= frame
->error_code
;
39 asm ("mov %%cr2, %0": "=a" (address
));
40 kprint("A page fault occurred!\n", VGA_COLOR_BRIGHT_RED
);
41 kprint("Faulting address: ", 0);
45 kprint("Address points to non-mapped page\n", 0);
48 kprint("Fault occurred while writing to memory\n", 0);
50 kprint("Fault occurred while reading from memory\n", 0);
53 kprint("Fault occurred while fetching instruction\n", 0);
58 __attribute__((interrupt
))
59 void double_fault(struct abort_frame
*frame
)
61 PANIC("double fault");