summaryrefslogtreecommitdiff
path: root/src/boot/entry.S
diff options
context:
space:
mode:
authorRichard Qin <richard.qin.x@gmail.com>2025-12-13 23:21:03 +0800
committerRichard Qin <richard.qin.x@gmail.com>2025-12-13 23:21:03 +0800
commit28fd88e0dd66728b22cd792deb5a1e8636f36ed3 (patch)
tree059cc8350adb68ca994de2c6ccf402895b575d88 /src/boot/entry.S
parent27fc7bda593c8bd2c24a334a368772b5f15d4e9e (diff)
downloadlume-28fd88e0dd66728b22cd792deb5a1e8636f36ed3.tar.gz
lume-28fd88e0dd66728b22cd792deb5a1e8636f36ed3.tar.xz
feat: add preemptive scheduling, SBI timer support and FDT parser.
Diffstat (limited to 'src/boot/entry.S')
-rw-r--r--src/boot/entry.S33
1 files changed, 10 insertions, 23 deletions
diff --git a/src/boot/entry.S b/src/boot/entry.S
index 0ca3b29..c0753c4 100644
--- a/src/boot/entry.S
+++ b/src/boot/entry.S
@@ -1,40 +1,27 @@
+# src/boot/entry.S
.section .text.entry
.global _start
_start:
- csrr t0, mhartid
- bnez t0, .L_park
-
- li t0, 0x1fffffffffffff
- csrw pmpaddr0, t0
- li t0, 0xf
- csrw pmpcfg0, t0
-
- li t0, 0
- li t1, (1 << 11) | (1 << 7)
- csrw mstatus, t1
-
- csrw satp, zero
-
- li t0, 0xffff
- csrw medeleg, t0
- csrw mideleg, t0
-
- la t0, kernel_main
- csrw mepc, t0
+ la t0, g_dtb_addr
+ sd a1, 0(t0)
la sp, stack_top
- mret
+ call kernel_main
.L_park:
wfi
j .L_park
-
.section .bss
.align 4
.global stack_top
stack_base:
.space 4096 * 4
-stack_top: \ No newline at end of file
+stack_top:
+
+.align 8
+.global g_dtb_addr
+g_dtb_addr:
+ .space 8 \ No newline at end of file