rumpk/apps/subject_entry.S

33 lines
602 B
ArmAsm
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

.section .text._start, "ax"
.global _start
_start:
# 🕵 DIAGNOSTIC: BREATHE
li t0, 0x10000000
li t1, 0x23 # '#'
sb t1, 0(t0)
# Clear BSS (64-bit aligned zeroing)
la t0, __bss_start
la t1, __bss_end
1: bge t0, t1, 2f
sd zero, 0(t0)
addi t0, t0, 8
j 1b
2:
fence rw, rw
# 🕵 DIAGNOSTIC: READY TO CALL MAIN
li t0, 0x10000000
li t1, 0x21 # '!'
sb t1, 0(t0)
# Arguments (argc, argv) are already in a0, a1 from Kernel
# sp is already pointing to argc from Kernel
call main
# Call exit(result)
call exit
1: j 1b