hos: Improve boot error display

This commit is contained in:
CTCaer 2019-10-09 00:42:13 +03:00
parent 2857fcca52
commit 9104b85143
2 changed files with 16 additions and 4 deletions

View file

@ -103,9 +103,10 @@ static const u8 console_keyseed_4xx_5xx[0x10] =
static void _hos_crit_error(const char *text) static void _hos_crit_error(const char *text)
{ {
display_backlight_brightness(h_cfg.backlight, 1000);
gfx_con.mute = false; gfx_con.mute = false;
gfx_printf("%k%s%k\n", 0xFFFF0000, text, 0xFFCCCCCC); gfx_printf("%k%s%k\n", 0xFFFF0000, text, 0xFFCCCCCC);
display_backlight_brightness(h_cfg.backlight, 1000);
} }
static void _se_lock(bool lock_se) static void _se_lock(bool lock_se)
@ -332,7 +333,11 @@ static int _read_emmc_pkg1(launch_ctxt_t *ctxt)
sdmmc_storage_t storage; sdmmc_storage_t storage;
sdmmc_t sdmmc; sdmmc_t sdmmc;
emummc_storage_init_mmc(&storage, &sdmmc); if (!emummc_storage_init_mmc(&storage, &sdmmc))
{
_hos_crit_error("Failed to init emuMMC");
return 0;
}
// Read package1. // Read package1.
ctxt->pkg1 = (void *)malloc(0x40000); ctxt->pkg1 = (void *)malloc(0x40000);
@ -364,7 +369,11 @@ static u8 *_read_emmc_pkg2(launch_ctxt_t *ctxt)
sdmmc_t sdmmc; sdmmc_t sdmmc;
if (!emummc_storage_init_mmc(&storage, &sdmmc)) if (!emummc_storage_init_mmc(&storage, &sdmmc))
{
_hos_crit_error("Failed to init emuMMC");
return NULL; return NULL;
}
emummc_storage_set_mmc_partition(&storage, 0); emummc_storage_set_mmc_partition(&storage, 0);
// Parse eMMC GPT. // Parse eMMC GPT.
@ -484,7 +493,7 @@ int hos_launch(ini_sec_t *cfg)
if (!keygen(ctxt.keyblob, ctxt.pkg1_id->kb, &tsec_ctxt, &ctxt)) if (!keygen(ctxt.keyblob, ctxt.pkg1_id->kb, &tsec_ctxt, &ctxt))
return 0; return 0;
DPRINTF("Generated keys\n"); gfx_printf("Generated keys\n");
if (ctxt.pkg1_id->kb <= KB_FIRMWARE_VERSION_600) if (ctxt.pkg1_id->kb <= KB_FIRMWARE_VERSION_600)
h_cfg.se_keygen_done = 1; h_cfg.se_keygen_done = 1;
} }
@ -619,7 +628,6 @@ DPRINTF("Generated keys\n");
if (unappliedPatch != NULL) if (unappliedPatch != NULL)
{ {
EHPRINTFARGS("Failed to apply '%s'!", unappliedPatch); EHPRINTFARGS("Failed to apply '%s'!", unappliedPatch);
sd_unmount(); // Just exiting is not enough until pkg2_patch_kips stops modifying the string passed into it.
_free_launch_components(&ctxt); _free_launch_components(&ctxt);
return 0; // MUST stop here, because if user requests 'nogc' but it's not applied, their GC controller gets updated! return 0; // MUST stop here, because if user requests 'nogc' but it's not applied, their GC controller gets updated!

View file

@ -1023,6 +1023,10 @@ skip_list:
{ {
check_sept(); check_sept();
hos_launch(cfg_sec); hos_launch(cfg_sec);
EPRINTF("\nFailed to launch HOS!");
msleep(500);
btn_wait();
} }
out: out: