feat(libkernel): answer the uname sysctl names #6220

Merged
DavidSamir merged 5 commits from upstream-pr/6220 into main 2026-10-18 19:56:01 +00:00
DavidSamir commented 2026-10-15 04:48:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by DavidSamir on 2026-10-15T04:48:54Z.


What

Super Mario Sunshine (PPSA99312, catalog 0.10.0) aborts a second after start:

what():  sysctl_nid_postfix: unsupported MIB 1.1

The title calls uname, which reads five names through sysctl in turn: kern.ostype (1.1), kern.hostname (1.10), kern.osrelease (1.2), kern.version (1.4) and hw.machine (6.1). libkernel's sysctl serves none of them, so the first throws. (Answering only 1.1 moves the stop to 1.10, and so on; with the five logged and failed instead of thrown, those are the only names the title asks for.)

sysctl now serves the five as read-only strings from one table in SystemConfiguration.cpp:

Name MIB Value
kern.ostype 1.1 FreeBSD
kern.osrelease 1.2 11.4-RELEASE
kern.version 1.4 FreeBSD 11.4-RELEASE\n
kern.hostname 1.10 AnyPS5, the name gethostname already reports
hw.machine 6.1 amd64

The type, release and version are what FreeBSD 11.4-RELEASE builds without source control information (newvers.sh L45-L52, L293-L294), the FreeBSD revision the libkernel debt notes already cite. A short buffer gets the copied prefix and ENOMEM, a new value EPERM (as for hw.model and kern.sdk_version), and a trailing name component ENOTDIR. sysctlbyname and sysctlnametomib map the names to these MIBs. The console's strings are not measured; the debt note says so.

Five commits:

  1. feat(libkernel): answer the uname sysctl names.
  2. test(libkernel): cover the uname names through sysctl: for each, the size query, the value, a short buffer, a new value and a trailing component.
  3. feat(libkernel): accept the uname names in sysctlbyname and sysctlnametomib.
  4. test(libkernel): cover the uname names through sysctlbyname and sysctlnametomib.
  5. docs(debt): record where the uname sysctl strings come from, under Unknown function info.

Tested

Windows (03c09c459 on main a077a88df, Windows 11 10.0.26300, WinLibs GCC 15.2.0 r7, Release). The title runs used libraries built from two earlier versions of this branch (276fa63ad, 88bb8721b), whose library code differs from the head only in where the leaf check is made:

  • Super Mario Sunshine (PPSA99312, catalog 0.10.0), 40 s, alternating, three runs each: with main's libraries it aborts after 1 to 2 s with exit 0xc0000409 and what(): sysctl_nid_postfix: unsupported MIB 1.1. With the branch's it logs no disc image in the title's folder: copy your GMSE01 .iso, .gcm or .ciso beside eboot.bin, as both builds do, and then exits by itself with code 0 after 1 s instead of aborting. A run needs the player's own disc image, which is not included, so this is as far as it gets without one.
  • 12 catalog titles, 35 s each with main's libraries and with the branch's (ccleste, RommPS, SwanStationPS5, ProsperoTV, DOOM, ScreenTester5, Prospero Vibrate, SymphonyStation5, ProsperoStore, OpenNOW, ProsperoRadio, PSXS5): all still running at 35 s with both.
  • With SystemConfiguration.cpp as on main, guest_system_configuration aborts (exit 0xc0000409) at the first new check; with the change it passes.
  • Each commit alone: the libraries build and guest_system_configuration, guest_hostname and guest_getopt pass.
  • Full ctest --parallel 4 on a full build of 88bb8721b, which differs from the head only in GuestSystemConfiguration.cpp (the trailing-component checks moved into the new test function): 1251 of 1252 pass. check_main_sync fails on this machine at a file name with é read back through the console code page; it passes with PYTHONUTF8=1, and the branch changes nothing under tools/.
  • tools/check_conventions.py --base origin/main passes. tools/pr_overlap.py --branch reports no overlap with open pull requests.

Linux (same commit, WSL2 Ubuntu 24.04, GCC 13.3.0, Release): libs builds and guest_system_configuration and guest_hostname pass.

