diff --git a/src/common.h b/src/common.h index b295336..ee7d5d8 100644 --- a/src/common.h +++ b/src/common.h @@ -11,6 +11,7 @@ extern "C" { #define OSDynLoad_Acquire ((void (*)(char* rpl, unsigned int *handle))0x0102A3B4) #define OSDynLoad_FindExport ((void (*)(unsigned int handle, int isdata, char *symbol, void *address))0x0102B828) #define OSFatal ((void (*)(char* msg))0x01031618) +#define __os_snprintf ((int(*)(char* s, int n, const char * format, ... ))0x0102F160) #define ADDRESS_OSTitle_main_entry_ptr 0x1005E040 #define ADDRESS_main_entry_hook 0x0101c56c diff --git a/src/elf_loading.c b/src/elf_loading.c index 442756c..b8875aa 100644 --- a/src/elf_loading.c +++ b/src/elf_loading.c @@ -29,16 +29,18 @@ static int32_t LoadFileToMem(private_data_t *private_data, const char *filepath, int32_t status = private_data->FSGetMountSource(pClient, pCmd, 0, tempPath, -1); if (status != 0) { - OSFatal("FSGetMountSource failed."); + OSFatal("FSGetMountSource failed. Please insert a FAT32 formatted sd card."); } status = private_data->FSMount(pClient, pCmd, tempPath, mountPath, FS_MAX_MOUNTPATH_SIZE, -1); if(status != 0) { - OSFatal("SD mount failed."); + OSFatal("SD mount failed. Please insert a FAT32 formatted sd card."); } status = private_data->FSOpenFile(pClient, pCmd, filepath, "r", &iFd, -1); if(status != 0) { - OSFatal("FSOpenFile failed."); + char buf[0x255]; + __os_snprintf(buf,0x254,"FSOpenFile failed. File missing %s",filepath); + OSFatal(buf); } FSStat stat; diff --git a/src/memory_setup.c b/src/memory_setup.c index b00fcb1..03d3005 100644 --- a/src/memory_setup.c +++ b/src/memory_setup.c @@ -9,14 +9,14 @@ static void SCSetupIBAT4DBAT5() { asm volatile("eieio; isync"); // Give our and the kernel full execution rights. - // VA: 00000000..00800000 PA: 30000000..30800000 with r/w for user and supervisor + // 00800000-01000000 => 30800000-31000000 (read/write, user/supervisor) unsigned int ibat4u = 0x008000FF; unsigned int ibat4l = 0x30800012; asm volatile("mtspr 560, %0" : : "r" (ibat4u)); asm volatile("mtspr 561, %0" : : "r" (ibat4l)); // Give our and the kernel full data access rights. - // VA: 00000000..00800000 PA: 30000000..30800000 with r/w for user and supervisor + // 00800000-01000000 => 30800000-31000000 (read/write, user/supervisor) unsigned int dbat5u = ibat4u; unsigned int dbat5l = ibat4l; asm volatile("mtspr 570, %0" : : "r" (dbat5u));