summaryrefslogtreecommitdiff
path: root/src/boot
diff options
context:
space:
mode:
authorRichard Qin <richard.qin.x@gmail.com>2026-01-03 02:19:57 +0800
committerRichard Qin <richard.qin.x@gmail.com>2026-01-03 02:19:57 +0800
commit210025560c80b48af4875af199f183ad709e3bf0 (patch)
treeeb11aeb7b641187f207e3b572c5184cf3526b463 /src/boot
parentbde87490d61135dcaa94d9b1489ff6c39876d169 (diff)
parent10614e04929a6d109a5e90524e446b637aaf0c13 (diff)
downloadlume-210025560c80b48af4875af199f183ad709e3bf0.tar.gz
lume-210025560c80b48af4875af199f183ad709e3bf0.tar.xz
Merge pull request #4 from Richard-Qin-001/dev/shell
Rebuilt the system's underlying structure; it is now stable enough to merge. The system now supports a read-only file system and has a simple shell implemented.
Diffstat (limited to 'src/boot')
-rw-r--r--src/boot/entry.S26
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