kernel panic and trapping :)

This commit is contained in:
Liam Kerr 2026-02-08 22:41:38 +00:00
parent fae2e42f8f
commit da95a4acfa
5 changed files with 70 additions and 1 deletions

View file

@ -2,11 +2,15 @@
.global _start
_start:
la sp, stack_top # Set up the stack pointer
la t0, trap_entry # Set up the trap handler
csrw mtvec, t0 # Set the trap vector to our trap handler
call kmain # Jump to our C code
loop:
wfi # Wait for Interrupt (saves CPU)
j loop # Infinite loop if C returns
.align 4
trap_entry:
j handle_trap
.section .bss
.align 16
stack_low: