diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2022-01-06 17:41:38 +0200 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2022-01-06 17:41:38 +0200 |
| commit | 513a8d20beeacb3a7fc2c3c140d014f7fb25cd6f (patch) | |
| tree | a4d2cc6cc0bd0990c282d6163767fbfaa12d0718 /arch | |
| parent | 6f052e236715846b1a14f9fe59f89346efb809e6 (diff) | |
| download | kmi-513a8d20beeacb3a7fc2c3c140d014f7fb25cd6f.tar.gz kmi-513a8d20beeacb3a7fc2c3c140d014f7fb25cd6f.zip | |
Jump back to kernelspace tested
+ Added automated categories to debugging, bug/info/warn/error etc. Now
I should just try to use them here and there :D
Diffstat (limited to 'arch')
| -rwxr-xr-x | arch/riscv/conf/init | bin | 1040 -> 968 bytes | |||
| -rw-r--r-- | arch/riscv/conf/initrd | bin | 1536 -> 1536 bytes | |||
| -rw-r--r-- | arch/riscv/conf/s.S | 5 | ||||
| -rw-r--r-- | arch/riscv/kernel/irq.c | 10 | ||||
| -rw-r--r-- | arch/riscv/kernel/vmem.c | 2 |
5 files changed, 11 insertions, 6 deletions
diff --git a/arch/riscv/conf/init b/arch/riscv/conf/init Binary files differindex 43a179c..f05254f 100755 --- a/arch/riscv/conf/init +++ b/arch/riscv/conf/init diff --git a/arch/riscv/conf/initrd b/arch/riscv/conf/initrd Binary files differindex e3704f2..90344c1 100644 --- a/arch/riscv/conf/initrd +++ b/arch/riscv/conf/initrd diff --git a/arch/riscv/conf/s.S b/arch/riscv/conf/s.S index e6997ac..80a3a11 100644 --- a/arch/riscv/conf/s.S +++ b/arch/riscv/conf/s.S @@ -1,7 +1,4 @@ .text .global _start _start: -li a1, 1 -loop: -add a0, a0, a1 -jal loop +ecall diff --git a/arch/riscv/kernel/irq.c b/arch/riscv/kernel/irq.c index ed97c00..f844dd1 100644 --- a/arch/riscv/kernel/irq.c +++ b/arch/riscv/kernel/irq.c @@ -1,13 +1,21 @@ #include <apos/irq.h> +#include <apos/attrs.h> +#include <apos/debug.h> #include <csr.h> void init_irq(void *fdt) { UNUSED(fdt); + csr_write(CSR_STVEC, &handle_irq); + + long s = 0; + csr_read(CSR_SIE, s); + info("CSR_SIE: %lx\n", s); } -void handle_irq() +__aligned(4) void handle_irq() { + while(1); } /* very simple for now */ diff --git a/arch/riscv/kernel/vmem.c b/arch/riscv/kernel/vmem.c index c862cea..1f1f44a 100644 --- a/arch/riscv/kernel/vmem.c +++ b/arch/riscv/kernel/vmem.c @@ -177,6 +177,6 @@ int setup_kernel_io(struct vm_branch *b, vm_t paddr) /* assume Sv39 for now */ pm_t gigapage = paddr / MM_GPAGE_SIZE; b->leaf[IO_PAGE] = (struct vm_branch *)to_pte(gigapage, VM_V | VM_R | VM_W); - return 0; + return -SZ_1G + paddr - (gigapage * MM_GPAGE_SIZE); } #endif |
