This commit is contained in:
TOKISAKIX\21168
2023-12-11 21:54:53 +08:00
parent 910ee11168
commit e720a0dfc2
57 changed files with 2621 additions and 2152 deletions

View File

@@ -15,7 +15,7 @@
.section .text.init
.globl _start
_start:
li sp, 4096 # Initialize stack pointer
li sp, 0x10000000 # Initialize stack pointer
call main # Jump to main function
loop:
j loop # Loop forever
@@ -26,6 +26,16 @@ enable_interrupt:
li t0, 0x1888
csrrw t1, mstatus, t0 # enable interrupt
ret
.globl enable_paging
enable_paging:
li t0, 0x80000005 # ppn << 12 = 0x005000
csrw satp, t0
ret
.globl get_mtval
get_mtval:
csrr a0, mtval
ret
.globl get_epc
get_epc:
csrr a0, mepc