Skip to content

Basic ("the console boots and functions as expected") 22.0.0 support#2744

Merged
hexkyz merged 11 commits intoAtmosphere-NX:22_supportfrom
alula:22_support
Mar 20, 2026
Merged

Basic ("the console boots and functions as expected") 22.0.0 support#2744
hexkyz merged 11 commits intoAtmosphere-NX:22_supportfrom
alula:22_support

Conversation

@alula
Copy link
Copy Markdown
Contributor

@alula alula commented Mar 17, 2026

Heavily work in progress :)

(I've opened it just because a lot of people tend to be impatient right now)

TODO (please avoid building / using until it's done):

  • kernel
  • erpt
  • creport
  • pgl
  • LogManager
  • built-in patches (usb 3.0)
  • emuMMC

alignas(se::AesBlockSize) constexpr inline const u8 EristaMasterKekSource[se::AesBlockSize] = {
/* TODO: Update on next change of keys. */
0x66, 0xC8, 0xCB, 0x3D, 0xEC, 0xF4, 0x59, 0x73, 0x54, 0x88, 0xE1, 0x2E, 0xE6, 0x3D, 0x68, 0x46
0x2E, 0x27, 0x44, 0xEA, 0x32, 0xF8, 0x2C, 0xF0, 0x6F, 0xCA, 0xCD, 0x77, 0xAE, 0xAE, 0x1A, 0x1B
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0x15, 0xAC, 0x96, 0x34, 0xF5, 0x32, 0x56, 0x68, 0xFE, 0x5B, 0x9D, 0xD7, 0xED, 0x19, 0xB7, 0x8E

see my pr #2743

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch, thank you :3


constexpr inline int MinimumValidDataVersion = 0; /* We allow older package2 to load; this value is currently 0x18 in Nintendo's code. */
constexpr inline int CurrentBootloaderVersion = 0x18;
constexpr inline int CurrentBootloaderVersion = 0x19;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bootloader version is 0x17, incrementing this is not necessary.

@borntohonk
Copy link
Copy Markdown

kinda sus that you set up a PR almost identical to mine an hour later than me, ngl

@masagrator
Copy link
Copy Markdown
Contributor

masagrator commented Mar 17, 2026

kinda sus that you set up a PR almost identical to mine an hour later than me, ngl

If you would read ReSwitched discord you would know that they were getting ready for this since SciresM retired.

You updated just keys and patches while they updated kernel on top of that.

@alula
Copy link
Copy Markdown
Contributor Author

alula commented Mar 17, 2026

kinda sus that you set up a PR almost identical to mine an hour later than me, ngl

I literally started working on this few hours before you opened the PR and I've only opened a PR here to let people outside ReSwitched know it's being worked on. And to precisely avoid low effort / super hacky fixes.

Other than that, thanks for pointing the mistakes out :)

@impeeza
Copy link
Copy Markdown

impeeza commented Mar 17, 2026

Heavily work in progress :)

(I've opened it just because a lot of people tend to be impatient right now)

TODO (please avoid building / using until it's done):

* [ ]  kernel

* [ ]  erpt

* [ ]  LogManager

* [ ]  pgl

Hello there, thanks a lot for your work, and please do not let other people to push you or be rude.

@GoodmanBCN10
Copy link
Copy Markdown

Step by step!! 🙌🏻🙌🏻

Copy link
Copy Markdown

@rezatnoMsirhC rezatnoMsirhC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for taking on this effort! I'm interested in the solution and want to contribute in any way possible, so apologies in advance for my basic review and general unfamiliarity with this codebase.

R_UNLESS(m_capabilities.GetIntendedKernelVersion() <= ams::svc::SupportedKernelVersion, svc::ResultInvalidCombination());

/* Enable mapping device pages as executable on legacy processes. */
if (m_capabilities.GetIntendedKernelMajorVersion() < 26) {
Copy link
Copy Markdown

@rezatnoMsirhC rezatnoMsirhC Mar 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if the 26 here is derived from SDKMajorVersion 22 + 4 based on the SDK->SVC Major Version conversion logic, but if it is, it would be more readable if ams::svc::ConvertToSvcMajorVersion(22) from svc_version.hpp were used in this expression.

Suggested change
if (m_capabilities.GetIntendedKernelMajorVersion() < 26) {
if (m_capabilities.GetIntendedKernelMajorVersion() < ams::svc::ConvertToSvcMajorVersion(22)) {

Comment on lines 26 to +27
constexpr inline int MinimumValidDataVersion = 0; /* We allow older package2 to load; this value is currently 0x18 in Nintendo's code. */
constexpr inline int CurrentBootloaderVersion = 0x18;
constexpr inline int CurrentBootloaderVersion = 0x17;
Copy link
Copy Markdown

@rezatnoMsirhC rezatnoMsirhC Mar 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is 0x17 the confirmed bootloader-version from 22.0.0 pk2 header, is this a work-in-progress placeholder pending reverse engineering, or is this an accidental regression?

The comment above mentions:

this value is currently 0x18 in Nintendo's code

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noticed @borntohonk suggested this should be 0x17 earlier. I'm still curious why this should be decremented, but I'm sure y'all know what you're doing.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is safe to put it at 0x18 as ScriesM did in the last release.

Comment thread fusee/program/source/fusee_key_derivation.cpp Outdated
Comment thread fusee/program/source/fusee_key_derivation.cpp Outdated
@hexkyz
Copy link
Copy Markdown
Collaborator

hexkyz commented Mar 18, 2026

Please change the target branch to the new 22_support. I'll review these along with #2743.

@alula alula changed the base branch from master to 22_support March 18, 2026 22:02
@kapeas
Copy link
Copy Markdown

kapeas commented Mar 19, 2026

Damn, you guys are fast. Trying to understand all the hex values changes with no idea, but thank all of you who decided to put your time and skills so atms keeps maintained. Waiting patiently and grateful 👏
EDIT: removed comment of unrequested tip

@alula
Copy link
Copy Markdown
Contributor Author

alula commented Mar 19, 2026

Damn, you guys are fast. Trying to understand all the hex values changes with no idea, but thank all of you who decided to put your time and skills so atms keeps maintained. Waiting patiently and grateful 👏

Also, if you haven't done already, maybe add copilot as reviewer for typos, performance, and other not always desired complains/warnings helps me at job sometimes

LLMs without right knowledge and context will keep generating completely useless noise.

@SciresM
Copy link
Copy Markdown
Collaborator

SciresM commented Mar 19, 2026

I may be retired (and am not working on updates or involved), but I will permanently ban anyone who submits llm garbage to this repository from interacting with the whole organization.

hexkyz added a commit that referenced this pull request Mar 20, 2026
Remaining changes are duplicated in pull request #2744
@alula alula marked this pull request as ready for review March 20, 2026 00:20
@hexkyz hexkyz merged commit b108318 into Atmosphere-NX:22_support Mar 20, 2026
@masagrator
Copy link
Copy Markdown
Contributor

masagrator commented Mar 20, 2026

No it won't, that's a Hekate error 🤣Also piracy is not supported and after deleting that line error is definitely different.

Wait for Atmosphere release, current code is incomplete.

@aftercares0 aftercares0 mentioned this pull request Mar 20, 2026
14 tasks
NaGaa95 pushed a commit to NaGaa95/Atmosphere-Pro that referenced this pull request Apr 4, 2026
Remaining changes are duplicated in pull request Atmosphere-NX#2744
crueter pushed a commit to eden-emulator/mirror that referenced this pull request May 4, 2026
- KProcess::Run() and CreateThread() SVC now write the current thread handle to TLS+0x110
- KPageTableBase::LockForMapDeviceAddressSpace now checks for a new KPageTableBase boolean, m_allowed_exec_device_mapping
- Stub `am` + `acc` + `settings` cmd module that needs to work for qlaunch

Thanks to: @alula and @yellows8
Source for changes: Atmosphere-NX/Atmosphere#2744, https://switchbrew.org/, https://yls8.mtheall.com/

Co-authored-by: PavelBARABANOV <[email protected]>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3761
Reviewed-by: CamilleLaVey <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants