fusee: integrate mariko fatal.

This commit is contained in:
Michael Scire
2020-11-20 23:20:48 -08:00
committed by SciresM
parent 06dcc6bc17
commit 078a42f80c
6 changed files with 62 additions and 6 deletions

View File

@@ -100,7 +100,8 @@ KIPFILES := loader.kip ncm.kip pm.kip sm.kip ams_mitm.kip spl.kip boot.kip
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) fusee-primary.bin \
exosphere.bin warmboot.bin rebootstub.bin thermosphere.bin splash_screen.bmp \
sept-primary.bin sept-secondary_00.enc sept-secondary_01.enc emummc.kip \
sept-secondary_dev_00.enc sept-secondary_dev_01.enc mesosphere.bin kernel_ldr.bin $(KIPFILES)
sept-secondary_dev_00.enc sept-secondary_dev_01.enc mesosphere.bin kernel_ldr.bin \
mariko_fatal.bin $(KIPFILES)
#---------------------------------------------------------------------------------
# use CXX for linking C++ projects, CC for standard C

View File

@@ -256,4 +256,6 @@ SECTIONS
PROVIDE(__kernel_ldr_bin_size__ = kernel_ldr_bin_end - kernel_ldr_bin);
PROVIDE(__mesosphere_bin_start__ = mesosphere_bin - __start__);
PROVIDE(__mesosphere_bin_size__ = mesosphere_bin_end - mesosphere_bin);
PROVIDE(__mariko_fatal_bin_start__ = mariko_fatal_bin - __start__);
PROVIDE(__mariko_fatal_bin_size__ = mariko_fatal_bin_end - mariko_fatal_bin);
}

View File

@@ -55,6 +55,7 @@
#define u8 uint8_t
#define u32 uint32_t
#include "exosphere_bin.h"
#include "mariko_fatal_bin.h"
#include "mesosphere_bin.h"
#include "sept_secondary_00_enc.h"
#include "sept_secondary_01_enc.h"
@@ -1006,6 +1007,24 @@ uint32_t nxboot_main(void) {
memcpy(exosphere_memaddr, exosphere_bin, exosphere_bin_size);
}
/* Copy the exosphere mariko fatal program to a good location. */
{
void * const mariko_fatal_dst = (void *)0x80020000;
memset(mariko_fatal_dst, 0, 0x20000);
const size_t sd_mf_size = get_file_size("atmosphere/mariko_fatal.bin");
if (sd_mf_size != 0) {
if (sd_mf_size > 0x20000) {
fatal_error("Error: atmosphere/mariko_fatal.bin is too large!\n");
}
if (read_from_file(mariko_fatal_dst, sd_mf_size, "atmosphere/mariko_fatal.bin") != sd_mf_size) {
fatal_error("Error: failed to read atmosphere/mariko_fatal.bin");
}
} else {
memcpy(mariko_fatal_dst, mariko_fatal_bin, mariko_fatal_bin_size);
}
}
/* Move BootConfig. */
print(SCREEN_LOG_LEVEL_INFO, "[NXBOOT] Moving BootConfig...\n");
nxboot_move_bootconfig();

View File

@@ -107,6 +107,7 @@ _metadata:
#define CONTENT_TYPE_EMC 8
#define CONTENT_TYPE_KLD 9
#define CONTENT_TYPE_KRN 10
#define CONTENT_TYPE_EXF 11
#define CONTENT_FLAG_NONE (0 << 0)
@@ -289,6 +290,18 @@ _content_headers:
.asciz "emummc"
.align 5
/* exosphere mariko fatal program content header */
.word __mariko_fatal_bin_start__
.word __mariko_fatal_bin_size__
.byte CONTENT_TYPE_EXF
.byte CONTENT_FLAG_NONE
.byte CONTENT_FLAG_NONE
.byte CONTENT_FLAG_NONE
.word 0xCCCCCCCC
.asciz "exosphere_fatal"
.align 5
/* splash_screen content header */
.word __splash_screen_bmp_start__
.word __splash_screen_bmp_size__