summaryrefslogtreecommitdiff
path: root/src/kernel/arch/i386/interrupts/isr.c
blob: 96d053ef71fcfaea2c9cebe53e9b8936299f2bb7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <kernel/arch/i386/interrupts/isr.h>
#include <kernel/arch/log.h>
#include <kernel/panic.h>
#include <stdbool.h>
#include <stdint.h>

#define log_n_panic(x) {tty_const(x); panic();}

bool isr_test_interrupt_called = false;

void isr_stage3(int interrupt) {
	switch (interrupt) {
		case 0x08: log_n_panic("#DF"); // double fault
		case 0x0D: log_n_panic("#GP"); // general protection fault
		case 0x0E: log_n_panic("#PF"); // page fault

		case 0x34:
			isr_test_interrupt_called = true;
			return;

		default:   log_n_panic("unknown interrupt");
	}
}