Compare commits

..

17 Commits

Author SHA1 Message Date
Michael Scire
4aa7ed15d0 emummc: update for 21.0.0 2025-11-15 09:25:05 -07:00
Michael Scire
6f3cdc4e97 loader: fix sd-cmpt 2025-11-13 15:58:12 -07:00
Michael Scire
849b016197 loader: update for 20.0.0/21.0.0 2025-11-13 15:32:00 -07:00
Michael Scire
c0cfff94b9 pgl/pm: add GetProcessId command 2025-11-13 12:34:28 -07:00
Michael Scire
bd909f7272 kern: fix debug build for [[nodiscard]] changes 2025-11-12 17:32:43 -07:00
Michael Scire
3c209d46e6 kern: fix whoops introduced by nodiscard refactor 2025-11-12 17:32:26 -07:00
Michael Scire
749b32aac5 erpt: implement new 21.0.0 commands 2025-11-12 16:18:13 -07:00
Michael Scire
df6c94eddc erpt: fix ids, failed to copy the new categories 2025-11-12 14:38:52 -07:00
Michael Scire
be1797449b fatal: add new HashedTraceContext command 2025-11-12 14:38:28 -07:00
Michael Scire
0d8ce9fe31 erpt: add new IDs for 21.0.0 2025-11-11 20:06:24 -07:00
Michael Scire
231da89c6a kern: RESERVED_2F now set by HandleFpuException 2025-11-11 19:35:39 -07:00
Michael Scire
5cb14dcabc kern: exception flags are now atomic.
This is a really weird one, because they didn't actually update the
code which updates these flags in asm, these still use ldrb/orr/strb.
But every access to these via c++ is now an atomic ldxrb/stxrb loop.
Maybe they just forgot to update the asm?
2025-11-11 19:34:34 -07:00
Michael Scire
5b14d1f2b1 kern: pass u32 directly to CopyMemoryToUserSize32Bit 2025-11-11 18:48:37 -07:00
Michael Scire
98e131fcd1 ams: mark ams::Result [[nodiscard]] (partially complete).
NOTE: This work is not yet fully complete; kernel is done, but
it was taking an exceedingly long time to get through libstratosphere.
Thus, I've temporarily added -Wno-error=unused-result for libstratosphere/stratosphere.

All warnings should be fixed to do the same thing Nintendo does as relevant, but this
is taking a phenomenally long time and is not actually the most important work to do,
so it can be put off for some time to prioritize other tasks for 21.0.0 support.
2025-11-11 16:13:25 -07:00
Michael Scire
0b9cf32cdc kern: Nintendo now also devirtualizes KAutoObject::DynamicCast 2025-11-11 10:54:32 -07:00
Michael Scire
99ad25fbff kern: write cpu tick differential to tls +0x108 on thread switch 2025-11-11 10:50:17 -07:00
Michael Scire
dbb3bf621f fusee/exo/ams: update with new keydata/version enums 2025-11-10 22:32:02 -07:00
10 changed files with 18 additions and 62 deletions

View File

