kprintf and kprint_float

This commit is contained in:
Liam Kerr 2026-02-09 02:55:15 +00:00
parent 6208ae369d
commit 2564aa6aba
4 changed files with 28 additions and 2 deletions

View file

@ -4,12 +4,16 @@ _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
li t0, 0x00006000 # Load the mask for FS bits. enable float
csrs mstatus, t0 # Set the FS bits to 11 (Dirty/Initial). enable float
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:
csrr a0, mcause # Argument 1: mcause
csrr a1, mepc # Argument 2: mepc
j handle_trap
.section .bss
.align 16