From 8cf8be522133548ee25fdcb0258ddf3950a68bcf Mon Sep 17 00:00:00 2001 From: Richard Qin Date: Mon, 8 Dec 2025 22:25:48 +0800 Subject: The start of the project -- A MicroDOS feat: Initial bare-metal RISC-V boot with UART --- src/boot/entry.S | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/boot/entry.S (limited to 'src/boot/entry.S') diff --git a/src/boot/entry.S b/src/boot/entry.S new file mode 100644 index 0000000..1a6f6b8 --- /dev/null +++ b/src/boot/entry.S @@ -0,0 +1,28 @@ +.section .text.entry +.globl _start + +_start: + csrr t0, mhartid + bnez t0, .L_park_harts + + la sp, _stack_top + + la a0, _bss_start + la a1, _bss_end + bge a0, a1, .L_call_main + +.L_clear_bss: + sd zero, (a0) + addi a0, a0, 8 + blt a0, a1, .L_clear_bss + +.L_call_main: + call kernel_main + +.L_infinite_loop: + wfi + j .L_infinite_loop + +.L_park_harts: + wfi + j .L_park_harts \ No newline at end of file -- cgit v1.2.3