Set the _hang trap in mtvec

This commit is contained in:
Rodrigo Arias 2024-08-23 16:46:40 +02:00
parent 2dcb2ac209
commit 417a4d5c75

View File

@ -22,6 +22,10 @@
.globl _start .globl _start
_start: _start:
jal print_hello // Print initial message on HART 0 only jal print_hello // Print initial message on HART 0 only
la t0, _hang
csrw mtvec, t0 // Set the machine trap vector
csrr a0, mhartid // Load HART ID into a0 csrr a0, mhartid // Load HART ID into a0
li s0, DRAM_BASE // Load next address into s0 li s0, DRAM_BASE // Load next address into s0
jr s0 // Jump to s0 jr s0 // Jump to s0