mirror of
https://github.com/gbowne1/ClassicOS.git
synced 2025-10-13 21:25:07 -07:00
new OS
This commit is contained in:
21
kernel/isr.c
Normal file
21
kernel/isr.c
Normal file
@@ -0,0 +1,21 @@
|
||||
#include "terminal.h"
|
||||
#include "serial.h"
|
||||
|
||||
void isr_handler(uint32_t int_num, uint32_t err_code) {
|
||||
terminal_write("Interrupt occurred: ");
|
||||
// Add simple int-to-string printing here
|
||||
serial_write("INT triggered\n");
|
||||
|
||||
if (int_num == 0) {
|
||||
terminal_write(" -> Divide by zero error!\n");
|
||||
} else if (int_num == 13) {
|
||||
terminal_write(" -> General Protection Fault!\n");
|
||||
} else {
|
||||
terminal_write(" -> Unknown interrupt\n");
|
||||
}
|
||||
|
||||
// Halt CPU
|
||||
while (1) {
|
||||
asm volatile ("hlt");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user