started on centralized printing/logging

some character problems with "atmosphère" and such strings
This commit is contained in:
Resaec 2018-09-22 05:14:43 +02:00
parent a2b4d9168d
commit 840242b68e
4 changed files with 134 additions and 10 deletions

View file

@ -32,6 +32,7 @@
#include "gpt.h"
#include "display/video_fb.h"
#include "sdmmc/sdmmc.h"
#include "print.h"
extern void (*__program_exit_callback)(int rc);
@ -91,23 +92,23 @@ int main(int argc, void **argv) {
/* Initialize the display, console, FS, etc. */
setup_env();
printf(u8"Welcome to Atmosphère Fusée Stage 2!\n");
printf("Stage 2 executing from: %s\n", (const char *)argv[STAGE2_ARGV_PROGRAM_PATH]);
print(PRINT_LOG_MANDATORY, u8"Welcome to Atmosphère Fusée Stage 2!\n");
print(PRINT_LOG_DEBUG, "Stage 2 executing from: %s\n", (const char *)argv[STAGE2_ARGV_PROGRAM_PATH]);
/* This will load all remaining binaries off of the SD. */
load_payload(g_stage2_args->bct0);
printf("Loaded payloads!\n");
print(PRINT_LOG_INFO, "Loaded payloads!\n");
g_do_nxboot = loader_ctx->chainload_entrypoint == 0;
if (g_do_nxboot) {
printf("Now performing nxboot.\n");
print(PRINT_LOG_INFO, "Now performing nxboot.\n");
uint32_t boot_memaddr = nxboot_main();
nxboot_finish(boot_memaddr);
} else {
/* 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];
printf("Now chainloading.\n");
print(PRINT_LOG_INFO, "Now chainloading.\n");
g_chainloader_argc = 1;
strcpy(g_chainloader_arg_data, path);
}