2025-06-17 02:40:02 +00:00
|
|
|
#include "interrupt_handlers.h"
|
|
|
|
|
#include "kio.h"
|
|
|
|
|
|
|
|
|
|
void generic_isr_handler(StateSnapshot_t* cpu_state) {
|
|
|
|
|
//We made it to C for our interrupt! For now, let's just print our interrupt to the screen.
|
|
|
|
|
vga_clear();
|
|
|
|
|
vga_printf("INTERRUPT TRIGGERED! Info below.\n");
|
|
|
|
|
vga_printf("Int_ID|ERR: %X|%X\n", cpu_state->interrupt_id, cpu_state->error_code);
|
|
|
|
|
vga_printf("EFLAGS|CS|EIP: %X|%X|%X\n", cpu_state->eflags, cpu_state->cs,cpu_state->eip);
|
2025-06-28 05:35:35 +00:00
|
|
|
vga_printf("GP Registers:\neax:%X\nebx:%X\necx:%X\nedx:%X\nesp:%X\nebp:%X\nesi:%X\nedi:%X\n",
|
|
|
|
|
cpu_state->eax,
|
|
|
|
|
cpu_state->ebx,
|
|
|
|
|
cpu_state->ecx,
|
|
|
|
|
cpu_state->edx,
|
|
|
|
|
cpu_state->esp,
|
|
|
|
|
cpu_state->ebp,
|
|
|
|
|
cpu_state->esi,
|
|
|
|
|
cpu_state->edi);
|
2025-06-17 02:40:02 +00:00
|
|
|
vga_printf("HALT!");
|
|
|
|
|
while(1);
|
|
|
|
|
}
|