summaryrefslogtreecommitdiff
path: root/src/irq_handlers.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/irq_handlers.c')
-rw-r--r--src/irq_handlers.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/irq_handlers.c b/src/irq_handlers.c
new file mode 100644
index 0000000..19db144
--- /dev/null
+++ b/src/irq_handlers.c
@@ -0,0 +1,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 (this is weird!)");}
+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");}