Files
riscv/os/boot.S
2024-05-13 12:21:59 +02:00

32 lines
508 B
ArmAsm

.option norvc
.section .init
.equ UART_BASE, 0x10000000
.global kstart
kstart:
la a0, _str
call _println
_halt:
wfi
j _halt
_println:
li t0, UART_BASE
_println_loop:
lb t1, 0(a0)
beqz t1, _end_println_loop
sb t1, 0(t0)
addi a0, a0, 1
j _println_loop
_end_println_loop:
li t1, '\n'
sb t1, 0(t0)
ret
.section .rodata
_str: .string "Hello, world!"