test(bios): integrate pinned BIOS read-protection baseline

Add --suite bios with hash-verified upstream files and the ARM evaluation checkpoint at 0x08000248. Preserve the r12=0 assertion, original BIOS boot, and all test bytes. Add synthetic adapter and CLI regressions.

On Darwin arm64 the public ROM fails test 1 in debug and release after 64 steps and 543 nominal cycles. Document that this tests protected reads of Nintendo firmware opcodes, not general BIOS service compatibility. Online and offline preparation agree; 39 Python tests pass. Core behavior is unchanged.
This commit is contained in:
0xrsydn 2026-10-05 21:31:04 +07:00
commit 6e736c634b
11 changed files with 143 additions and 8 deletions

View file

@ -26,9 +26,12 @@ class PreparationTests(unittest.TestCase):
elif self.suite == "thumb":
data = struct.pack("<IIHHI", 0xEAFFFFFE, 0xE1A00000, 0xA000, 0x4700, 0xE92D0003)
pc, result = "0x0800000c", 7
else:
elif self.suite == "memory":
data = struct.pack("<III", 0xEAFFFFFE, 0xE1A00000, 0xE92D0003)
pc, result = "0x08000008", 12
else:
data = struct.pack("<IIII", 0xEAFFFFFE, 0xE1A00000, 0xE1A00000, 0xE92D0003)
pc, result = "0x0800000c", 12
self.files = {
self.rom: data,
"LICENSE": b"Original fixture, not upstream license content.\n",
@ -192,6 +195,10 @@ class MemoryPreparationTests(PreparationTests):
suite = "memory"
class BiosPreparationTests(PreparationTests):
suite = "bios"
class SuiteSelectionTests(unittest.TestCase):
def test_unknown_suite_is_rejected_before_download_or_output(self):
with tempfile.TemporaryDirectory() as temp:
@ -210,6 +217,7 @@ class SuiteSelectionTests(unittest.TestCase):
("arm", "0x08001d4c", 12),
("thumb", "0x08000934", 7),
("memory", "0x08000350", 12),
("bios", "0x08000248", 12),
]:
lock = json.loads(adapter.LOCKS[suite].read_text())
self.assertEqual(lock["repository"], "jsmolka/gba-tests")