libkernel: support kern.sdk_version in sysctlbyname (Capy Mobile PPSA92280) #2701

Closed
opened 2026-10-10 11:31:52 +00:00 by pushkarreddyy · 8 comments
pushkarreddyy commented 2026-10-10 11:31:52 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by pushkarreddyy on 2026-10-10T11:31:52Z.


Capy Mobile (PPSA92280) loads with 0 absent imports on Windows on current main (b5f5362d) but stops at start-up with:

[Kernel] <Error> SystemConfiguration.cpp:sysctlbyname_nid_postfix: unsupported name kern.sdk_version

The title queries sysctlbyname("kern.sdk_version", ...) in src/ps5/platform.c:64-71 to inspect firmware/SDK version. In core/libs/prx/libkernel/System/src/SystemConfiguration.cpp, sysctlbyname previously only handled hw.ncpu and threw for all other names.

Fix: pushkarreddyy/AnyPS5:feat/libkernel-sysctl-sdk-version (commit bc53426e, on main b5f5362d).

  • Implements kern.sdk_version returning 4-byte uint32_t 0x01000000 (1.00) matching PS5 baseline launch SDK formatting.
  • Rejects write attempts (newValue != nullptr) with errno = 1 (EPERM), preserving read-only MIB semantics.
  • Handles buffer sizing queries and buffer truncation (ENOMEM).
  • Zero comments in C++ source files per repository conventions.
  • Unit tests in core/libs/tests/GuestSystemConfiguration.cpp validating length queries, value retrieval, buffer truncation, and write rejection.
  • Documented in docs/dev/TechnicalDebt.md.
  • Conventions checked with python tools/check_conventions.py --base b5f5362d (100% passed).

