diff options
author | Christian Cunningham <cc@localhost> | 2022-02-24 18:38:20 -0700 |
---|---|---|
committer | Christian Cunningham <cc@localhost> | 2022-02-24 18:38:20 -0700 |
commit | a9e89946ad7f6918b954d7416c755a90c0eace9d (patch) | |
tree | 35a624cdc2fa135bc435aaf40bb2e294902a3dd1 | |
parent | a621bee817320cc3e17b097da29b3d46c62a90b4 (diff) |
Fixed HYP Code
-rw-r--r-- | Common.mk | 3 | ||||
-rw-r--r-- | src/boot.S | 7 | ||||
-rw-r--r-- | src/sys/kernel.S | 2 |
3 files changed, 11 insertions, 1 deletions
@@ -108,3 +108,6 @@ tree: test: clean build/kernel.elf @tput setaf 6 2> /dev/null || true; echo Running Tests; tput sgr0 2> /dev/null || true @./tests/run.sh + +copy: clean build/kernel7.img + sudo cp build/kernel7.img /mnt/sd0 @@ -9,13 +9,20 @@ _start: reset: cpsid aif + + // Exit Hypervisor Mode mrs r0, cpsr + and r1, r0, #0x1F + cmp r1, #0x1A + bne 1f bic r0, r0, #0x1f orr r0, r0, #0x13 msr spsr_cxsf, r0 add r0, pc, #4 msr ELR_hyp, r0 eret + +1: // disable core0,1,2. mrc p15, #0, r1, c0, c0, #5 and r1, r1, #3 diff --git a/src/sys/kernel.S b/src/sys/kernel.S index cfd396f..654a9a7 100644 --- a/src/sys/kernel.S +++ b/src/sys/kernel.S @@ -10,7 +10,7 @@ kernel_main: bl sysinit // Intentional undefined instruction - //.word 0xf7f0a000 + // .word 0xf7f0a000 cpsie aif, #0x10 svc #2 // Start scheduling! 1: |