diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2021-10-26 12:42:01 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2021-10-26 12:42:01 +0300 |
| commit | 5c335752c4fb7e472d68b2b2731c3674a10cbd97 (patch) | |
| tree | 9339ea883b640c177e699a98aae9601a04310258 /arch/riscv/kernel | |
| parent | 7f7b3d61baf46fe358d3f1bd1cb584e0daed3a81 (diff) | |
| download | kmi-5c335752c4fb7e472d68b2b2731c3674a10cbd97.tar.gz kmi-5c335752c4fb7e472d68b2b2731c3674a10cbd97.zip | |
Identified issue with vmem implementation
+ Sensible mappings should help, discard what I wrote in the previous
commit. Nothing works unless I get vmem up and running properly.
Diffstat (limited to 'arch/riscv/kernel')
| -rw-r--r-- | arch/riscv/kernel/main.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/riscv/kernel/main.c b/arch/riscv/kernel/main.c index d4fa7b8..207b0bc 100644 --- a/arch/riscv/kernel/main.c +++ b/arch/riscv/kernel/main.c @@ -8,6 +8,8 @@ static void kernel_dbg(void *fdt) { struct dbg_info_t dbg = dbg_from_fdt(fdt); + map_vmem(ROOT_PTE, (pm_t)dbg.dbg_ptr, (vm_t)dbg.dbg_ptr, + VM_R | VM_W | VM_V, MM_KPAGE); dbg_init(dbg.dbg_ptr, dbg.dev); } @@ -17,14 +19,11 @@ static void kernel_dbg(void *fdt) static void map_fdt(struct vm_branch_t *branch, vm_t fdt_base, vm_t fdt_top) { - map_vregion(branch, fdt_base, 0, fdt_top - fdt_base, VM_R | VM_W |VM_V); + map_vregion(branch, fdt_base, fdt_base, fdt_top - fdt_base, VM_R | VM_W |VM_V); } void __main main(struct init_data_t d) { - /* feck */ - dbg_init(0x10000000, NS16550A); - dbg("test\n"); init_pmap((void *)d.pmap_base); init_mem(d.max_order, d.bits, d.page_shift); init_vmem(ROOT_PTE, d.tmp_pte); @@ -32,6 +31,7 @@ void __main main(struct init_data_t d) /* TODO: mark kernel area as used */ map_fdt(ROOT_PTE, d.fdt_base, d.fdt_top); kernel_dbg((void *)d.fdt_base); + dbg("test\n"); /* TODO: approximate order of business: * setup debugging in vmem (requires mapping fdt) * free unnecessary init |
