I am doing development on QEMU with the ARM and I have implemented my (SWI instruction) software interrupt and I was working on the instruction abort and data abort exceptions. The problem is I can never seem to get them to trigger. I have tried writing values all through memory in a loop, and also reading values. It seems like QEMU just gives me a 0x0 for a location that does not exist and any writes go through but do not change the value from 0x0.
This of course is not abnormal to me because I figure QEMU is just ignoring the writes, and returning 0 for any 32-bit reads at least. Also, I have read that real hardware can choose to not generate the exceptions depending on the memory hardware if it so desired. Also as you can see below I am incrementing by one which produces unaligned memory accesses (which correctly return undefined results), but do not trigger an exception. I have also read some hardware does or does not generate an abort on unaligned memory access.
Basically, I am wondering is this correct? Or, does it generate ABORT exceptions in some situations?
Here is my code that is running:
Code: Select all
uint32 volatile *p = (uint32*)0x100;
while (1) {
if (*p == 0)
*p = 0x12345678;
k_sprintf(buf, "%x [%x]\n", p, *p);
k_serdbg_puts(buf);
p = (uint32*)((uintptr)p + 0x1);
}