CortexA15 - Where's the IVT?
Posted: Wed Oct 02, 2024 6:14 pm
Bit embarrased to post this because I feel like I'm one google search away from finding the answer, but at the same time, I also feel like it's gonna take forever to figure this out. I went through the Bare Bones for the Cortex A15 board, set everything up, and got it working with the arm-none-eabi toolchain.
From what I've read of the CoreTile Express TRM, the kernel is loaded into the daughterboard memory (p. 45). I've read that the IVT is located at 0x0, while others say it's located at 0xFFFF0000.
To test, I added a section to my stub.S, exceptions, that would load at 0x0:
Then, I make the linker load it to 0x0:
__c_sv_hdlr looks like this:
I verify that it is infact being loaded at 0x000:
It seems like svc_hdlr isn't getting called. Even with
I'm not getting any output. Am I being stupid? What's going on?
From what I've read of the CoreTile Express TRM, the kernel is loaded into the daughterboard memory (p. 45). I've read that the IVT is located at 0x0, while others say it's located at 0xFFFF0000.
To test, I added a section to my stub.S, exceptions, that would load at 0x0:
Code: Select all
// stub.S
.section exceptions
_VectorTable:
b . /* 0x00: Reset vector */
b . /* 0x04: Undefined instruction */
ldr pc, =svc_hdlr /* 0x08: SVC (software), long jump */
b . /* 0x0C: Prefetch */
b . /* 0x10: Data abort */
b . /* 0x14: Reserved */
b . /* 0x18: IRQ */
b . /* 0x1C: FIQ */
// ... later, in section text
svc_hdlr:
mrs r0, spsr
stmdb sp!, {r0-r3, lr} /* Save caller-saved registers */
bl __c_svc_hdlr
ldmia sp!, {r0-r3, lr} /* Restore */
subs pc, lr, #4
Code: Select all
ENTRY(_start)
SECTIONS {
. = 0x000;
.exceptions : { *(.exceptions) }
/* Kernel code in daughterboard / flash memory. */
. = 0x80010000;
...
Code: Select all
void __c_svc_hdlr(uint32_t r0, uint32_t r1, uint32_t r2,
uint32_t r3, uint32_t lr){
printf("r0: %x | r1: %x | r2: %x | r3: %x | lr: %x\n", r0, r1, r2,
r3, lr);
}
Code: Select all
$ arm-none-eabi-objdump -x bin/kernel.elf | grep exceptions
5 exceptions 00000024 00000000 00000000 00001434 2**2
00000000 l d exceptions 00000000 exceptions
00000000 l exceptions 00000000 _VectorTable
Code: Select all
. = 0xFFFF0000;
.exceptions : { *(.exceptions) }
...