From 27ffa747f36aee9c1d5bbc61395a078238366070 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Thu, 11 May 2023 22:55:31 +0300 Subject: arbitrary load address and RAM base detection + Both kind of go hand in hand, made sense to do both at the same time. Some parts feel slightly hacky, the loader works by placing everything on the stack and avoiding global values. Still, seems to work? --- arch/riscv64/kernel/vmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/riscv64/kernel/vmem.c') diff --git a/arch/riscv64/kernel/vmem.c b/arch/riscv64/kernel/vmem.c index 6fd7069..d0cac2c 100644 --- a/arch/riscv64/kernel/vmem.c +++ b/arch/riscv64/kernel/vmem.c @@ -427,7 +427,7 @@ stat_t populate_kvmem(struct vmem *b) size_t flags = VM_V | VM_R | VM_W | VM_X | VM_G; for (size_t i = KSTART_PAGE; i < IO_PAGE; ++i) b->leaf[i] = (struct vmem *)to_pte( - RAM_BASE + TOP_PAGE_SIZE * (i - KSTART_PAGE), flags); + get_ram_base() + TOP_PAGE_SIZE * (i - KSTART_PAGE), flags); /* map in IO region */ map_io_dbg(b); -- cgit v1.3