summaryrefslogtreecommitdiff
path: root/os/boot.S
blob: afb966c41a5a46ad7f60676efcffea4ad0fd4605 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
.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!"