Skip to content

fix(libkernel): report the sysctl system strings and integers a PS5 reports - #10132

Merged
adriadam10 merged 7 commits into
boykopovar:mainfrom
orezraey:fix/libkernel-sysctl-system-measured-ps5
Oct 26, 2026
Merged

adriadam10 merged 7 commits into
boykopovar:mainfrom
orezraey:fix/libkernel-sysctl-system-measured-ps5

Conversation

@orezraey

@orezraey orezraey commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

What

System sysctl strings and integers measured on a retail PS5 (firmware 13.60) with a homebrew probe, called from a payload process both by name and by MIB. The source and console log are in this gist (sysinfo).

Name (MIB) Console Before
kern.osrelease (1.2) "0.0-prototype" "11.4-RELEASE"
kern.hostname (1.10) "" (1 byte) "AnyPS5"
hw.model (6.2) "100-000001020" padded with spaces to 47 characters the host CPU's brand string
kern.osreldate (1.24) 900000 1104001
kern.osrevision (1.3) 199506 threw (unsupported name)
kern.argmax (1.8) 262144 threw
kern.ngroups (1.18) 1023 threw
kern.bootfile, kern.ident, hw.floatingpoint, kern.cp_time -1 with ENOENT threw

These already matched:

  • kern.ostype ("FreeBSD"), hw.machine ("amd64") and hw.pagesize (4 bytes, 16384);
  • the existing ENOENT names (hw.byteorder, hw.machine_arch, kern.maxfiles, kern.maxfilesperproc, kern.maxproc, hw.physmem);
  • a buffer one byte short getting the bytes that fit and ENOMEM;
  • sceKernelGetAllowedSdkVersionOnSystem: it read 0x13600fff (the firmware with the 12 low bits set, the same shape as AnyPS5's 0x01000fff for its own version), and a null pointer returned EINVAL (0x80020016).

hw.model no longer depends on the host CPU, so its test now runs on every host.

gethostname still returns AnyPS5 until #10128, which measures and returns the same empty name; this PR does not depend on it.

Not changed: the console's kern.version was "r229358/releases/13.60 Jul 17 2026 02:16:29". It names the firmware build, which AnyPS5 does not model (it reports system software 01.000.000 elsewhere), so the FreeBSD 11.4 string stays. The debt entry records the measured text. hw.ncpu read 16, and AnyPS5 keeps reporting the host's processor count.

Tested

Windows 11, MinGW (winlibs).

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The firmware 13.60 probe log supports the new sysctl strings/integers, MIBs, lengths, and ENOENT cases, and the test updates cover by-name and by-MIB access plus short buffers. GCC 12.2 syntax checks for the implementation and test passed; conventions, diff-check, and current-main sync pass (4 ahead/29 behind; merge clean). The author reports three repeated Windows runs and a main control. Please coordinate integration before approval: current PR #9794 changes SystemConfiguration.cpp and conflicts with this head in that file; #8910 changes the unknown-name handling and conflicts in the same libkernel.md debt entry; #9199 also conflicts in that debt file. These are open PRs, and pairwise merge-tree checks confirm the conflicts. Agree on landing order, preserve all measured results, add Depends on if another PR must land first, then refresh and rerun overlap/convention checks. Hosted policy checks pass; product jobs are skipped by the workflow.

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 4630 docs/dev/debt/libkernel.md
PR 5021 docs/dev/debt/libkernel.md
PR 6149 docs/dev/debt/libkernel.md
PR 6740 docs/dev/debt/libkernel.md
PR 6936 docs/dev/debt/libkernel.md
PR 7088 docs/dev/debt/libkernel.md
PR 7105 docs/dev/debt/libkernel.md
PR 7121 docs/dev/debt/libkernel.md
PR 7149 docs/dev/debt/libkernel.md
PR 7192 docs/dev/debt/libkernel.md
PR 7447 docs/dev/debt/libkernel.md
PR 7509 docs/dev/debt/libkernel.md
PR 7804 docs/dev/debt/libkernel.md
PR 8010 docs/dev/debt/libkernel.md
PR 8605 docs/dev/debt/libkernel.md
PR 9156 docs/dev/debt/libkernel.md
PR 9199 docs/dev/debt/libkernel.md
PR 9284 docs/dev/debt/libkernel.md
PR 9293 docs/dev/debt/libkernel.md
PR 9297 docs/dev/debt/libkernel.md
PR 9302 docs/dev/debt/libkernel.md
PR 9389 docs/dev/debt/libkernel.md
PR 9491 docs/dev/debt/libkernel.md
PR 9509 docs/dev/debt/libkernel.md
PR 9557 docs/dev/debt/libkernel.md
PR 9566 docs/dev/debt/libkernel.md
PR 9575 docs/dev/debt/libkernel.md
PR 9947 docs/dev/debt/libkernel.md
PR 10442 docs/dev/debt/libkernel.md
PR 10499 docs/dev/debt/libkernel.md
PR 10552 docs/dev/debt/libkernel.md
PR 10621 docs/dev/debt/libkernel.md
PR 11042 docs/dev/debt/libkernel.md
PR 11085 docs/dev/debt/libkernel.md
PR 11264 core/libs/prx/libkernel/System/src/SystemConfiguration.cpp
core/libs/tests/GuestSystemConfiguration.cpp
docs/dev/debt/libkernel.md
PR 11267 docs/dev/debt/libkernel.md
PR 11341 docs/dev/debt/libkernel.md

@orezraey

Copy link
Copy Markdown
Contributor Author

@MarcZX10 @Retr0G28 @DoubleAAGuy @KernelPanicNT This PR, #9794, #8910 and #9199 touch the same sysctl debt entry (and #9794 SystemConfiguration.cpp), but none needs another to work. I'm fine landing after them: I'll refresh this branch and keep kern.boottime from #9794, the ENOENT return from #8910 and the firmware 10.01 citations from #9199.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 23, 2026
Main now returns ENOENT for unknown sysctlbyname and sysctlnametomib names, so the absent-names debt entry no longer says they throw and keeps main's unknown-names entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Oct 23, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wachi35676

Copy link
Copy Markdown
Contributor

Tested head 4064b18e8c merged onto main acb900c194, Windows 11 (WinLibs GCC 15.2.0, Release) and WSL2 Ubuntu 24.04 (GCC 13.3), BUILD_TESTING=ON. This adds the Linux run.

  • guest_system_configuration passes 3 of 3 runs on both hosts. That includes the hw.model check, which no longer depends on the host CPU. With SystemConfiguration.cpp from main, it fails on both.
  • I compared the table with sysinfo.console.log in the gist, and every new entry matches:
    • kern.osrelease is 14 bytes, kern.hostname is 1 byte, and hw.model is 48 bytes (13 characters, 34 spaces, NUL).
    • The integers decode to the same values: 900000, 199506, 262144 and 1023.
    • The four ENOENT names match, and so do the short-buffer lengths: strings get one byte less and integers 3 bytes, both with ENOMEM.
  • hw.model lost its dedicated branch, but a write is still refused. sysctlbyname(name, NULL, NULL, "x", 2) gives -1 with EPERM for hw.model, kern.osrelease, kern.hostname, kern.osreldate and kern.argmax.

AI-assisted: yes (Claude Code); results above were run on this machine.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 26, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 26, 2026
@adriadam10 adriadam10 self-assigned this Oct 26, 2026
@adriadam10
adriadam10 dismissed MarcZX10’s stale review October 26, 2026 15:06

Dismissing a stale review: the requested changes were addressed after it (new head) and the merge queue blocks on it. Please request changes again if anything is still open.

@adriadam10
adriadam10 merged commit 5bdda36 into boykopovar:main Oct 26, 2026
11 of 12 checks passed
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked the new strings and integers against the 13.60 sysinfo log (by MIB and by name, short-buffer lengths), that the test pins values only the change produces, that hw.model by name resolves through the system string table, and the debt entries. The one red job (guest_sleep_wake on Linux) is a timing test that does not touch sysctl and was rerun; confirmed on Windows and WSL by @wachi35676; merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants