1
0
Fork 0
forked from AbleOS/ableos
ableos_time/kernel/src/arch/riscv64/entry.s

32 lines
671 B
ArmAsm
Raw Normal View History

2023-03-30 16:43:04 -05:00
.section .text.entry
.global _start
_start:
# load stack_top to sp register
la sp, stack_top
# The BSS section is expected to be zero
la a0, _bss_start
la a1, _bss_end
bgeu a0, a1, 2f
1:
sd zero, (a0)
addi a0, a0, 8
bltu a0, a1, 1b
2:
call _kernel_start
.section .bss.stack
.global stack
stack:
# alloc stack memory
.space 4096 * 16
.global stack_top
stack_top:
.section .bss.heap
.global _initial_kernel_heap_start
_initial_kernel_heap_start:
# alloc initial kmalloc memory
.space 4096 * 64
.global _initial_kernel_heap_end
_initial_kernel_heap_end: