Address spaces¶
RetailOS runs from two places at once, and each place has its own conversion between the address Ghidra shows and the address a running machine reports. Get one wrong and the result still disassembles into a believable function.
The image loads twice¶
osos-dec.dfu is not loaded at one base. Its first 0xB65C bytes stay in the SRAM window at
0x22000000, and everything past that runs from DRAM at 0x08000000.
Two conventions are in use, and mixing them makes cross-references vanish.
| Convention | Where it comes from |
|---|---|
| project | what Ghidra shows, what the notes quote, what every FUN_xxxxxxxx is |
| runtime | what a trace, a breakpoint or a profile reports |
The DRAM half¶
The SRAM half¶
The SRAM half has a conversion of its own. The container's 0x800-byte header is not part of the
runtime image, because the machine loads file[0x800:] at 0x22000000. So for the first 0xB65C
bytes:
Check any batch of SRAM conversions against a known pair before trusting it.
| Project | Runtime | What it is |
|---|---|---|
0x22000e14 |
0x22000614 |
the service dispatcher |
0x22004324 |
0x22003b24 |
the idle loop's WFI |
Only trace addresses get converted¶
The dump's headers, the notes and every FUN_xxxxxxxx already hold project addresses. Adding 0x800
to one of those is the same mistake, the other way round.
The conversion applies to an address that came from a running machine, and to nothing else. Branch
targets count as part of their listing. A bl 0x22007bf4 inside a project-addressed listing is a
project target, in the same space as the listing around it.
Why a wrong conversion is hard to see¶
ARM decodes at any aligned offset, so a conversion error hands back a real function with a plausible
body, and nothing reports an error. A boot profile converted with the wrong offset can put two thirds
of a boot on a mov pc, lr CP15 stub, when the samples really sit on the idle loop's WFI, 0x800
away. A known pair catches that.
Two traps in the file itself¶
Search osos-dec.dfu, the decrypted image. The encrypted osos.bin is still in the tree, and every
string or constant search against it comes back empty. That looks exactly like the code being absent.
Option filenames in the firmware are stored shifted left by one bit and shifted back at runtime, so
strings cannot see them.