feat(libkernel): implement sysKernel update version and mode queries #10671
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10671"
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 pushkarreddyy on 2026-10-24T16:38:38Z.
What
Four
sysKernelsystem queries (sysKernelGetUpdVersion,sysKernelGetManufacturingMode,sysKernelGetIntdevModeForInternalLibc, andsysKernelGetIntdevModeForRcmgr) were discovery stubs that threwNotImplementedinlibkernel_sys. They are now implemented inlibkernel, alongsidesysKernelGetLowerLimitSysexVersionandsysKernelGetLowerLimitUpdVersionincore/libs/prx/libkernel/System/src/SystemConfiguration.cpp, and thelibkernel_sysstubs are removed.Following firmware 13.42
libkernel.sprxandlibkernel_sys.sprxdisassembly measured by BunnyFl, these wrapper functions delegate tosysctlbyname:sysKernelGetUpdVersion(uint32_t* version)validates null output (returningSCE_KERNEL_ERROR_EINVAL), delegates tosysctlbyname("machdep.upd_version", ...), and returns the sysctl status.sysKernelGetManufacturingMode(void)returnsintfromsysctlbyname("machdep.curr_manumode", ...).sysKernelGetIntdevModeForInternalLibc(void)returnsintfromsysctlbyname("machdep.rcmgr_intdev_for_internal_libc", ...).sysKernelGetIntdevModeForRcmgr(void)returnsintfromsysctlbyname("machdep.rcmgr_intdev", ...).The underlying
machdepsysctls (machdep.upd_version,machdep.curr_manumode,machdep.rcmgr_intdev_for_internal_libc,machdep.rcmgr_intdev) return 0 as assumed defaults chosen by AnyPS5, and reject writes withEPERM. Neither routine alters guest errno (*__error_nid_postfix()). Technical debt documentation is updated indocs/dev/debt/libkernel.md.Tested
python tools/check_conventions.py --base origin/main(passed with 0 errors).CheckVersionLimitsincore/libs/tests/GuestSystemConfiguration.cpp:sysKernelGetUpdVersionwrites 0 into the destination buffer and rejects null output withSCE_KERNEL_ERROR_EINVAL;sysKernelGetManufacturingMode,sysKernelGetIntdevModeForInternalLibc, andsysKernelGetIntdevModeForRcmgrreturn 0;0xaaaaaaaau) remain untampered;Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T16:43:35Z.
Review: APPROVED
Reviewed exact head
4b4ceb48935474d15deec74e9f03064f9db7b9bf. The four wrappers consistently validate null outputs, write exactly one 32-bit zero, and return success without touching errno; the adjacent canary and errno assertions cover those boundaries. The prior discovery stubs are removed, and the debt entry now records the added queries and their still-unknown output meaning.git diff --check, conventions, and the merge-tree check with currentupstream/mainpass. I also compiled the changedSystemConfiguration.cppandGuestSystemConfiguration.cpptranslation units with the repository’s CMake-generated GCC 12 build flags. I did not run the linked runtime test locally; the PR reports the new assertions inCheckVersionLimits, while hosted product/platform build jobs are skipped by path policy. The reported firmware 13.42 behavior remains author-supplied evidence, not independently checked against a console or binary here.