@@ -1,28 +1,4 @@
# Changelog
## 1.10.0
+ Basic support was added for 21.0.0.
+ The console should boot and atmosphère should be fully functional.
+ **Please note**: All homebrew software may need to be re-compiled with the latest libnx (>= 4.10.0), or else it may crash/experience memory corruption.
+ Nintendo broke the userland<->kernel TLS ABI in 21.0.0, by writing to previously reserved space.
+ Homebrew used this reserved space for its TLS slots, which means any homebrew software using TLS slots will experience memory corruption when running under Atmosphere 1.10.0.
+ This doesn't appear to impact everything, but a large portion of tested homebrew crashes (often on exit), and so will need re-compile for the new ABI.
+ For those technically inclined, while TLS slots are rarely used by developers, they're used to implement features like e.g. C++ exceptions under the hood, and so anything using those crashes, etc.
+ To help make this transition easier, hbmenu now shows a warning when selecting homebrew compiled with an older, incompatible ABI version.
+ I apologize for the hassle in general.
+ libnx has been updated so that its reserved space matches Nintendo's now -- this particular issue can never occur again, even if Nintendo touches more reserved space.
+ `exosphère` was updated to reflect the latest official secure monitor behavior.
+ `mesosphère` was updated to reflect the latest official kernel behavior.
+ `loader` was updated to reflect the latest official behavior.
+ `pm` was updated to reflect the latest official behavior.
+ `erpt` was updated to reflect the latest official behavior.
+ `pgl` was updated to reflect the latest official behavior.
+ `fatal` was updated to reflect the latest official behavior.
+ Support was added for launching another game-which-has-too-many-files with romfs mods.
+ I rely on user reports for adding support/fixing these, and some of these games can be pretty obscure!
+ If you are affected by this, you will see "Data abort (0x101)" when trying to launch the game with mods.
+ Please reach out to `sciresm` on discord if this occurs to share your error report binary.
+ Although some games may be impossible to fix, I believe I can get almost everything working, so please let me try to help you (and improve atmosphère's support!) if you run into this!
+ General system stability improvements to enhance the user's experience.
## 1.9.5
+ Basic support was added for 20.5.0.
+ General system stability improvements to enhance the user's experience.

4
emummc/.gitrepo vendored
View File

@@ -6,7 +6,7 @@
[subrepo]
remote = https://github.com/m4xw/emummc
branch = develop
commit = 3c57b20ba3820ec87d7dd239d6fcf9ba97510606
parent = d61ee942d9b34cadd80464d5d549c5e2e5bf1689
commit = a8e5f1a184aeb8ba884166a1e4f386088d4a6cf1
parent = 409c3cf9e190dbb65fe76570954939cbe8a5eca0
method = merge
cmdver = 0.4.1

View File

@@ -6,7 +6,7 @@
[subrepo]
remote = https://github.com/Atmosphere-NX/Atmosphere-libs
branch = master
commit = 6cc765fcaa5f83b9cd6dc5b424bae31a0f33b29f
parent = 3cb5d5f957020d07f5bdb3fb89521f29bea5d79d
commit = 583ae0fbf32b99fa97c879d2cfc598bf494e3c0e
parent = 652519da2eb7ccb2a113aa5883e4e405e00e2b1c
method = merge
cmdver = 0.4.1

View File

@@ -361,18 +361,10 @@ namespace ams::kern::board::nintendo::nx {
}();
/* Return (possibly) adjusted size. */
/* NOTE: On 20.0.0+ (and even more-so 21.0.0+) the browser requires much more memory in the applet pool in order to function. */
/* NOTE: On 20.0.0+ the browser requires much more memory in the applet pool in order to function. */
/* Thus, we have to reduce our extra system memory size by 26 MB to compensate. */
if (kern::GetTargetFirmware() >= ams::TargetFirmware_21_0_0) {
constexpr size_t ExtraSystemMemoryForAtmosphere_21_0_0 = 7_MB;
return base_pool_size - ExtraSystemMemoryForAtmosphere_21_0_0 - KTraceBufferSize;
} else if (kern::GetTargetFirmware() >= ams::TargetFirmware_20_0_0) {
constexpr size_t ExtraSystemMemoryForAtmosphere_20_0_0 = 14_MB;
return base_pool_size - ExtraSystemMemoryForAtmosphere_20_0_0 - KTraceBufferSize;
} else {
constexpr size_t ExtraSystemMemoryForAtmosphere = 40_MB;
return base_pool_size - ExtraSystemMemoryForAtmosphere - KTraceBufferSize;
}
const size_t ExtraSystemMemoryForAtmosphere = kern::GetTargetFirmware() >= ams::TargetFirmware_20_0_0 ? 14_MB : 40_MB;
return base_pool_size - ExtraSystemMemoryForAtmosphere - KTraceBufferSize;
}
size_t KSystemControl::Init::GetMinimumNonSecureSystemPoolSize() {

View File

@@ -97,8 +97,6 @@ namespace ams::hos {
Version_20_4_0 = ::ams::TargetFirmware_20_4_0,
Version_20_5_0 = ::ams::TargetFirmware_20_5_0,
Version_21_0_0 = ::ams::TargetFirmware_21_0_0,
Version_21_0_1 = ::ams::TargetFirmware_21_0_1,
Version_21_1_0 = ::ams::TargetFirmware_21_1_0,
Version_Current = ::ams::TargetFirmware_Current,

View File

@@ -17,10 +17,10 @@
#define ATMOSPHERE_RELEASE_VERSION_MAJOR 1
#define ATMOSPHERE_RELEASE_VERSION_MINOR 10
#define ATMOSPHERE_RELEASE_VERSION_MICRO 1
#define ATMOSPHERE_RELEASE_VERSION_MICRO 0
#define ATMOSPHERE_RELEASE_VERSION ATMOSPHERE_RELEASE_VERSION_MAJOR, ATMOSPHERE_RELEASE_VERSION_MINOR, ATMOSPHERE_RELEASE_VERSION_MICRO
#define ATMOSPHERE_SUPPORTED_HOS_VERSION_MAJOR 21
#define ATMOSPHERE_SUPPORTED_HOS_VERSION_MINOR 1
#define ATMOSPHERE_SUPPORTED_HOS_VERSION_MINOR 0
#define ATMOSPHERE_SUPPORTED_HOS_VERSION_MICRO 0

View File

@@ -95,10 +95,8 @@
#define ATMOSPHERE_TARGET_FIRMWARE_20_4_0 ATMOSPHERE_TARGET_FIRMWARE(20, 4, 0)
#define ATMOSPHERE_TARGET_FIRMWARE_20_5_0 ATMOSPHERE_TARGET_FIRMWARE(20, 5, 0)
#define ATMOSPHERE_TARGET_FIRMWARE_21_0_0 ATMOSPHERE_TARGET_FIRMWARE(21, 0, 0)
#define ATMOSPHERE_TARGET_FIRMWARE_21_0_1 ATMOSPHERE_TARGET_FIRMWARE(21, 0, 1)
#define ATMOSPHERE_TARGET_FIRMWARE_21_1_0 ATMOSPHERE_TARGET_FIRMWARE(21, 1, 0)
#define ATMOSPHERE_TARGET_FIRMWARE_CURRENT ATMOSPHERE_TARGET_FIRMWARE_21_1_0
#define ATMOSPHERE_TARGET_FIRMWARE_CURRENT ATMOSPHERE_TARGET_FIRMWARE_21_0_0
#define ATMOSPHERE_TARGET_FIRMWARE_MIN ATMOSPHERE_TARGET_FIRMWARE(0, 0, 0)
#define ATMOSPHERE_TARGET_FIRMWARE_MAX ATMOSPHERE_TARGET_FIRMWARE_CURRENT
@@ -186,8 +184,6 @@ namespace ams {
TargetFirmware_20_4_0 = ATMOSPHERE_TARGET_FIRMWARE_20_4_0,
TargetFirmware_20_5_0 = ATMOSPHERE_TARGET_FIRMWARE_20_5_0,
TargetFirmware_21_0_0 = ATMOSPHERE_TARGET_FIRMWARE_21_0_0,
TargetFirmware_21_0_1 = ATMOSPHERE_TARGET_FIRMWARE_21_0_1,
TargetFirmware_21_1_0 = ATMOSPHERE_TARGET_FIRMWARE_21_1_0,
TargetFirmware_Current = ATMOSPHERE_TARGET_FIRMWARE_CURRENT,

View File

@@ -79,11 +79,6 @@ constexpr inline const EmbeddedPatchEntry Usb30ForceEnablePatches_20_1_0[] = {
{ 0x7090, "\x20\x00\x80\x52\xC0\x03\x5F\xD6", 8 },
};
constexpr inline const EmbeddedPatchEntry Usb30ForceEnablePatches_21_0_0[] = {
{ 0x6D60, "\x20\x00\x80\x52\xC0\x03\x5F\xD6", 8 },
{ 0x6DE0, "\x20\x00\x80\x52\xC0\x03\x5F\xD6", 8 },
};
constexpr inline const EmbeddedPatch Usb30ForceEnablePatches[] = {
{ ParseModuleId("C0D3F4E87E8B0FE9BBE9F1968A20767F3DC08E03"), util::size(Usb30ForceEnablePatches_9_0_0), Usb30ForceEnablePatches_9_0_0 },
{ ParseModuleId("B9C700CA8335F8BAA0D2041D8D09F772890BA988"), util::size(Usb30ForceEnablePatches_10_0_0), Usb30ForceEnablePatches_10_0_0 },
@@ -98,6 +93,5 @@ constexpr inline const EmbeddedPatch Usb30ForceEnablePatches[] = {
{ ParseModuleId("4F21AE15E814FA46515C0401BB23D4F7ADCBF3F4"), util::size(Usb30ForceEnablePatches_18_0_0), Usb30ForceEnablePatches_18_0_0 }, /* 18.0.0 */
{ ParseModuleId("54BB9BB32C958E02752DC5E4AE8D016BFE1F5418"), util::size(Usb30ForceEnablePatches_19_0_0), Usb30ForceEnablePatches_19_0_0 }, /* 19.0.0 */
{ ParseModuleId("40E80E7442C0DFC985315E6F9E8C77229818AC0F"), util::size(Usb30ForceEnablePatches_20_0_0), Usb30ForceEnablePatches_20_0_0 }, /* 20.0.0 */
{ ParseModuleId("A5EF8D22EDF8A384E4135270ED596C1D2D524159"), util::size(Usb30ForceEnablePatches_20_1_0), Usb30ForceEnablePatches_20_1_0 }, /* 20.1.0 - 20.5.0 */
{ ParseModuleId("766D0C2277207B40AD9B8DE309396D50CCE94885"), util::size(Usb30ForceEnablePatches_21_0_0), Usb30ForceEnablePatches_21_0_0 }, /* 21.0.0 */
{ ParseModuleId("A5EF8D22EDF8A384E4135270ED596C1D2D524159"), util::size(Usb30ForceEnablePatches_20_1_0), Usb30ForceEnablePatches_20_1_0 }, /* 20.1.0 - 20.1.1 */
};

View File

@@ -245,14 +245,14 @@ namespace ams::ldr {
/* If we don't have an RTLD, we must only have a main. */
const bool has_browser_dll = (acid_flags & Acid::AcidFlag_LoadBrowserCoreDll) != 0;
if (!ali->has_rtld) {
/* If don't have rtld, we must also not have sdk. */
R_UNLESS(!ali->has_sdk, ldr::ResultInvalidNso());
if (ali->has_rtld) {
/* If we have rtld, we must also have sdk. */
R_UNLESS(ali->has_sdk, ldr::ResultInvalidNso());
/* We must also not have both subsdk and browser dll. */
/* We must also only have one of [subsdk, browser dll]. */
R_UNLESS(!(ali->has_subsdk && has_browser_dll), ldr::ResultInvalidNso());
} else {
/* If we have rtld, we must not have browser core dll. */
/* If we don't have rtld, we are not browser, and must not have browser core dll. */
R_UNLESS(!has_browser_dll, ldr::ResultInvalidNso());
}

View File

@@ -53,14 +53,14 @@ namespace ams::ro::impl {
Result SetNroPerms(os::NativeHandle process_handle, u64 base_address, u64 rx_size, u64 ro_size, u64 rw_size, bool is_aligned_header) {
const u64 rx_offset = is_aligned_header ? os::MemoryPageSize : 0;
const u64 ro_offset = rx_size;
const u64 ro_offset = rx_offset + rx_size;
const u64 rw_offset = ro_offset + ro_size;
if (is_aligned_header) {
R_TRY(os::SetProcessMemoryPermission(process_handle, base_address, os::MemoryPageSize, os::MemoryPermission_ReadOnly));
}
R_TRY(os::SetProcessMemoryPermission(process_handle, base_address + rx_offset, rx_size - rx_offset, os::MemoryPermission_ReadExecute));
R_TRY(os::SetProcessMemoryPermission(process_handle, base_address + rx_offset, rx_size, os::MemoryPermission_ReadExecute));
R_TRY(os::SetProcessMemoryPermission(process_handle, base_address + ro_offset, ro_size, os::MemoryPermission_ReadOnly));
R_TRY(os::SetProcessMemoryPermission(process_handle, base_address + rw_offset, rw_size, os::MemoryPermission_ReadWrite));