Readme and cleanup

This commit is contained in:
2025-05-30 08:42:43 +02:00
parent 20808a7992
commit a289dcfd17
6 changed files with 35 additions and 31 deletions

View File

@@ -16,6 +16,8 @@ vector_table:
ventry .
ventry irq_handler // IRQ(Interrupt Request) 0x280
ventry .
ventry .
.align 4
@@ -25,26 +27,23 @@ el2_to_el1:
mov x0, #(1 << 31)
msr HCR_EL2, x0
isb
// Set SPSR_EL2: return to EL1h (EL1, using SP_EL1)
// Set SPSR_EL2: return to EL1h
mov x0, #(0b0101)
msr SPSR_EL2, x0
isb
// Set return address to ELR_EL2
ldr x0, =kernel_main
msr ELR_EL2, x0
isb
// Set SP_EL1 to stack base
ldr x0, =__stack_end
msr SP_EL1, x0
isb
// Set VBAR_EL1 to vector table
adr x0, vector_table
msr VBAR_EL1, x0
isb
// Return to EL1