feat(libkernel): support kern.sdk_version in sysctlbyname #2902
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2902"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-10T18:20:26Z.
What
Carries #2738 by @pushkarreddyy, which the intake check closed; the commit keeps its author. Rebased onto
main325e0a8b(conflicts with #3779 inSystemConfiguration.cppand with #3760's entry in TechnicalDebt; every name, entry and test ofmainkept,kern.sdk_versionplaced afterkern.rng_pseudoand beforehw.ncpuandhw.physmem).Capy Mobile (PPSA92280) has no absent imports but stops at start-up on
main:sysctlbynamenow answerskern.sdk_versionwith the 4-byte value0x01000000(1.00), the system software versionsceKernelGetSystemSwVersionalready reports onmain; a write returns -1 withEPERM. Every other unsupported name still throws.The sysctl is the system software version, major in byte 3 and minor in byte 2, in hex digits that read as decimal (13.60 is
0x1360xxxx): Capy Mobile, remote_lua_loader and the lapse payload read it that way. Capy Mobile only displays it. TechnicalDebt records these sources and that the console's firmware version is not modeled.Tested
Linux (CachyOS, GCC 16.2.1), Release,
BUILD_TESTING=ON,ANYPS5_ENABLE_SPIRV_TOOLS=ON, full build andlibs, onmain325e0a8b:guest_system_configurationpasses 3 of 3 runs; withSystemConfiguration.cppreverted tomainit aborts withsysctlbyname_nid_postfix: unsupported name kern.sdk_version.ctest -R "guest_|kernel|sysctl|system_config": 299 of 299 pass onmainand on the branch.tools/check_conventions.py --base 325e0a8bpasses.Capy Mobile was not run here. @orishamir's run on Linux and Windows gets past the call and goes on to open
/app0/games; @screamm ran an earlier head on Windows. Both runs predate this rebase.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-10T20:36:55Z.
Windows validation of the current head
19d36ba7merged ontomain56fb1b3b.Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release,
BUILD_TESTING=ON, full build including thelibstarget.guest_system_configurationpasses 3/3 (--repeat until-fail:3).ctest -j8 -E "^agc_|video_out": 387/388. The one failure,guest_avplayer, passes 3/3 when run alone and does not touch this change; it looks load-related.main'sSystemConfiguration.cppand this PR's test, the test aborts withsysctlbyname_nid_postfix: unsupported name kern.sdk_version, as the description says.Validation run with Claude Code assistance.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T23:14:07Z.
Review: DISMISSED
Thanks for carrying this. Main blocker: the value.
SystemConfiguration.cpp:110:0x01000000(1.00) has no source. The PR text says it matches "PS5 baseline launch SDK formatting", but I found nothing in KytyPS5, shadPS4 or prospero-win that reports this sysctl, and nothing in the repo. A title that compareskern.sdk_versionagainst a minimum would take its legacy path with 1.00, so this returns a plausible but wrong value wheremainthrew.The rest is fine: read-only EPERM, ENOMEM on a short buffer, size query, test fails without the change, TechnicalDebt line placed mid-section. Build and
guest_system_configurationpass locally on Linux, and @screamm confirmed on Windows.Imported from boykopovar/AnyPS5. Originally posted by orishamir on 2026-10-10T23:42:06Z.
On the value: three public sources say what
kern.sdk_versionis and how it is read, none of them in the repo or in the three references named above.src/ps5/platform.clines 64-71 (the source of the catalog's 0.5.0 build):firmware_textformats"%x.%02x"of bytes 3 and 2, with the commentHex digits that read as the number: 0x13600007 is 13.60., prints nothing when the value is 0, and nothing compares it. With this PR the title shows "1.00" where a console shows its system software version; no code path of this title depends on the number.misc.luaget_version('%x.%02x'of bytes 3 and 2) and the lapse payloadget_fwversion(byte 3 major, byte 2 minor). So the sysctl is the system software version in hex digits that read as decimal (13.60 is 0x1360xxxx), and0x01000000reads as 1.00 in that layout.ps4_libkernel.pas509-520) implementssceKernelGetSystemSwVersionunder the comment//sysctlbyname:kern.sdk_versionand stands in with the title's compiled SDK version (sceKernelGetCompiledSdkVersion), formatted%2x.%03x.%03x. That is the first option in the review;maindoes not expose the compiled SDK version yet (git grep -i CompiledSdkVersionis empty), and #2945 answerssceKernelGetSystemSwVersionwith the same0x01000000/ "01.000.000", so whichever value lands should be the same in both.I have not run the title.
AI-assisted: yes (Claude Code Fable 5.1 xhigh)
Imported from boykopovar/AnyPS5. Originally posted by orishamir on 2026-10-11T08:28:53Z.
The run log asked for above, on the catalog build of Capy Mobile (PPSA92280 v0.5.0,
CapyMobile-00.005.000.zip, sha25680b14507...as in the catalog record;eboot.binandsce_module/libc.prxunwrapped from their fake-SELF containers, 14 program headers each).tools/import_audit.pyon the relinked title: 179 imports, all implemented, none absent or stubbed, so thissysctlbynamethrow is the only stop before the title's own code runs.This PR no longer merges onto
main(its three files conflict after #2945/#3218), so the "after" tree ismainf60923bfplus this PR's eight-linekern.sdk_versionbranch inserted intosysctlbyname_nid_postfixbefore thehw.ncpucheck, nothing else.Linux (WSL2 Ubuntu, GCC 13.3, Mesa 26.0.8 llvmpipe,
relinker --registry, 30 s timeout):mainb6f649d9: Vulkan device and swapchain created,sceKernelOpen /app0/saves/.probe, thenlibkernelrebuilt frommainf60923bf'sSystemConfiguration.cppplus the branch: runs for the whole 30 s (killed by the timeout), no exception; after the saves probe it starts a thread and opens/app0/games.Windows (Windows 11, WinLibs GCC 15.2.0 r7, RTX 4080 driver 616.56,
relinker --windows --windows-diagnostics --registry, 30 s timeout):mainf60923bf: same path, swapchain 1484x835 on the RTX 4080,sceKernelOpen /app0/saves/.probe, then the samesysctlbyname_nid_postfix: unsupported name kern.sdk_versionandFATAL: abort() (SIGABRT)after 10 s./app0/games, as on Linux.So with any accepted value for
kern.sdk_versionthe title gets past this call; what it does with the value is the display string from the sources above.AI-assisted: yes (Claude Code Fable 5.1 xhigh)
Imported from boykopovar/AnyPS5. Originally posted by pushkarreddyy on 2026-10-11T09:06:02Z.
Thank you @orishamir and @screamm for the thorough hardware validation and empirical verification logs on both Windows and Linux! Massive thanks as well to @oneandonlydean for carrying this forward and to @adriadam10 for the careful review.
With @orishamir's run logs proving that Capy Mobile (
PPSA92280) successfully moves pastsysctlbynameinto/app0/games, all evidence and test requirements forkern.sdk_versionare now complete.Now that PR #2945 and #3218 have landed on
main, PR #2902 just needs a quick rebase over currentmainto resolve the hunk inSystemConfiguration.cpp. Whenever convenient, @oneandonlydean or @adriadam10, could you please rebase and merge?Also, as follow-ups ready for review and carry when convenient, we have three cleanly tested companion branches addressing open startup blockers:
localeconvinlibc(branchpushkarreddyy:feat/libc-localeconv), freshly validated by @Amoenus and @orishamir as the immediate stop for Sonic Unleashed Recompiled (PPSA99902), Cloud Play (PPSA99600), and vkQuake (PPSA99010).shm_unlinkinlibkernel(branchpushkarreddyy:feat/libkernel-shm-unlink).sigpendingandsigsuspendinlibkernel(branchpushkarreddyy:feat/libkernel-sigpending-sigsuspend), unblocking homebrew catalog stops from #1578.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-11T20:53:29Z.
Rebased onto
main0a8b1d32;kern.sdk_versionnow sits afterkern.rng_pseudo(#3218), and the tests of #2945 and #3218 are kept.0x01000000. The sysctl is the system software version, major in byte 3 and minor in byte 2 in hex digits that read as decimal (13.60 is0x1360xxxx): Capy Mobile, remote_lua_loader and the lapse payload read it that way. So it is not the title's compiled SDK version, and 1.00 is whatsceKernelGetSystemSwVersionreports onmainsince #2945. The owner said 1.00 is fine as the default./app0/games; the title only displays the value.A title that compares the version against a minimum would still see 1.00, as with
sceKernelGetSystemSwVersion; making the version a runtime setting is a follow-up PR.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T00:33:51Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)docs/dev/TechnicalDebt.mdL58-59docs/dev/TechnicalDebt.mdL58-60