diff options
| author | Richard Qin <richard.qin.x@gmail.com> | 2025-12-31 18:00:55 +0800 |
|---|---|---|
| committer | Richard Qin <richard.qin.x@gmail.com> | 2025-12-31 18:00:55 +0800 |
| commit | dbba25aa24f86c1f8c3a0589c82985840adc1b6b (patch) | |
| tree | 11d1d7ee552030d953db9f911d5af6e079291c47 /src/boot | |
| parent | 7759eef8cdac79028dd5b468bd9ce0cf1c12b162 (diff) | |
| download | lume-dbba25aa24f86c1f8c3a0589c82985840adc1b6b.tar.gz lume-dbba25aa24f86c1f8c3a0589c82985840adc1b6b.tar.xz | |
dev:Refactor Memory Management and Process Management
Diffstat (limited to 'src/boot')
| -rw-r--r-- | src/boot/entry.S | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/boot/entry.S b/src/boot/entry.S index 924d7d6..6d75bcf 100644 --- a/src/boot/entry.S +++ b/src/boot/entry.S @@ -2,13 +2,29 @@ .global _start _start: - la t0, g_dtb_addr - sd a1, 0(t0) - mv tp, a0 - la sp, stack_top + la t0, stack_base + li t1, 4096 + addi t2, a0, 1 + mul t1, t1, t2 + add sp, t0, t1 + + bnez a0, .L_jump_main + + la t0, sbss + la t1, ebss +.L_clear_bss: + bge t0, t1, .L_save_dtb + sd zero, 0(t0) + addi t0, t0, 8 + j .L_clear_bss + +.L_save_dtb: + la t0, g_dtb_addr + sd a1, 0(t0) +.L_jump_main: call kernel_main .L_park: @@ -19,7 +35,7 @@ _start: .align 4 .global stack_top stack_base: - .space 4096 * 4 + .space 4096 * 8 stack_top: .align 8 |
