summaryrefslogtreecommitdiff
path: root/src/irq_handlers.c
blob: fa3e0380a19d4107966e17b31ea51f47e32697e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

#include "interrupt.h"
#include "port.h"
#include "bees.h"
#include "keyboard.h"
#include <stdint.h>

uint8_t ps2_read() {
	const struct port ps2_port = {0x60, port8bit};
	return port_read(ps2_port);
}

#define IRQH(I) void irqh_ ## I ()
#define EXCH(I) void exch_ ## I ()

IRQH(0x00) {return;}
IRQH(0x01) {keyboard_event(&ps2_read);}

EXCH(0x00) {bees("division by zero");}
EXCH(0x01) {bees("values of beta may give rise to dom!");}
EXCH(0x02) {bees("lp0 on fire");}
EXCH(0x03) {bees("values of beta may give rise to dom!");}
EXCH(0x06) {bees("invalid opcode (bad!)");}
EXCH(0x07) {bees("values of beta may give rise to dom!");}
EXCH(0x08) {bees("double fault");}
EXCH(0x0D) {bees("general protection fault");}