aboutsummaryrefslogtreecommitdiff
path: root/kernel/include
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/include')
-rw-r--r--kernel/include/isr.h11
-rw-r--r--kernel/include/panic.h1
-rw-r--r--kernel/include/timer.h7
3 files changed, 15 insertions, 4 deletions
diff --git a/kernel/include/isr.h b/kernel/include/isr.h
index 5d6d282..de81cd2 100644
--- a/kernel/include/isr.h
+++ b/kernel/include/isr.h
@@ -34,15 +34,18 @@ extern void _isr29(void);
extern void _isr30(void);
extern void _isr31(void);
-/* installs all the ISR's */
+/* installs ISR's 0-31 */
void isr_init(void);
/* This defines what the stack looks like after an ISR was running */
struct regs_t {
- uint32_t gs, fs, es, ds; /* pushed the segs last */
+ uint32_t gs, fs, es, ds; /* pushed the segs last */
uint32_t edi, esi, ebp, esp, ebx, edx, ecx, eax; /* pushed by 'pusha' */
- uint32_t int_no, err_code; /* our 'push byte #' and ecodes do this */
+ uint32_t err_code; /* exceptions push this */
+ uint32_t int_no; /* interrupt stubs do this */
uint32_t eip, cs, eflags, useresp, ss; /* pushed by the processor automatically */
-};
+} __attribute__((packed));
+
+#define IRQ(x) (32+x)
void set_interrupt_handler(uint8_t interrupt, void (*func)(struct regs_t));
diff --git a/kernel/include/panic.h b/kernel/include/panic.h
new file mode 100644
index 0000000..db53e8e
--- /dev/null
+++ b/kernel/include/panic.h
@@ -0,0 +1 @@
+void panic(const char*, ...);
diff --git a/kernel/include/timer.h b/kernel/include/timer.h
new file mode 100644
index 0000000..a7459a6
--- /dev/null
+++ b/kernel/include/timer.h
@@ -0,0 +1,7 @@
+#include <stdint.h>
+
+extern const uint64_t *current_tick;
+
+struct regs_t;
+
+void timer_init(void);