From cdec826bb86e695fe9a143cbb65782c3d18c1cd5 Mon Sep 17 00:00:00 2001 From: Yaya48 Date: Tue, 13 Oct 2026 21:09:18 +0200 Subject: [PATCH] StarletBootstrapProbe: --mmu-faults Enables the ARM926 MMU aborts of ARMCore (SetMMUFaultsEnabled) for the run. Without the option the probe behaves as before. Co-Authored-By: Claude Opus 5.5 --- .../StarletBootstrapProbe/StarletBootstrapProbe.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Tools/StarletBootstrapProbe/StarletBootstrapProbe.cpp b/Tools/StarletBootstrapProbe/StarletBootstrapProbe.cpp index 35d6762c61..5263fb307a 100644 --- a/Tools/StarletBootstrapProbe/StarletBootstrapProbe.cpp +++ b/Tools/StarletBootstrapProbe/StarletBootstrapProbe.cpp @@ -40,7 +40,7 @@ bool FailOnAlert(const char* caption, const char* text, bool, Common::MsgType) std::_Exit(ALERT_EXIT_STATUS); } -bool Run(const std::string& path, bool jit, ExpectedOutcome expected) +bool Run(const std::string& path, bool jit, bool mmu_faults, ExpectedOutcome expected) { std::ifstream file(path, std::ios::binary | std::ios::ate); if (!file || file.tellg() <= 0 || file.tellg() > 16 * 1024 * 1024) @@ -74,6 +74,8 @@ bool Run(const std::string& path, bool jit, ExpectedOutcome expected) core.SetJitEnabled(jit); core.Reset(info.entry); core.SetBigEndian(true); + // StarOS MMU-001: translation, domain, permission and alignment aborts (off by default). + core.SetMMUFaultsEnabled(mmu_faults); constexpr u32 TRACE_MAGIC = 0x52455631; constexpr u32 TRACE_CAPACITY = 1024; for (int slice = 0; slice < 512; ++slice) @@ -148,13 +150,14 @@ bool Run(const std::string& path, bool jit, ExpectedOutcome expected) int main(int argc, char** argv) { Common::RegisterMsgAlertHandler(FailOnAlert); - if (argc < 2 || argc > 4) + if (argc < 2 || argc > 5) { - std::cerr << "Usage: StarletBootstrapProbe [--jit] " + std::cerr << "Usage: StarletBootstrapProbe [--jit] [--mmu-faults] " "[--expect-panic|--expect-fatal-data|--expect-undefined-fault|--expect-phase2]\n"; return 2; } bool jit = false; + bool mmu_faults = false; ExpectedOutcome expected = ExpectedOutcome::Idle; bool outcome_selected = false; for (int index = 2; index < argc; ++index) @@ -162,6 +165,8 @@ int main(int argc, char** argv) const std::string_view option = argv[index]; if (option == "--jit") jit = true; + else if (option == "--mmu-faults") + mmu_faults = true; else if (option == "--expect-panic" || option == "--expect-fatal-data" || option == "--expect-undefined-fault" || option == "--expect-phase2") { @@ -189,7 +194,7 @@ int main(int argc, char** argv) auto& system = Core::System::GetInstance(); system.SetIsWii(true); system.GetMemory().Init(); - const bool passed = Run(argv[1], jit, expected); + const bool passed = Run(argv[1], jit, mmu_faults, expected); system.GetMemory().Shutdown(); return passed ? 0 : 1; }