tiny_os/root/root.S

20 lines
272 B
ArmAsm
Raw Normal View History

2024-06-16 23:39:04 +08:00
.macro syscall msg ptr
li a0, \msg
li a1, \ptr
ecall
.endm
.text
.global _start
_start:
la t0, msg
.loop:
lb a2, 0(t0)
beqz a2, _start # print forever
syscall (1<<12 | 1), 1 # see uapi/syscall.rs
addi t0, t0, 1
j .loop
.data
msg : .string "Hello, world!\n\0"