diff options
| author | Nathan Lee <me@nwlee.tech> | 2026-10-03 18:07:22 -0500 |
|---|---|---|
| committer | Nathan Lee <me@nwlee.tech> | 2026-10-03 18:07:22 -0500 |
| commit | c0e0c0f183721a216b047889e63a7bb1b13e7cbe (patch) | |
| tree | 3cabadd33efef89185d91a5270c84ca01af7d400 /website-kernel/arch/start.S | |
| parent | a9fb6013db52e231fa2446fd8c512f5e5e92e4d3 (diff) | |
add memory allocator
Diffstat (limited to 'website-kernel/arch/start.S')
| -rw-r--r-- | website-kernel/arch/start.S | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/website-kernel/arch/start.S b/website-kernel/arch/start.S index 3bb704c..20ddeb1 100644 --- a/website-kernel/arch/start.S +++ b/website-kernel/arch/start.S @@ -10,14 +10,26 @@ _start: la sp, __stack_top + la t0, __data_load + la t1, __data_start + la t2, __data_end + +1: + beq t1, t2, 2f + lw t3, 0(t0) + sw t3, 0(t0) + addi t0, t0, 4 + addi t1, t1, 4 + j 1b + +2: la t0, __bss_start la t1, __bss_end - beq t0, t1, 2f -1: +3: sw zero, 0(t0) addi t0, t0, 4 - bltu t0, t1, 1b -2: + blt t0, t1, 3b + call kernel_main wfi |