Not checked on a console.

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
  • Unblocks: PPSA99312 (Super Mario Sunshine)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4868355025 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6220). Originally posted by [DavidSamir](https://github.com/DavidSamir) on 2026-10-15T04:48:54Z. --- ### What Super Mario Sunshine (PPSA99312, catalog 0.10.0) aborts a second after start: ``` what(): sysctl_nid_postfix: unsupported MIB 1.1 ``` The title calls `uname`, which reads five names through `sysctl` in turn: `kern.ostype` (1.1), `kern.hostname` (1.10), `kern.osrelease` (1.2), `kern.version` (1.4) and `hw.machine` (6.1). libkernel's `sysctl` serves none of them, so the first throws. (Answering only 1.1 moves the stop to 1.10, and so on; with the five logged and failed instead of thrown, those are the only names the title asks for.) `sysctl` now serves the five as read-only strings from one table in `SystemConfiguration.cpp`: | Name | MIB | Value | |---|---|---| | `kern.ostype` | 1.1 | `FreeBSD` | | `kern.osrelease` | 1.2 | `11.4-RELEASE` | | `kern.version` | 1.4 | `FreeBSD 11.4-RELEASE\n` | | `kern.hostname` | 1.10 | `AnyPS5`, the name `gethostname` already reports | | `hw.machine` | 6.1 | `amd64` | The type, release and version are what FreeBSD 11.4-RELEASE builds without source control information ([`newvers.sh` L45-L52](https://github.com/freebsd/freebsd-src/blob/8c639945a44588f6cfdddfb057bb5aad88735da0/sys/conf/newvers.sh#L45-L52), [L293-L294](https://github.com/freebsd/freebsd-src/blob/8c639945a44588f6cfdddfb057bb5aad88735da0/sys/conf/newvers.sh#L293-L294)), the FreeBSD revision the libkernel debt notes already cite. A short buffer gets the copied prefix and `ENOMEM`, a new value `EPERM` (as for `hw.model` and `kern.sdk_version`), and a trailing name component `ENOTDIR`. `sysctlbyname` and `sysctlnametomib` map the names to these MIBs. The console's strings are not measured; the debt note says so. Five commits: 1. `feat(libkernel): answer the uname sysctl names`. 2. `test(libkernel): cover the uname names through sysctl`: for each, the size query, the value, a short buffer, a new value and a trailing component. 3. `feat(libkernel): accept the uname names in sysctlbyname and sysctlnametomib`. 4. `test(libkernel): cover the uname names through sysctlbyname and sysctlnametomib`. 5. `docs(debt): record where the uname sysctl strings come from`, under Unknown function info. ### Tested Windows (03c09c459 on `main` a077a88df, Windows 11 10.0.26300, WinLibs GCC 15.2.0 r7, Release). The title runs used libraries built from two earlier versions of this branch (276fa63ad, 88bb8721b), whose library code differs from the head only in where the leaf check is made: - Super Mario Sunshine (PPSA99312, catalog 0.10.0), 40 s, alternating, three runs each: with `main`'s libraries it aborts after 1 to 2 s with exit 0xc0000409 and `what(): sysctl_nid_postfix: unsupported MIB 1.1`. With the branch's it logs `no disc image in the title's folder: copy your GMSE01 .iso, .gcm or .ciso beside eboot.bin`, as both builds do, and then exits by itself with code 0 after 1 s instead of aborting. A run needs the player's own disc image, which is not included, so this is as far as it gets without one. - 12 catalog titles, 35 s each with `main`'s libraries and with the branch's (ccleste, RommPS, SwanStationPS5, ProsperoTV, DOOM, ScreenTester5, Prospero Vibrate, SymphonyStation5, ProsperoStore, OpenNOW, ProsperoRadio, PSXS5): all still running at 35 s with both. - With `SystemConfiguration.cpp` as on `main`, `guest_system_configuration` aborts (exit 0xc0000409) at the first new check; with the change it passes. - Each commit alone: the libraries build and `guest_system_configuration`, `guest_hostname` and `guest_getopt` pass. - Full `ctest --parallel 4` on a full build of 88bb8721b, which differs from the head only in `GuestSystemConfiguration.cpp` (the trailing-component checks moved into the new test function): 1251 of 1252 pass. `check_main_sync` fails on this machine at a file name with `é` read back through the console code page; it passes with `PYTHONUTF8=1`, and the branch changes nothing under `tools/`. - `tools/check_conventions.py --base origin/main` passes. `tools/pr_overlap.py --branch` reports no overlap with open pull requests. Linux (same commit, WSL2 Ubuntu 24.04, GCC 13.3.0, Release): `libs` builds and `guest_system_configuration` and `guest_hostname` pass. Not checked on a console. ### Checklist - [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] Unblocks: PPSA99312 (Super Mario Sunshine) - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-15 12:16:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T12:16:54Z.


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.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 7541 core/libs/prx/libkernel/System/src/SystemConfiguration.cpp L189
PR 7554 core/libs/prx/libkernel/System/src/SystemConfiguration.cpp L171-172

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 5021 docs/dev/debt/libkernel.md
PR 6044 core/libs/tests/GuestSystemConfiguration.cpp
PR 6446 docs/dev/debt/libkernel.md
PR 6510 docs/dev/debt/libkernel.md
PR 6519 docs/dev/debt/libkernel.md
PR 6534 docs/dev/debt/libkernel.md
PR 6908 docs/dev/debt/libkernel.md
PR 6936 docs/dev/debt/libkernel.md
PR 6977 docs/dev/debt/libkernel.md
PR 7039 docs/dev/debt/libkernel.md
PR 7049 docs/dev/debt/libkernel.md
PR 7088 docs/dev/debt/libkernel.md
PR 7105 docs/dev/debt/libkernel.md
PR 7149 docs/dev/debt/libkernel.md
PR 7192 docs/dev/debt/libkernel.md
PR 7299 docs/dev/debt/libkernel.md
PR 7447 docs/dev/debt/libkernel.md
PR 7509 docs/dev/debt/libkernel.md
PR 7543 docs/dev/debt/libkernel.md
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6191836270 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6220#issuecomment-6191836270). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-15T12:16:54Z. --- <!-- pr-overlap --> 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**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | [PR 7541](https://www.github.com/boykopovar/AnyPS5/pull/7541) | `core/libs/prx/libkernel/System/src/SystemConfiguration.cpp` [L189](https://github.com/boykopovar/AnyPS5/blob/48d61f53b46f1d0726889e4dd39c5ef2b3eb30cd/core/libs/prx/libkernel/System/src/SystemConfiguration.cpp#L189) | | | | [PR 7554](https://www.github.com/boykopovar/AnyPS5/pull/7554) | `core/libs/prx/libkernel/System/src/SystemConfiguration.cpp` [L171-172](https://github.com/boykopovar/AnyPS5/blob/48d61f53b46f1d0726889e4dd39c5ef2b3eb30cd/core/libs/prx/libkernel/System/src/SystemConfiguration.cpp#L171-L172) | | | 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 5021](https://www.github.com/boykopovar/AnyPS5/pull/5021) | `docs/dev/debt/libkernel.md` | | [PR 6044](https://www.github.com/boykopovar/AnyPS5/pull/6044) | `core/libs/tests/GuestSystemConfiguration.cpp` | | [PR 6446](https://www.github.com/boykopovar/AnyPS5/pull/6446) | `docs/dev/debt/libkernel.md` | | [PR 6510](https://www.github.com/boykopovar/AnyPS5/pull/6510) | `docs/dev/debt/libkernel.md` | | [PR 6519](https://www.github.com/boykopovar/AnyPS5/pull/6519) | `docs/dev/debt/libkernel.md` | | [PR 6534](https://www.github.com/boykopovar/AnyPS5/pull/6534) | `docs/dev/debt/libkernel.md` | | [PR 6908](https://www.github.com/boykopovar/AnyPS5/pull/6908) | `docs/dev/debt/libkernel.md` | | [PR 6936](https://www.github.com/boykopovar/AnyPS5/pull/6936) | `docs/dev/debt/libkernel.md` | | [PR 6977](https://www.github.com/boykopovar/AnyPS5/pull/6977) | `docs/dev/debt/libkernel.md` | | [PR 7039](https://www.github.com/boykopovar/AnyPS5/pull/7039) | `docs/dev/debt/libkernel.md` | | [PR 7049](https://www.github.com/boykopovar/AnyPS5/pull/7049) | `docs/dev/debt/libkernel.md` | | [PR 7088](https://www.github.com/boykopovar/AnyPS5/pull/7088) | `docs/dev/debt/libkernel.md` | | [PR 7105](https://www.github.com/boykopovar/AnyPS5/pull/7105) | `docs/dev/debt/libkernel.md` | | [PR 7149](https://www.github.com/boykopovar/AnyPS5/pull/7149) | `docs/dev/debt/libkernel.md` | | [PR 7192](https://www.github.com/boykopovar/AnyPS5/pull/7192) | `docs/dev/debt/libkernel.md` | | [PR 7299](https://www.github.com/boykopovar/AnyPS5/pull/7299) | `docs/dev/debt/libkernel.md` | | [PR 7447](https://www.github.com/boykopovar/AnyPS5/pull/7447) | `docs/dev/debt/libkernel.md` | | [PR 7509](https://www.github.com/boykopovar/AnyPS5/pull/7509) | `docs/dev/debt/libkernel.md` | | [PR 7543](https://www.github.com/boykopovar/AnyPS5/pull/7543) | `docs/dev/debt/libkernel.md` |
nicolasfalesy commented 2026-10-16 02:40:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by nicolasfalesy on 2026-10-16T02:40:42Z.


A title that reaches this: Super Mario Sunshine (PPSA99312) from the homebrew catalog, on Linux (Intel Arc, Mesa ANV).

  • main 5d9dcc42d: stops with sysctl_nid_postfix: unsupported MIB 1.1.
  • main 5d9dcc42d + this PR: it gets past that and runs to its own check, [Super Mario Sunshine] no disc image in the title's folder: copy your GMSE01 .iso, .gcm or .ciso beside eboot.bin, then exits with status 0 (no disc image was installed for the test).

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6206822826 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6220#issuecomment-6206822826). Originally posted by [nicolasfalesy](https://github.com/nicolasfalesy) on 2026-10-16T02:40:42Z. --- A title that reaches this: **Super Mario Sunshine (PPSA99312)** from the homebrew catalog, on Linux (Intel Arc, Mesa ANV). - `main` 5d9dcc42d: stops with `sysctl_nid_postfix: unsupported MIB 1.1`. - `main` 5d9dcc42d + this PR: it gets past that and runs to its own check, `[Super Mario Sunshine] no disc image in the title's folder: copy your GMSE01 .iso, .gcm or .ciso beside eboot.bin`, then exits with status 0 (no disc image was installed for the test). AI-assisted: yes
milescoviello commented 2026-10-16 20:57:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-16T20:57:32Z.


A title this unblocks on Linux: Super Mario Sunshine (PPSA99312, catalog build), RTX 4070 Ti, release build, 30 s with pad input. Its uname() asks sysctl 1.1, 1.10, 1.2, 1.4 and 6.1.

  • main 1b1f8483c: it aborts at 0 s with sysctl_nid_postfix: unsupported MIB 1.1, right after printing that its disc image is missing.
  • This head 03c09c459 merged onto that main (clean merge): 2 of 2 runs exit with status 0 after the same "no disc image in the title's folder" message, which is the title's own path without the user's GMSE01 image. So the next stop needs the disc image, not AnyPS5.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6224557225 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6220#issuecomment-6224557225). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-16T20:57:32Z. --- A title this unblocks on Linux: Super Mario Sunshine (PPSA99312, catalog build), RTX 4070 Ti, release build, 30 s with pad input. Its `uname()` asks sysctl 1.1, 1.10, 1.2, 1.4 and 6.1. - **`main` 1b1f8483c:** it aborts at 0 s with `sysctl_nid_postfix: unsupported MIB 1.1`, right after printing that its disc image is missing. - **This head 03c09c459 merged onto that `main` (clean merge):** 2 of 2 runs exit with status 0 after the same "no disc image in the title's folder" message, which is the title's own path without the user's GMSE01 image. So the next stop needs the disc image, not AnyPS5. AI-assisted: yes
LeandroLP23 commented 2026-10-17 07:00:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-17T07:00:45Z.


A second title this unblocks, on Windows: VLC (PPSA85300, catalog 0.4). It reaches uname through its bundled libupnp, which builds its SERVER header (%s/%s, UPnP/1.0, Portable SDK for UPnP devices/1.14.31) from the system name and release.

Windows 11 (26300), Radeon 860M (RDNA 3.5, driver 32.0.13058.8001), WinLibs GCC 15.2.0, Release, relinked with --windows --registry --windows-fixed-base 0x400000 (#4013), 60 s, audio muted:

  • main 6a32550fd: aborts at 7 s with sysctl_nid_postfix: unsupported MIB 1.1. On main 9a3e2ac4d it ran 60 s, so something merged since then lets libupnp get as far as uname; I did not bisect which.
  • main 6a32550fd + this head 03c09c459 (merged cleanly): runs 60 s at 31.0 FPS, and the last dumped frame shows VLC's full welcome page ("Welcome to VLC", the language grid). guest_system_configuration passes.

AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6230969181 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6220#issuecomment-6230969181). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-17T07:00:45Z. --- A second title this unblocks, on Windows: VLC (PPSA85300, catalog 0.4). It reaches `uname` through its bundled libupnp, which builds its `SERVER` header (`%s/%s, UPnP/1.0, Portable SDK for UPnP devices/1.14.31`) from the system name and release. Windows 11 (26300), Radeon 860M (RDNA 3.5, driver 32.0.13058.8001), WinLibs GCC 15.2.0, Release, relinked with `--windows --registry --windows-fixed-base 0x400000` (#4013), 60 s, audio muted: - **`main` `6a32550fd`:** aborts at 7 s with `sysctl_nid_postfix: unsupported MIB 1.1`. On `main` 9a3e2ac4d it ran 60 s, so something merged since then lets libupnp get as far as `uname`; I did not bisect which. - **`main` `6a32550fd` + this head `03c09c459`** (merged cleanly): runs 60 s at 31.0 FPS, and the last dumped frame shows VLC's full welcome page ("Welcome to VLC", the language grid). `guest_system_configuration` passes. AI-assisted: yes (Claude Code).
MarcZX10 commented 2026-10-18 13:33:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T13:33:23Z.


I'm preparing a separate PR for measured kern.rng_pseudo MIB {1,50} support and its sysctlnametomib mapping. The overlap checker flags nearby insertion points in SystemConfiguration.cpp and GuestSystemConfiguration.cpp; the behavior is separate, but rebasing may need small conflict resolutions. Which PR should land first, or are you comfortable with this one landing first?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6250530349 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6220#issuecomment-6250530349). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T13:33:23Z. --- I'm preparing a separate PR for measured kern.rng_pseudo MIB {1,50} support and its sysctlnametomib mapping. The overlap checker flags nearby insertion points in SystemConfiguration.cpp and GuestSystemConfiguration.cpp; the behavior is separate, but rebasing may need small conflict resolutions. Which PR should land first, or are you comfortable with this one landing first?
milescoviello commented 2026-10-18 20:05:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-18T20:05:07Z.


@LeandroLP23 thanks for the VLC run on Windows, and sorry for the slow reply. libupnp building its SERVER header from uname is a good second caller to have on record.

@MarcZX10 sorry I didn't answer before it landed. adriadam10 has since merged this as b8cd204a3f, so your kern.rng_pseudo {1, 50} PR can start from current main, and there's nothing left to coordinate on this side.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6254525063 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6220#issuecomment-6254525063). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-18T20:05:07Z. --- @LeandroLP23 thanks for the VLC run on Windows, and sorry for the slow reply. libupnp building its `SERVER` header from `uname` is a good second caller to have on record. @MarcZX10 sorry I didn't answer before it landed. adriadam10 has since merged this as b8cd204a3f, so your `kern.rng_pseudo` {1, 50} PR can start from current `main`, and there's nothing left to coordinate on this side. AI-assisted: yes (Claude Code)
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!6220
No description provided.