diff --git a/README.md b/README.md index 3405834..55536e0 100644 --- a/README.md +++ b/README.md @@ -109,7 +109,7 @@ There are four possible type of entries. "**[ ]**": Boot entry, "**{ }**": Capti | stock=1 | OFW via hekate bootloader. Disables unneeded kernel patching and CFW kips when running stock. `If emuMMC is enabled, emummc_force_disable=1` is required. emuMMC is not supported on stock. If additional KIPs are needed other than OFW's, you can define them with `kip1` key. No kip should be used that relies on Atmosphère patching, because it will hang. If `NOGC` is needed, use `kip1patch=nogc`. | | fullsvcperm=1 | Disables SVC verification (full services permission). Doesn't work with Mesosphere as kernel. | | debugmode=1 | Enables Debug mode. Obsolete when used with exosphere as secmon. | -| atmosphere=1 | Enables Atmosphère patching. Not needed when `fss0` is used. | +| kernelprocid=1 | Enables stock kernel process id send/recv patching. Not needed when `fss0` is used. | | ---------------------- | ---------------------------------------------------------- | | payload={FILE path} | Payload launching. Tools, Android/Linux, CFW bootloaders, etc. Any key above when used with that, doesn't get into account. | | ---------------------- | ---------------------------------------------------------- | diff --git a/bootloader/hos/fss.c b/bootloader/hos/fss.c index 42e6312..aa27982 100644 --- a/bootloader/hos/fss.c +++ b/bootloader/hos/fss.c @@ -143,7 +143,7 @@ int parse_fss(launch_ctxt_t *ctxt, const char *path) fss_meta->version >> 24, (fss_meta->version >> 16) & 0xFF, (fss_meta->version >> 8) & 0xFF, fss_meta->git_rev, fss_meta->hos_ver >> 24, (fss_meta->hos_ver >> 16) & 0xFF, (fss_meta->hos_ver >> 8) & 0xFF); - ctxt->atmosphere = true; + ctxt->patch_krn_proc_id = true; ctxt->fss0_hosver = fss_meta->hos_ver; // Parse FSS0 contents. diff --git a/bootloader/hos/hos.c b/bootloader/hos/hos.c index 88d53da..a5b06f0 100644 --- a/bootloader/hos/hos.c +++ b/bootloader/hos/hos.c @@ -822,7 +822,7 @@ void hos_launch(ini_sec_t *cfg) goto error; } - ctxt.atmosphere = true; // Set atmosphere patching in case of no fss0. + ctxt.patch_krn_proc_id = true; // Set kernel process id patching in case of no pkg3. config_kip1patch(&ctxt, "emummc"); } else if (!emu_cfg.enabled && ctxt.emummc_forced) @@ -995,7 +995,7 @@ void hos_launch(ini_sec_t *cfg) ctxt.kernel = pkg2_hdr->data; ctxt.kernel_size = pkg2_hdr->sec_size[PKG2_SEC_KERNEL]; - if (!ctxt.stock && (ctxt.svcperm || ctxt.debugmode || ctxt.atmosphere)) + if (!ctxt.stock && (ctxt.svcperm || ctxt.debugmode || ctxt.patch_krn_proc_id)) { // Hash only Kernel when it embeds INI1. u8 kernel_hash[0x20]; @@ -1022,10 +1022,10 @@ void hos_launch(ini_sec_t *cfg) for (u32 i = 0; kernel_patchset[i].id != 0xFFFFFFFF; i++) { if ((ctxt.svcperm && kernel_patchset[i].id == SVC_VERIFY_DS) - || (ctxt.debugmode && kernel_patchset[i].id == DEBUG_MODE_EN && !(ctxt.atmosphere && ctxt.secmon)) - || (ctxt.atmosphere && kernel_patchset[i].id == ATM_GEN_PATCH)) + || (ctxt.debugmode && kernel_patchset[i].id == DEBUG_MODE_EN && !(ctxt.patch_krn_proc_id && ctxt.secmon)) + || (ctxt.patch_krn_proc_id && kernel_patchset[i].id == ATM_GEN_PATCH)) *(vu32 *)(ctxt.kernel + kernel_patchset[i].off) = kernel_patchset[i].val; - else if (ctxt.atmosphere && kernel_patchset[i].id == ATM_ARR_PATCH) + else if (ctxt.patch_krn_proc_id && kernel_patchset[i].id == ATM_ARR_PATCH) { temp = (u32 *)kernel_patchset[i].ptr; for (u32 j = 0; j < kernel_patchset[i].val; j++) diff --git a/bootloader/hos/hos.h b/bootloader/hos/hos.h index 44f2da5..879ab0a 100644 --- a/bootloader/hos/hos.h +++ b/bootloader/hos/hos.h @@ -113,7 +113,7 @@ typedef struct _launch_ctxt_t void *fss0; u32 fss0_hosver; - bool atmosphere; + bool patch_krn_proc_id; int ucid; diff --git a/bootloader/hos/hos_config.c b/bootloader/hos/hos_config.c index 9d85e42..682ebd4 100644 --- a/bootloader/hos/hos_config.c +++ b/bootloader/hos/hos_config.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2018 naehrwert - * Copyright (c) 2018-2024 CTCaer + * Copyright (c) 2018-2025 CTCaer * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -188,12 +188,12 @@ static int _config_emummc_forced(launch_ctxt_t *ctxt, const char *value) return 1; } -static int _config_atmosphere(launch_ctxt_t *ctxt, const char *value) +static int _config_kernel_proc_id(launch_ctxt_t *ctxt, const char *value) { if (*value == '1') { - DPRINTF("Enabled atmosphere patching\n"); - ctxt->atmosphere = true; + DPRINTF("Enabled kernel process id send/recv patching\n"); + ctxt->patch_krn_proc_id = true; } return 1; } @@ -287,6 +287,7 @@ typedef struct _cfg_handler_t } cfg_handler_t; static const cfg_handler_t _config_handlers[] = { + { "stock", _config_stock }, { "warmboot", _config_warmboot }, { "secmon", _config_secmon }, { "kernel", _config_kernel }, @@ -294,9 +295,11 @@ static const cfg_handler_t _config_handlers[] = { { "kip1patch", config_kip1patch }, { "fullsvcperm", _config_svcperm }, { "debugmode", _config_debugmode }, - { "stock", _config_stock }, - { "atmosphere", _config_atmosphere }, + { "kernelprocid", _config_kernel_proc_id }, + + // To override elements from PKG3, it should be set before others. { "fss0", _config_fss }, + { "exofatal", _config_exo_fatal_payload}, { "emummcforce", _config_emummc_forced }, { "nouserexceptions", _config_dis_exo_user_exceptions },