diff --git a/exosphere/mariko_fatal/source/fatal_display.cpp b/exosphere/mariko_fatal/source/fatal_display.cpp
new file mode 100644
index 000000000..a94ebbb8d
--- /dev/null
+++ b/exosphere/mariko_fatal/source/fatal_display.cpp
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2018-2020 Atmosphère-NX
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+#include
+#include "fatal_device_page_table.hpp"
+
+namespace ams::secmon::fatal {
+
+ void InitializeDisplay() {
+ /* TODO */
+ AMS_SECMON_LOG("InitializeDisplay not yet implemented\n");
+ }
+
+ void ShowDisplay(const ams::impl::FatalErrorContext *f_ctx, const Result save_result) {
+ /* TODO */
+ AMS_UNUSED(f_ctx, save_result);
+ AMS_SECMON_LOG("ShowDisplay not yet implemented\n");
+ }
+
+ void FinalizeDisplay() {
+ /* TODO */
+ AMS_SECMON_LOG("FinalizeDisplay not yet implemented\n");
+ }
+
+}
diff --git a/exosphere/mariko_fatal/source/fatal_display.hpp b/exosphere/mariko_fatal/source/fatal_display.hpp
new file mode 100644
index 000000000..de61bd637
--- /dev/null
+++ b/exosphere/mariko_fatal/source/fatal_display.hpp
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2018-2020 Atmosphère-NX
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+#pragma once
+#include
+
+namespace ams::secmon::fatal {
+
+ void InitializeDisplay();
+ void ShowDisplay(const ams::impl::FatalErrorContext *f_ctx, const Result save_result);
+ void FinalizeDisplay();
+
+}
diff --git a/exosphere/mariko_fatal/source/fatal_main.cpp b/exosphere/mariko_fatal/source/fatal_main.cpp
index 58f73c49c..1787acc88 100644
--- a/exosphere/mariko_fatal/source/fatal_main.cpp
+++ b/exosphere/mariko_fatal/source/fatal_main.cpp
@@ -16,6 +16,7 @@
#include
#include "fatal_sdmmc.hpp"
#include "fatal_save_context.hpp"
+#include "fatal_display.hpp"
namespace ams::secmon::fatal {
@@ -48,35 +49,26 @@ namespace ams::secmon::fatal {
AMS_SECMON_LOG("%s\n", "Fatal start.");
- /* Initialize the sdmmc driver. */
- Result result = InitializeSdCard();
- AMS_SECMON_LOG("InitializeSdCard: %08x\n", result.GetValue());
-
- /* Get the connection status. */
- #if defined(AMS_BUILD_FOR_DEBUGGING) || defined(AMS_BUILD_FOR_AUDITING)
- {
- sdmmc::SpeedMode speed_mode;
- sdmmc::BusWidth bus_width;
- result = CheckSdCardConnection(std::addressof(speed_mode), std::addressof(bus_width));
- AMS_SECMON_LOG("CheckSdCardConnection: %08x\n", result.GetValue());
- AMS_SECMON_LOG(" Speed Mode: %u\n", static_cast(speed_mode));
- AMS_SECMON_LOG(" Bus Width: %u\n", static_cast(bus_width));
- }
- #endif
-
/* Save the fatal error context. */
const auto *f_ctx = GetFatalErrorContext();
- AMS_DUMP(f_ctx, sizeof(*f_ctx));
-
- result = SaveFatalErrorContext(f_ctx);
+ Result result = SaveFatalErrorContext(f_ctx);
if (R_SUCCEEDED(result)) {
AMS_SECMON_LOG("Saved fatal error context to /atmosphere/fatal_reports/report_%016" PRIx64 ".bin!\n", f_ctx->report_identifier);
} else {
AMS_SECMON_LOG("Failed to save fatal error context: %08x\n", result.GetValue());
}
- /* TODO */
+ /* Display the fatal error. */
+ {
+ InitializeDisplay();
+ ShowDisplay(f_ctx, result);
+ FinalizeDisplay();
+ }
+
+ /* Ensure we have nothing waiting to be logged. */
AMS_LOG_FLUSH();
+
+ /* TODO: Wait for a button press, then reboot. */
AMS_INFINITE_LOOP();
}
diff --git a/exosphere/mariko_fatal/source/fatal_save_context.cpp b/exosphere/mariko_fatal/source/fatal_save_context.cpp
index 6fc5e9a2b..df9db0a13 100644
--- a/exosphere/mariko_fatal/source/fatal_save_context.cpp
+++ b/exosphere/mariko_fatal/source/fatal_save_context.cpp
@@ -15,11 +15,26 @@
*/
#include
#include "fatal_save_context.hpp"
+#include "fatal_sdmmc.hpp"
#include "fs/fatal_fs_api.hpp"
namespace ams::secmon::fatal {
Result SaveFatalErrorContext(const ams::impl::FatalErrorContext *ctx) {
+ /* Initialize the sdmmc driver. */
+ R_TRY(InitializeSdCard());
+
+ /* Get the connection status. */
+ #if defined(AMS_BUILD_FOR_DEBUGGING) || defined(AMS_BUILD_FOR_AUDITING)
+ {
+ sdmmc::SpeedMode speed_mode;
+ sdmmc::BusWidth bus_width;
+ R_TRY(CheckSdCardConnection(std::addressof(speed_mode), std::addressof(bus_width)));
+ AMS_SECMON_LOG(" Speed Mode: %u\n", static_cast(speed_mode));
+ AMS_SECMON_LOG(" Bus Width: %u\n", static_cast(bus_width));
+ }
+ #endif
+
/* Mount the SD card. */
R_UNLESS(fs::MountSdCard(), fs::ResultPartitionNotFound());