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

Merged
orezraey merged 7 commits from upstream-pr/10132 into main 2026-10-26 15:48:58 +00:00
orezraey commented 2026-10-23 10:35:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by orezraey on 2026-10-23T10:35:26Z.


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).

  • guest_system_configuration checks every string above by MIB and by name, including a buffer one byte short, which now uses each string's own length.
  • It checks the three new integers and the four new ENOENT names.
  • It fails on main and passes three runs in a row with the change, as does host_cpu.
  • At head db07b6737d (main merged in after #11170 and #11182; the libkernel debt file keeps #11170's unknown-names entry and this PR's three entries), guest_system_configuration and guest_getrlimit pass three runs in a row on Windows (MinGW) and on Linux (WSL Ubuntu, GCC).
  • tools/check_conventions.py passes.
  • tools/pr_overlap.py:
    • #9794 (kern.boottime) touches the include block of SystemConfiguration.cpp, from which this PR removes the HostCpu.hpp include;
    • #9199 and #8910 edit neighbouring lines of the libkernel debt file.

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
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4981442196 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10132). Originally posted by [orezraey](https://github.com/orezraey) on 2026-10-23T10:35:26Z. --- ### 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](https://gist.github.com/orezraey/114ab5ffe5a3f09ea9aafe617a15e574) (`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 <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Windows 11, MinGW (winlibs). - `guest_system_configuration` checks every string above by MIB and by name, including a buffer one byte short, which now uses each string's own length. - It checks the three new integers and the four new `ENOENT` names. - It fails on `main` and passes three runs in a row with the change, as does `host_cpu`. - At head db07b6737d (main merged in after #11170 and #11182; the libkernel debt file keeps #11170's unknown-names entry and this PR's three entries), `guest_system_configuration` and `guest_getrlimit` pass three runs in a row on Windows (MinGW) and on Linux (WSL Ubuntu, GCC). - `tools/check_conventions.py` passes. - `tools/pr_overlap.py`: - #9794 (`kern.boottime`) touches the include block of `SystemConfiguration.cpp`, from which this PR removes the `HostCpu.hpp` include; - #9199 and #8910 edit neighbouring lines of the libkernel debt file. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-23 10:50:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T10:50:22Z.

Review: DISMISSED


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.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5627212978 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10132#pullrequestreview-5627212978). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-23T10:50:22Z. **Review:** DISMISSED --- 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.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!10132
No description provided.