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) }
...