feat(libkernel): implement sceKernelGetSystemSwVersion #2906

Closed
pushkarreddyy wants to merge 1 commit from upstream-pr/2906 into main
pushkarreddyy commented 2026-10-10 18:22:57 +00:00 (Migrated from github.com)

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


What

ProsperoStore (PPSA99000) stops at startup on main (57f96fd2) on missing system export sceKernelGetSystemSwVersion (NID Mv1zUObHvXI) in libkernel.

In PR #2543 (kill, merged as 9a704771), startup logging verified:
With this PR applied, PPSA99000 moves past kill, next stop = ./app.elf: symbol lookup error: ./app.elf: undefined symbol: Mv1zUObHvXI.

This PR implements sceKernelGetSystemSwVersion_nid_postfix:

  • Declares struct SceKernelSystemSwVersion (size, versionString, version, unk_24, total size 40 bytes / 0x28).
  • Validates null pointer and reports EFAULT (14).
  • Validates struct size equals sizeof(SceKernelSystemSwVersion) and reports EINVAL (22) on mismatch.
  • Populates versionString with baseline "01.000.000", zeroes remaining buffer bytes, sets version = 0x01000000, and sets unk_24 = 0.
  • Adds unit tests in core/libs/tests/GuestSystemConfiguration.cpp.
  • Documents baseline assumption in docs/dev/TechnicalDebt.md.

Tested

  • Unit test guest_system_configuration (core/libs/tests/GuestSystemConfiguration.cpp): checks null pointer handling, size validation under/overflow, pre-dirty buffer overwrite, zero padding, and errno preservation.
  • Checked python tools/check_conventions.py --base origin/main (all conventions checks passed).
  • NID Mv1zUObHvXI verified with tools/nid_names.py (compute_nid("sceKernelGetSystemSwVersion")).
  • Python test suite passed: python -m unittest discover tools/tests (52/52 passed).

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 in TechnicalDebt
  • 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: #2902
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4813455724 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2906). Originally posted by [pushkarreddyy](https://github.com/pushkarreddyy) on 2026-10-10T18:22:57Z. --- ### What *ProsperoStore* (`PPSA99000`) stops at startup on `main` (`57f96fd2`) on missing system export `sceKernelGetSystemSwVersion` (NID `Mv1zUObHvXI`) in `libkernel`. In PR #2543 (`kill`, merged as `9a704771`), startup logging verified: `With this PR applied, PPSA99000 moves past kill, next stop = ./app.elf: symbol lookup error: ./app.elf: undefined symbol: Mv1zUObHvXI`. This PR implements `sceKernelGetSystemSwVersion_nid_postfix`: - Declares `struct SceKernelSystemSwVersion` (`size`, `versionString`, `version`, `unk_24`, total size 40 bytes / `0x28`). - Validates null pointer and reports `EFAULT` (`14`). - Validates struct size equals `sizeof(SceKernelSystemSwVersion)` and reports `EINVAL` (`22`) on mismatch. - Populates `versionString` with baseline `"01.000.000"`, zeroes remaining buffer bytes, sets `version = 0x01000000`, and sets `unk_24 = 0`. - Adds unit tests in `core/libs/tests/GuestSystemConfiguration.cpp`. - Documents baseline assumption in `docs/dev/TechnicalDebt.md`. ### Tested - Unit test `guest_system_configuration` (`core/libs/tests/GuestSystemConfiguration.cpp`): checks null pointer handling, size validation under/overflow, pre-dirty buffer overwrite, zero padding, and errno preservation. - Checked `python tools/check_conventions.py --base origin/main` (all conventions checks passed). - NID `Mv1zUObHvXI` verified with `tools/nid_names.py` (`compute_nid("sceKernelGetSystemSwVersion")`). - Python test suite passed: `python -m unittest discover tools/tests` (52/52 passed). ### 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 in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [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: #2902 - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-10 18:32:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-10T18:32:25Z.


Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6100828856 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2906#issuecomment-6100828856). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-10T18:32:25Z. --- Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes.
github-actions[bot] commented 2026-10-10 18:33:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-10T18:33:51Z.


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
#2902 core/libs/tests/GuestSystemConfiguration.cpp L54, L56
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6100841685 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2906#issuecomment-6100841685). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-10T18:33:51Z. --- <!-- 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 | |---|---|---|---| | #2902 | `core/libs/tests/GuestSystemConfiguration.cpp` [L54](https://github.com/boykopovar/AnyPS5/blob/1476f76941a789690fd0f9c84c1cc929bb6fe262/core/libs/tests/GuestSystemConfiguration.cpp#L54), [L56](https://github.com/boykopovar/AnyPS5/blob/1476f76941a789690fd0f9c84c1cc929bb6fe262/core/libs/tests/GuestSystemConfiguration.cpp#L56) | | |
pushkarreddyy commented 2026-10-10 20:06:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by pushkarreddyy on 2026-10-10T20:06:14Z.


Updated error handling to return SCE_KERNEL_ERROR_EFAULT and SCE_KERNEL_ERROR_EINVAL without altering errno, and updated guest unit tests per upstream review on #2945:

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6101665732 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2906#issuecomment-6101665732). Originally posted by [pushkarreddyy](https://github.com/pushkarreddyy) on 2026-10-10T20:06:14Z. --- Updated error handling to return SCE_KERNEL_ERROR_EFAULT and SCE_KERNEL_ERROR_EINVAL without altering errno, and updated guest unit tests per upstream review on #2945: - Commit: https://github.com/pushkarreddyy/AnyPS5/commit/9712ae6e95593b34aabdeaaab8fabaf4b70b1531

Pull request closed

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!2906
No description provided.