Details in #2697 (closed by the intake pause).

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5790820815 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/2701). Originally posted by [pushkarreddyy](https://github.com/pushkarreddyy) on 2026-10-10T11:31:52Z. --- *Capy Mobile* (`PPSA92280`) loads with 0 absent imports on Windows on current `main` (`b5f5362d`) but stops at start-up with: ```text [Kernel] <Error> SystemConfiguration.cpp:sysctlbyname_nid_postfix: unsupported name kern.sdk_version ``` The title queries `sysctlbyname("kern.sdk_version", ...)` in `src/ps5/platform.c:64-71` to inspect firmware/SDK version. In `core/libs/prx/libkernel/System/src/SystemConfiguration.cpp`, `sysctlbyname` previously only handled `hw.ncpu` and threw for all other names. **Fix:** [`pushkarreddyy/AnyPS5:feat/libkernel-sysctl-sdk-version`](https://github.com/pushkarreddyy/AnyPS5/tree/feat/libkernel-sysctl-sdk-version) (commit `bc53426e`, on `main` `b5f5362d`). - Implements `kern.sdk_version` returning 4-byte `uint32_t` `0x01000000` (1.00) matching PS5 baseline launch SDK formatting. - Rejects write attempts (`newValue != nullptr`) with `errno = 1` (`EPERM`), preserving read-only MIB semantics. - Handles buffer sizing queries and buffer truncation (`ENOMEM`). - Zero comments in C++ source files per repository conventions. - Unit tests in `core/libs/tests/GuestSystemConfiguration.cpp` validating length queries, value retrieval, buffer truncation, and write rejection. - Documented in `docs/dev/TechnicalDebt.md`. - Conventions checked with `python tools/check_conventions.py --base b5f5362d` (100% passed). Details in #2697 (closed by the intake pause). AI-assisted: yes.
MarcZX10 commented 2026-10-10 12:09:43 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-10T12:09:43Z.


Revisé el cambio de #2697 contra main actual (197ffac9, 2026-10-10).

  • kern.sdk_version sigue sin estar implementado en SystemConfiguration.cpp; no encontré otro PR abierto que cubra sysctlbyname para ese nombre.
  • El parche de #2697 se basa en b5f5362d, dos commits antes de main. Esos commits posteriores afectan gráficos y documentación, no los tres archivos del cambio. Comparé el parche con la base actual: son los mismos tres archivos y git diff --check no reporta errores.
  • La implementación reutiliza CopyOut, cuya lógica ya soporta consulta de longitud, copias limitadas y ENOMEM. Los tests añadidos cubren esos casos y que los writes fallen con EPERM.
  • El punto aún no verificado es el valor fijo 0x01000000: el PR lo documenta como SDK 1.00, pero no hay evidencia de consola en el issue. Conviene validar ese supuesto en hardware o con una fuente primaria antes de darlo por exacto.

El PR #2697 fue cerrado automáticamente por la pausa de intake, no por una revisión técnica.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6097336973 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/2701#issuecomment-6097336973). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-10T12:09:43Z. --- Revisé el cambio de #2697 contra `main` actual (`197ffac9`, 2026-10-10). - `kern.sdk_version` sigue sin estar implementado en `SystemConfiguration.cpp`; no encontré otro PR abierto que cubra `sysctlbyname` para ese nombre. - El parche de #2697 se basa en `b5f5362d`, dos commits antes de `main`. Esos commits posteriores afectan gráficos y documentación, no los tres archivos del cambio. Comparé el parche con la base actual: son los mismos tres archivos y `git diff --check` no reporta errores. - La implementación reutiliza `CopyOut`, cuya lógica ya soporta consulta de longitud, copias limitadas y `ENOMEM`. Los tests añadidos cubren esos casos y que los writes fallen con `EPERM`. - El punto aún no verificado es el valor fijo `0x01000000`: el PR lo documenta como SDK 1.00, pero no hay evidencia de consola en el issue. Conviene validar ese supuesto en hardware o con una fuente primaria antes de darlo por exacto. El PR #2697 fue cerrado automáticamente por la pausa de intake, no por una revisión técnica.
pushkarreddyy commented 2026-10-10 12:40:19 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by pushkarreddyy on 2026-10-10T12:40:19Z.


¡Gracias por la revisión y por verificar el parche contra main actual, @MarcZX100!

Respecto al valor 0x01000000:

  • Se eligió como versión base de lanzamiento de PS5 (SDK 1.00) siguiendo el formato estándar de 4 bytes de PlayStation/FreeBSD ((major << 24) | (minor << 16) | (patch << 8)), que también es el patrón de referencia usado en emuladores como shadPS4 y homebrew de PS4/PS5.
  • Capy Mobile lee específicamente kern.sdk_version en src/ps5/platform.c:64-71 para formatear y mostrar la cadena de versión del SDK.
  • Como bien señalas, el valor exacto que reporta el hardware de PS5 en firmwares más recientes aún no está medido directamente en consola física. Por esa misma razón, dejamos ese supuesto explícitamente documentado como deuda técnica en docs/dev/TechnicalDebt.md bajo ### Unknown function info, de modo que pueda refinarse en cuanto se disponga de capturas de hardware o telemetría de sceKernelGetSystemSwVersion.

Ya he rebaseado la rama pushkarreddyy:feat/libkernel-sysctl-sdk-version directamente sobre el main actual con todos los checks de convenciones pasando al 100%. ¡Agradezco mucho que alguien con acceso de intake pueda llevarlo al merge train!

Thank you for the review and for testing the patch against current main, @MarcZX100!

Regarding the 0x01000000 value:

  • It was chosen as the baseline PS5 launch version (SDK 1.00) following PlayStation/FreeBSD 4-byte formatting ((major << 24) | (minor << 16) | (patch << 8)), which matches the convention used in emulators like shadPS4 and PS4/PS5 toolchains.
  • Capy Mobile specifically reads kern.sdk_version in src/ps5/platform.c:64-71 to format and display the SDK version string.
  • As you noted, the exact value reported by PS5 hardware on retail firmware remains unmeasured on physical consoles. For that exact reason, we explicitly documented that assumption in docs/dev/TechnicalDebt.md under ### Unknown function info, so it can be refined once hardware telemetry or sceKernelGetSystemSwVersion captures become available.

I have rebased the branch pushkarreddyy:feat/libkernel-sysctl-sdk-version onto current main with all convention checks passing 100%. Happy for anyone with intake access to carry it into a merge train!

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6097588924 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/2701#issuecomment-6097588924). Originally posted by [pushkarreddyy](https://github.com/pushkarreddyy) on 2026-10-10T12:40:19Z. --- ¡Gracias por la revisión y por verificar el parche contra `main` actual, @MarcZX100! Respecto al valor `0x01000000`: - Se eligió como versión base de lanzamiento de PS5 (SDK 1.00) siguiendo el formato estándar de 4 bytes de PlayStation/FreeBSD (`(major << 24) | (minor << 16) | (patch << 8)`), que también es el patrón de referencia usado en emuladores como shadPS4 y homebrew de PS4/PS5. - *Capy Mobile* lee específicamente `kern.sdk_version` en `src/ps5/platform.c:64-71` para formatear y mostrar la cadena de versión del SDK. - Como bien señalas, el valor exacto que reporta el hardware de PS5 en firmwares más recientes aún no está medido directamente en consola física. Por esa misma razón, dejamos ese supuesto explícitamente documentado como deuda técnica en `docs/dev/TechnicalDebt.md` bajo `### Unknown function info`, de modo que pueda refinarse en cuanto se disponga de capturas de hardware o telemetría de `sceKernelGetSystemSwVersion`. Ya he rebaseado la rama [`pushkarreddyy:feat/libkernel-sysctl-sdk-version`](https://github.com/pushkarreddyy/AnyPS5/tree/feat/libkernel-sysctl-sdk-version) directamente sobre el `main` actual con todos los checks de convenciones pasando al 100%. ¡Agradezco mucho que alguien con acceso de intake pueda llevarlo al merge train! Thank you for the review and for testing the patch against current `main`, @MarcZX100! Regarding the `0x01000000` value: - It was chosen as the baseline PS5 launch version (SDK 1.00) following PlayStation/FreeBSD 4-byte formatting (`(major << 24) | (minor << 16) | (patch << 8)`), which matches the convention used in emulators like shadPS4 and PS4/PS5 toolchains. - *Capy Mobile* specifically reads `kern.sdk_version` in `src/ps5/platform.c:64-71` to format and display the SDK version string. - As you noted, the exact value reported by PS5 hardware on retail firmware remains unmeasured on physical consoles. For that exact reason, we explicitly documented that assumption in `docs/dev/TechnicalDebt.md` under `### Unknown function info`, so it can be refined once hardware telemetry or `sceKernelGetSystemSwVersion` captures become available. I have rebased the branch [`pushkarreddyy:feat/libkernel-sysctl-sdk-version`](https://github.com/pushkarreddyy/AnyPS5/tree/feat/libkernel-sysctl-sdk-version) onto current `main` with all convention checks passing 100%. Happy for anyone with intake access to carry it into a merge train!
MarcZX10 commented 2026-10-10 13:01:03 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-10T13:01:03Z.


I refreshed pushkarreddyy’s author-attributed kern.sdk_version implementation onto upstream main (5edae353). The fork branch is codex/sysctl-sdk-version-2701, at 6699f7a93.

Check Result
Linux x86_64, GCC 12.2 Release: libkernel and guest_system_configuration_tests Passed
CTest guest_system_configuration Passed (1/1)
tools/check_conventions.py --base upstream/main Passed
git diff --check upstream/main...HEAD Passed

The tests cover the size query, value retrieval, preserved errno, short-buffer ENOMEM, and write rejection with EPERM. The reported value 0x01000000 is the documented SDK 1.00 baseline assumption; it has not been measured on retail PS5 hardware. Windows, macOS and title startup were not tested here.

I found no open PR for this issue and have not opened one because the repository intake workflow still requires 20 merged PRs; my live merged count is 15. AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6097766154 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/2701#issuecomment-6097766154). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-10T13:01:03Z. --- I refreshed pushkarreddyy’s author-attributed `kern.sdk_version` implementation onto upstream `main` (`5edae353`). The fork branch is [`codex/sysctl-sdk-version-2701`](https://github.com/MarcZX100/AnyPS5/tree/codex/sysctl-sdk-version-2701), at [`6699f7a93`](https://github.com/MarcZX100/AnyPS5/commit/6699f7a931a4adc301ad9f0e92e122bfb0a7f99c). | Check | Result | | --- | --- | | Linux x86_64, GCC 12.2 Release: `libkernel` and `guest_system_configuration_tests` | Passed | | CTest `guest_system_configuration` | Passed (1/1) | | `tools/check_conventions.py --base upstream/main` | Passed | | `git diff --check upstream/main...HEAD` | Passed | The tests cover the size query, value retrieval, preserved errno, short-buffer `ENOMEM`, and write rejection with `EPERM`. The reported value `0x01000000` is the documented SDK 1.00 baseline assumption; it has not been measured on retail PS5 hardware. Windows, macOS and title startup were not tested here. I found no open PR for this issue and have not opened one because the repository intake workflow still requires 20 merged PRs; my live merged count is 15. AI-assisted: yes.
pushkarreddyy commented 2026-10-10 13:05:53 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by pushkarreddyy on 2026-10-10T13:05:53Z.


Por cierto @MarcZX100, también acabo de implementar las dos exportaciones ausentes donde se detiene The Last of Us Part II Remastered (PPSA15508 v02.001.010) al inicio en main:

  • sceSslUnloadCert (NID UQ+3Qu7v3cA) en libSceSsl (donde se detiene el cargador)
  • sceVoiceGetMuteFlag (NID Pc4z1QjForU) en libSceVoice

Ambas incluyen pruebas unitarias en core/libs/tests/, soporte de desenrollado DWARF para MinGW y registro en TechnicalDebt.md, pasando todas las convenciones al 100%.

Acabo de abrir el PR aquí:
👉 PR #2753: https://github.com/boykopovar/AnyPS5/pull/2753
Rama: pushkarreddyy:feat/tlou2-missing-exports

By the way @MarcZX100, I also just implemented the two absent exports where The Last of Us Part II Remastered (PPSA15508 v02.001.010) halts at startup on main:

  • sceSslUnloadCert (NID UQ+3Qu7v3cA) in libSceSsl (where the loader currently stops)
  • sceVoiceGetMuteFlag (NID Pc4z1QjForU) in libSceVoice

Both include unit test coverage in core/libs/tests/, MinGW DWARF unwind support, and tracking in TechnicalDebt.md, passing all convention checks 100%.

I just opened the PR here:
👉 PR #2753: https://github.com/boykopovar/AnyPS5/pull/2753
Branch: pushkarreddyy:feat/tlou2-missing-exports

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6097805856 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/2701#issuecomment-6097805856). Originally posted by [pushkarreddyy](https://github.com/pushkarreddyy) on 2026-10-10T13:05:53Z. --- Por cierto @MarcZX100, también acabo de implementar las dos exportaciones ausentes donde se detiene *The Last of Us Part II Remastered* (`PPSA15508 v02.001.010`) al inicio en `main`: - `sceSslUnloadCert` (NID `UQ+3Qu7v3cA`) en `libSceSsl` (donde se detiene el cargador) - `sceVoiceGetMuteFlag` (NID `Pc4z1QjForU`) en `libSceVoice` Ambas incluyen pruebas unitarias en `core/libs/tests/`, soporte de desenrollado DWARF para MinGW y registro en `TechnicalDebt.md`, pasando todas las convenciones al 100%. Acabo de abrir el PR aquí: 👉 **PR #2753**: https://github.com/boykopovar/AnyPS5/pull/2753 Rama: [`pushkarreddyy:feat/tlou2-missing-exports`](https://github.com/pushkarreddyy/AnyPS5/tree/feat/tlou2-missing-exports) By the way @MarcZX100, I also just implemented the two absent exports where *The Last of Us Part II Remastered* (`PPSA15508 v02.001.010`) halts at startup on `main`: - `sceSslUnloadCert` (NID `UQ+3Qu7v3cA`) in `libSceSsl` (where the loader currently stops) - `sceVoiceGetMuteFlag` (NID `Pc4z1QjForU`) in `libSceVoice` Both include unit test coverage in `core/libs/tests/`, MinGW DWARF unwind support, and tracking in `TechnicalDebt.md`, passing all convention checks 100%. I just opened the PR here: 👉 **PR #2753**: https://github.com/boykopovar/AnyPS5/pull/2753 Branch: [`pushkarreddyy:feat/tlou2-missing-exports`](https://github.com/pushkarreddyy/AnyPS5/tree/feat/tlou2-missing-exports)
pushkarreddyy commented 2026-10-10 18:11:39 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by pushkarreddyy on 2026-10-10T18:11:39Z.


hey @MarcZX100 can u merge into main now

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6100635530 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/2701#issuecomment-6100635530). Originally posted by [pushkarreddyy](https://github.com/pushkarreddyy) on 2026-10-10T18:11:39Z. --- hey @MarcZX100 can u merge into main now
MarcZX10 commented 2026-10-10 21:24:43 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-10T21:24:43Z.


Thanks for asking. I cannot merge commits into upstream main. PR #2753 was automatically closed by the intake workflow while intake was paused; its passing checks do not authorize merging. Please leave your branch intact and ask an upstream maintainer whether they want the PR reopened or resubmitted.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6102333403 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/2701#issuecomment-6102333403). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-10T21:24:43Z. --- Thanks for asking. I cannot merge commits into upstream main. PR #2753 was automatically closed by the intake workflow while intake was paused; its passing checks do not authorize merging. Please leave your branch intact and ask an upstream maintainer whether they want the PR reopened or resubmitted.
pushkarreddyy commented 2026-10-11 11:55:51 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by pushkarreddyy on 2026-10-11T11:55:51Z.


Update: Carried in #2902 by @oneandonlydean with authorship preserved. All CI checks on #2902 are passing. Calling on maintainers @oneandonlydean, @adriadam10, and @MarcZX100 to review and merge when convenient!

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6108758612 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/2701#issuecomment-6108758612). Originally posted by [pushkarreddyy](https://github.com/pushkarreddyy) on 2026-10-11T11:55:51Z. --- Update: Carried in #2902 by @oneandonlydean with authorship preserved. All CI checks on #2902 are passing. Calling on maintainers @oneandonlydean, @adriadam10, and @MarcZX100 to review and merge when convenient!
oneandonlydean commented 2026-10-12 06:16:48 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-12T06:16:48Z.


Closing: fixed by #2902. sysctlbyname("kern.sdk_version") answers on main (System/src/SystemConfiguration.cpp:160). Reopen if PPSA92280 still stops there on current main.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6118853690 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/2701#issuecomment-6118853690). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-12T06:16:48Z. --- Closing: fixed by #2902. `sysctlbyname("kern.sdk_version")` answers on main (`System/src/SystemConfiguration.cpp:160`). Reopen if PPSA92280 still stops there on current main.
Sign in to join this conversation.
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#2701
No description provided.