aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv64/init/start.S
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2024-07-05 19:38:11 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2024-07-05 19:38:11 +0300
commite09edb5d54e39bd9509a1dc450df5ab320759f97 (patch)
tree78e050b0db87df3a3ddfbb6570d44513ac34e02a /arch/riscv64/init/start.S
parent98f21e694a6b0964d6d08196cb6bfbc1c2ae2ff4 (diff)
downloadkmi-e09edb5d54e39bd9509a1dc450df5ab320759f97.tar.gz
kmi-e09edb5d54e39bd9509a1dc450df5ab320759f97.zip
allow booting with Qemu's -kernel flag directly
+ Took some fairly significant changes, for one the kernel is no longer relocated at the start of a boot, instead it sits wherever the user decides the kernel should sit. Similarly, the initial kernel stack and page table are stored within the binary, slightly bloating the size but making it much safer to boot since there's really no chance of us overwriting the fdt or initrd in memory.
Diffstat (limited to 'arch/riscv64/init/start.S')
-rw-r--r--arch/riscv64/init/start.S38
1 files changed, 0 insertions, 38 deletions
diff --git a/arch/riscv64/init/start.S b/arch/riscv64/init/start.S
deleted file mode 100644
index b6394f7..0000000
--- a/arch/riscv64/init/start.S
+++ /dev/null
@@ -1,38 +0,0 @@
-/* SPDX-License-Identifier: copyleft-next-0.3.1 */
-/* Copyright 2021 - 2022, Kim Kuparinen < kimi.h.kuparinen@gmail.com > */
-
-/* generic u-boot passes argc and argv as if we were a regular
- * program, so our load address must be placed third.
- * If we have a 'custom' u-boot with kmi support, the fdt
- * will be passed to us directly, so the load address can go second.
- */
-#if GENERIC_UBOOT
-# define LOAD_REG a2
-# define INIT init_go
-#else
-# define LOAD_REG a1
-# define INIT init
-#endif
-
-.section .init
-.global _start
-/* Entry point to the kernel loader. */
-_start:
-/* get load address */
-auipc LOAD_REG, 0
-/* keep using bootloader stack for now */
-//li sp, PM_STACK_TOP
-/* make sure there's no garbage in tp, important for id assignment */
-li tp, 0
-call INIT
-// INIT shouldn't return, but if we do we might as well just jump back to u-boot
-// or wherever
-ret
-
-.section .text
-.global jump_to_kernel
-jump_to_kernel:
-li sp, VM_STACK_TOP // load virtual stack address
-li fp, 0
-li gp, 0
-jr a2 // jump to kernel