summaryrefslogtreecommitdiff
path: root/kernel/interrupts.h
diff options
context:
space:
mode:
authorMiguel <m.i@gmx.at>2018-09-09 14:26:20 +0200
committerMiguel <m.i@gmx.at>2018-09-09 14:26:20 +0200
commit9a4b35fd5a32490f8f15b48f978e7b1fbfdceb2a (patch)
treeaf39516afa68237379c30bb67aad1136ccabb2f3 /kernel/interrupts.h
parentc2ef64149849fcae608b1c6010303eca86229d22 (diff)
gdt cleanup, reorder info collection to start
Diffstat (limited to 'kernel/interrupts.h')
-rw-r--r--kernel/interrupts.h29
1 files changed, 20 insertions, 9 deletions
diff --git a/kernel/interrupts.h b/kernel/interrupts.h
index 48e8c20..80fa95e 100644
--- a/kernel/interrupts.h
+++ b/kernel/interrupts.h
@@ -11,29 +11,38 @@
*
* Exceptions
* ----------
- * 0x00-0x12 Exceptions
+ * * 0x00-0x12 Exceptions
*
* Legacy PIC
* ----------
- * 0x20-0x27 disabled pic
- * 0x28-0x36 disabled pic
+ * * 0x20-0x27 disabled pic
+ * * 0x28-0x36 disabled pic
*
* Hardware Interrupts
* -------------------
* This interrupts are remapped by the IOAPIC
*
- * 0x0 PIT Timer -> 0x90
- * 0x1 Keyboard -> 0x91
- * 0xC Mouse -> 0x92
+ * * 0x0 PIT Timer -> 0x90
+ * * 0x1 Keyboard -> 0x91
+ * * 0xC Mouse -> 0x92
*
* Local Interrupts from LAPICs
* ----------------------
- * 0x8C APIC Timer
+ * * 0x8C APIC Timer
*
* Software Interrupts
* -------------------
- * 0x80 System Call
- * 0x81 IPI
+ * * 0x80 System Call
+ * * 0x81 IPI
+ *
+ * Usage
+ * -----
+ *
+ * Run interrupts_init() once first with the desired selector, usually 0x08.
+ * After that you can install the interrupts on each cpu via interrupts_install.
+ * interrupt_handler() and exception_handler() will be called accordingly from
+ * the interrupt handlers this functionality is backed by. You can find them
+ * in asm_int.h
*/
#define INTERRUPT_PIT_TIMER 0x90
@@ -46,5 +55,7 @@
void interrupts_init(uint16_t sel);
void interrupts_install();
+uint32_t interrupt_handler(uint32_t esp, uint32_t irq);
+void exception_handler(uint32_t esp, uint32_t irq);
#endif