fusee: Load fs.mitm by default.

This commit is contained in:
Michael Scire 2018-10-16 14:19:55 -07:00
parent 11159f5fa9
commit 49f627bb28
4 changed files with 20 additions and 7 deletions

View file

@ -69,7 +69,7 @@ ifneq ($(BUILD),$(notdir $(CURDIR)))
export OUTPUT := $(CURDIR)/$(TARGET) export OUTPUT := $(CURDIR)/$(TARGET)
export TOPDIR := $(CURDIR) export TOPDIR := $(CURDIR)
export KIPDIRS := $(AMS)/stratosphere/loader $(AMS)/stratosphere/pm $(AMS)/stratosphere/sm $(AMS)/stratosphere/boot export KIPDIRS := $(AMS)/stratosphere/loader $(AMS)/stratosphere/pm $(AMS)/stratosphere/sm $(AMS)/stratosphere/boot $(AMS)/stratosphere/fs_mitm
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \ export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
$(foreach dir,$(DATA),$(CURDIR)/$(dir)) \ $(foreach dir,$(DATA),$(CURDIR)/$(dir)) \
$(AMS)/exosphere $(AMS)/thermosphere $(KIPDIRS) $(AMS)/exosphere $(AMS)/thermosphere $(KIPDIRS)
@ -79,7 +79,7 @@ export DEPSDIR := $(CURDIR)/$(BUILD)
CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
KIPFILES := loader.kip pm.kip sm.kip boot_100.kip boot_200.kip KIPFILES := loader.kip pm.kip sm.kip fs_mitm.kip boot_100.kip boot_200.kip
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) exosphere.bin thermosphere.bin splash_screen.bmp $(KIPFILES) BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) exosphere.bin thermosphere.bin splash_screen.bmp $(KIPFILES)
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------

View file

@ -101,13 +101,13 @@ int main(int argc, void **argv) {
g_do_nxboot = loader_ctx->chainload_entrypoint == 0; g_do_nxboot = loader_ctx->chainload_entrypoint == 0;
if (g_do_nxboot) { if (g_do_nxboot) {
print(SCREEN_LOG_LEVEL_INFO, "Now performing nxboot.\n"); print(SCREEN_LOG_LEVEL_MANDATORY, "Now performing nxboot.\n");
uint32_t boot_memaddr = nxboot_main(); uint32_t boot_memaddr = nxboot_main();
nxboot_finish(boot_memaddr); nxboot_finish(boot_memaddr);
} else { } else {
/* TODO: What else do we want to do in terms of argc/argv? */ /* TODO: What else do we want to do in terms of argc/argv? */
const char *path = get_loader_ctx()->file_paths_to_load[get_loader_ctx()->file_id_of_entrypoint]; const char *path = get_loader_ctx()->file_paths_to_load[get_loader_ctx()->file_id_of_entrypoint];
print(SCREEN_LOG_LEVEL_INFO, "Now chainloading.\n"); print(SCREEN_LOG_LEVEL_MANDATORY, "Now chainloading.\n");
g_chainloader_argc = 1; g_chainloader_argc = 1;
strcpy(g_chainloader_arg_data, path); strcpy(g_chainloader_arg_data, path);
} }

View file

@ -293,6 +293,8 @@ uint32_t nxboot_main(void) {
else else
print(SCREEN_LOG_LEVEL_INFO, "[NXBOOT]: Detected target firmware %ld!\n", target_firmware); print(SCREEN_LOG_LEVEL_INFO, "[NXBOOT]: Detected target firmware %ld!\n", target_firmware);
print(SCREEN_LOG_LEVEL_MANDATORY, "[NXBOOT]: Loaded firmware from eMMC...\n");
/* Setup boot configuration for Exosphère. */ /* Setup boot configuration for Exosphère. */
nxboot_configure_exosphere(target_firmware); nxboot_configure_exosphere(target_firmware);
@ -357,7 +359,7 @@ uint32_t nxboot_main(void) {
pmc->scratch1 = (uint32_t)warmboot_memaddr; pmc->scratch1 = (uint32_t)warmboot_memaddr;
} }
print(SCREEN_LOG_LEVEL_INFO, "[NXBOOT]: Rebuilding package2...\n"); print(SCREEN_LOG_LEVEL_MANDATORY, "[NXBOOT]: Rebuilding package2...\n");
/* Patch package2, adding Thermosphère + custom KIPs. */ /* Patch package2, adding Thermosphère + custom KIPs. */
package2_rebuild_and_copy(package2, MAILBOX_EXOSPHERE_CONFIGURATION->target_firmware); package2_rebuild_and_copy(package2, MAILBOX_EXOSPHERE_CONFIGURATION->target_firmware);

View file

@ -38,12 +38,13 @@ static ini1_header_t *g_stratosphere_ini1 = NULL;
static bool g_stratosphere_loader_enabled = true; static bool g_stratosphere_loader_enabled = true;
static bool g_stratosphere_sm_enabled = true; static bool g_stratosphere_sm_enabled = true;
static bool g_stratosphere_pm_enabled = true; static bool g_stratosphere_pm_enabled = true;
static bool g_stratosphere_fs_mitm_enabled = true;
static bool g_stratosphere_boot_enabled = false; static bool g_stratosphere_boot_enabled = false;
extern const uint8_t boot_100_kip[], boot_200_kip[]; extern const uint8_t boot_100_kip[], boot_200_kip[];
extern const uint8_t loader_kip[], pm_kip[], sm_kip[]; extern const uint8_t loader_kip[], pm_kip[], sm_kip[], fs_mitm_kip[];
extern const uint32_t boot_100_kip_size, boot_200_kip_size; extern const uint32_t boot_100_kip_size, boot_200_kip_size;
extern const uint32_t loader_kip_size, pm_kip_size, sm_kip_size; extern const uint32_t loader_kip_size, pm_kip_size, sm_kip_size, fs_mitm_kip_size;
/* GCC doesn't consider the size as const... we have to write it ourselves. */ /* GCC doesn't consider the size as const... we have to write it ourselves. */
@ -83,6 +84,11 @@ ini1_header_t *stratosphere_get_ini1(uint32_t target_firmware) {
num_processes++; num_processes++;
} }
if (g_stratosphere_fs_mitm_enabled) {
size += fs_mitm_kip_size;
num_processes++;
}
if (g_stratosphere_boot_enabled) { if (g_stratosphere_boot_enabled) {
size += boot_kip_size; size += boot_kip_size;
num_processes++; num_processes++;
@ -117,6 +123,11 @@ ini1_header_t *stratosphere_get_ini1(uint32_t target_firmware) {
data += sm_kip_size; data += sm_kip_size;
} }
if (g_stratosphere_fs_mitm_enabled) {
memcpy(data, fs_mitm_kip, fs_mitm_kip_size);
data += fs_mitm_kip_size;
}
if (g_stratosphere_boot_enabled) { if (g_stratosphere_boot_enabled) {
memcpy(data, boot_kip, boot_kip_size); memcpy(data, boot_kip, boot_kip_size);
data += boot_kip_size; data += boot_kip_size;