my exception handler sucked so i redid it

This commit is contained in:
2025-06-05 17:32:38 -04:00
parent 87e5e06142
commit 79f04df82e
4 changed files with 73 additions and 20 deletions

View File

@ -28,7 +28,24 @@
#define EXCEPT_VIRT 20
#define EXCEPT_CTRL_PROT 21
void exception_handler(unsigned int i);
struct cpu_state {
uint32_t eax;
uint32_t ebx;
uint32_t ecx;
uint32_t edx;
uint32_t esi;
uint32_t edi;
uint32_t ebp;
} __attribute__((packed));
struct stack_state {
uint32_t error_code;
uint32_t eip;
uint32_t cs;
uint32_t eflags;
} __attribute__((packed));
void exception_handler(struct cpu_state cpu, uint32_t interrupt, struct stack_state stack);
typedef struct {
uint16_t isr_low; // The lower 16 bits of the ISR's address