sbl b16: banner blx redirected to print stublet 0x8062150

This commit is contained in:
SashegDev
2026-09-11 06:40:20 +00:00
parent 537e2b6b2a
commit afc151ce0c
3 changed files with 66 additions and 0 deletions
+21
View File
@@ -439,6 +439,27 @@ static void saimaa_machine_init(MachineState *machine)
cpu_physical_memory_write(0x08062140 + k, &word, 4);
}
}
/* Banner stub at 0x08062150: print r0 string via UARTDM
* (b16 redirects 0x802f690 blx here). Built from qemu/banner.S */
{
static const uint8_t bn[] = {
0x4f, 0xf2, 0x00, 0x03, /* movw r3,#0xf000 */
0xc0, 0xf2, 0x8a, 0x73, /* movt r3,#0x78a */
0x10, 0xf8, 0x01, 0x1b, /* ldrb r1,[r0],#1 */
0x09, 0xb1, /* cbz r1,done */
0x19, 0x67, /* str r1,[r3,#0x70] */
0xfa, 0xe7, /* b loop */
0x00, 0x20, /* movs r0,#0 */
0x70, 0x47, /* bx lr */
};
size_t k;
for (k = 0; k < sizeof(bn); k += 4) {
uint32_t word = 0;
size_t n = sizeof(bn) - k < 4 ? sizeof(bn) - k : 4;
__builtin_memcpy(&word, &bn[k], n);
cpu_physical_memory_write(0x08062150 + k, &word, 4);
}
}
/* stack zone defaults to plain-stub addr: every register
* popped from untouched stack becomes callable (returns 0). */
{