aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2021-12-19 19:13:41 +0200
committerKimplul <kimi.h.kuparinen@gmail.com>2021-12-19 19:13:41 +0200
commit98255910aa82c27d04ba79704086eca2310b3075 (patch)
treef588fc5d75d458d93d44993fecbaf232a74da3a4 /arch/riscv
parent9966b49db468de0168c7a455dfb5b4c66c413c4d (diff)
downloadkmi-98255910aa82c27d04ba79704086eca2310b3075.tar.gz
kmi-98255910aa82c27d04ba79704086eca2310b3075.zip
Add cpio newc format reader
+ Still need to actually add in an initrd that uses the format :D
Diffstat (limited to 'arch/riscv')
-rw-r--r--arch/riscv/kernel/main.c27
1 files changed, 3 insertions, 24 deletions
diff --git a/arch/riscv/kernel/main.c b/arch/riscv/kernel/main.c
index c7a1290..40f0eb6 100644
--- a/arch/riscv/kernel/main.c
+++ b/arch/riscv/kernel/main.c
@@ -66,28 +66,6 @@ static pm_t get_kerneltop()
return (pm_t)&__kernel_end;
}
-static pm_t get_initrdtop(void *fdt)
-{
- int chosen_offset = fdt_path_offset(fdt, "/chosen");
- struct cell_info_t ci = get_cellinfo(fdt, chosen_offset);
-
- void *initrd_end_ptr = (void *)fdt_getprop(fdt, chosen_offset,
- "linux,initrd-end", NULL);
-
- return (pm_t)fdt_load_int_ptr(ci.addr_cells, initrd_end_ptr);
-}
-
-static pm_t get_initrdbase(void *fdt)
-{
- int chosen_offset = fdt_path_offset(fdt, "/chosen");
- struct cell_info_t ci = get_cellinfo(fdt, chosen_offset);
-
- void *initrd_base_ptr = (void *)fdt_getprop(fdt, chosen_offset,
- "linux,initrd-start", NULL);
-
- return (pm_t)fdt_load_int_ptr(ci.addr_cells, initrd_base_ptr);
-}
-
static pm_t get_fdttop(void *fdt)
{
const char *b = (const char *)fdt;
@@ -290,15 +268,16 @@ static void init_proc(void *fdt, struct vm_branch_t *b)
t->stack = alloc_uvmem(t, SZ_2M, VM_V | VM_R | VM_W);
/* if it needs heap, it'll ask for it */
- move_init(fdt, (void *)t->bin, sz);
+ move_init(fdt, (void *)t->bin);
jump_to_userspace(t, 0, 0);
}
void __main main(void *fdt)
{
init_dbg(fdt);
- struct vm_branch_t *b = init_vmem(fdt);
+ dbg_fdt(fdt);
+ struct vm_branch_t *b = init_vmem(fdt);
init_mem_blocks();
init_irq(fdt);
init_proc(fdt, b);