about summary refs log tree commit diff stats
path: root/kernel.soso/isr.h
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2019-09-14 01:42:29 -0700
committerKartik Agaram <vc@akkartik.com>2019-09-14 01:45:55 -0700
commit46bb1d3157f9ad575c83a4bfa1e32b0d21bc8546 (patch)
tree28918f653d7cf970d33d5592047ef663289aca40 /kernel.soso/isr.h
parentded2b24ce28f4a9df75ce40117f0f06f09574369 (diff)
downloadmu-46bb1d3157f9ad575c83a4bfa1e32b0d21bc8546.tar.gz
5650 - support a second OS: soso
https://github.com/ozkl/soso

+ Much smaller than Linux; builds instantly
+ Supports graphics
- No network support
- Doesn't work on a cloud server (yet?)
Diffstat (limited to 'kernel.soso/isr.h')
-rw-r--r--kernel.soso/isr.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/kernel.soso/isr.h b/kernel.soso/isr.h
new file mode 100644
index 00000000..15f5c8ac
--- /dev/null
+++ b/kernel.soso/isr.h
@@ -0,0 +1,37 @@
+#ifndef ISR_H
+#define ISR_H
+
+#include "common.h"
+
+#define IRQ0 32
+#define IRQ1 33
+#define IRQ2 34
+#define IRQ3 35
+#define IRQ4 36
+#define IRQ5 37
+#define IRQ6 38
+#define IRQ7 39
+#define IRQ8 40
+#define IRQ9 41
+#define IRQ10 42
+#define IRQ11 43
+#define IRQ12 44
+#define IRQ13 45
+#define IRQ14 46
+#define IRQ15 47
+
+typedef struct Registers
+{
+    uint32 gs;
+    uint32 fs;
+    uint32 es;
+    uint32 ds;
+    uint32 edi, esi, ebp, esp, ebx, edx, ecx, eax; //pushed by pusha
+    uint32 interruptNumber, errorCode;             //if applicable
+    uint32 eip, cs, eflags, userEsp, ss;           //pushed by the CPU
+} Registers;
+
+typedef void (*IsrFunction)(Registers*);
+void registerInterruptHandler(uint8 n, IsrFunction handler);
+
+#endif //ISR_H