Draft: start lab 3

This commit is contained in:
2025-03-23 11:21:31 +08:00
parent 45ebb20cf2
commit 9d19b8b3b6
5 changed files with 122 additions and 1 deletions

View File

@@ -14,6 +14,9 @@ wait:
run: // cpu id == 0
mov x20, x0
bl el2_to_el1
adrp x0, __stack_end
mov sp, x0
@@ -25,3 +28,11 @@ run: // cpu id == 0
mov x0, x20
bl main
b wait
el2_to_el1:
mov x0, (1 << 31)
msr hcr_el2, x0
mov x0, 0x3c5
msr spsr_el2, x0
msr elr_el2, lr
eret