Got IDT & ISRs working!

This commit is contained in:
2025-03-21 14:09:15 +01:00
parent 05c8ee8f67
commit c3f8d7d8f2
9 changed files with 322 additions and 2 deletions
+26
View File
@@ -0,0 +1,26 @@
#ifndef _ISR_H
#define _ISR_H
#include <kernel.h>
// Interrupt frame (ie. what's on the stack on interrupt)
struct isr_intFrame {
// Pushed by OS
uint32_t esp, ebx, ecx, edx, esi, edi, ebp;
uint32_t ds, es, fs, gs, eax;
uint32_t interrupt, error;
// Pushed by CPU
uint32_t eip, cs, eflags, user_esp, user_ss;
};
typedef void (*isr_handlerPtr)(struct isr_intFrame* iframe);
int isr_init(void);
void isr_registerIRQ(uint8_t i, isr_handlerPtr handler);
int isr_handleInterrupt(struct isr_intFrame iframe);
// Assembly definitions (isr.s)
extern void* isr_redirectTable[48]; // ISR Table
extern void isr128(); // int 0x80 - syscall
#endif