Imagine a 32-bit x86 computer with less than 3 gigabytes of memory with CPU set up with disabled paging and flat segment descriptors (0x0
as base, 0xffffffff
as an effective limit for both data and code).
What happens when an instruction in ring0 tries to use a mov
instruction to reference a physical address that is not backed by any memory address?
QEMU emulation just stalls with an error like "fatal: Trying to execute code outside RAM or ROM".
These exceptions are related to memory issues:
- It shouldn't be "Segment Not Present (
#NP
)": it only happens when segment registers are loaded, but I can actually load flat segments without problems. - "Stack Fault (
#SS
)" should not be generated, because the code doesn't reference stack. - "General Protection (
#GP
)" shouldn't happen because the code is running in ring-0 and segments are set up to allow access to every physical address. - Paging is disabled, so it's not a "Page Fault (
#PF
)" either. - And it's not an alignment problem, so it shouldn't trigger "Alignment Check (
#AC
)".
I ran out of options and I don't know what should happen.