forked from AbleOS/ableos
32 lines
671 B
ArmAsm
32 lines
671 B
ArmAsm
.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:
|