Skip to content

feat(libkernel): load system libraries from their console paths - #6519

Merged
oneandonlydean merged 2 commits into
boykopovar:mainfrom
Get-fix:ps4/kernel-system-module-path
Oct 21, 2026
Merged

oneandonlydean merged 2 commits into
boykopovar:mainfrom
Get-fix:ps4/kernel-system-module-path

Conversation

@Get-fix

@Get-fix Get-fix commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

What

PS4 programs load system libraries with sceKernelLoadStartModule and their console path. The OpenOrbis piglet sample loads /<sandbox word>/common/lib/libScePigletv2VSH.sprx and libScePrecompiledShaders.sprx, the sandboxed form of /system/common/lib/ that sceKernelGetFsSandboxRandomWord names. AnyPS5 opened that path as a guest file, so the load failed with ENOENT and the sample stopped with:

Module prefix = /gkbHtXc3Wq/common/lib/
Failed to load the Piglet module, err=0x80020002
Module load failed.

A path in /system/common/lib/ or in the sandboxed /<word>/common/lib/ whose file name ends in .sprx now loads the host libs/<name>.prx, as libSceSysmodule does for module IDs. A name with a directory part is not mapped, so such a path cannot leave libs/. Any other path is opened as before. The new line in docs/dev/debt/libkernel.md records that a host library has no module_start, so res is 0, and that other system directories, such as /system/priv/lib, are not mapped. Part of the PS4 homebrew work tracked in #3093.

Overlap with open pull requests that change Module.cpp or docs/dev/debt/libkernel.md, checked with git merge-file against main 03c4cb5e7:

Tested

Windows 11 Pro 26200, WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON, on main 03c4cb5e7:

Not tested on Linux or macOS.

Checklist

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

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 7447 docs/dev/debt/libkernel.md L235

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 core/libs/prx/libkernel/Module/src/Module.cpp
docs/dev/debt/libkernel.md
PR 6044 core/libs/tests/GuestDynamicLoader.cpp
PR 6149 core/libs/prx/libkernel/Module/src/Module.cpp
docs/dev/debt/libkernel.md
PR 6469 docs/dev/debt/libkernel.md
PR 6544 core/libs/tests/GuestDynamicLoader.cpp
PR 6740 docs/dev/debt/libkernel.md
PR 6879 core/libs/prx/libkernel/Module/src/Module.cpp
docs/dev/debt/libkernel.md
PR 6936 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 7121 docs/dev/debt/libkernel.md
PR 7149 docs/dev/debt/libkernel.md
PR 7192 docs/dev/debt/libkernel.md
PR 7201 core/libs/prx/libkernel/Module/src/Module.cpp
PR 7509 docs/dev/debt/libkernel.md
PR 7532 docs/dev/debt/libkernel.md
PR 8520 docs/dev/debt/libkernel.md
PR 8523 docs/dev/debt/libkernel.md
PR 8553 docs/dev/debt/libkernel.md
PR 8658 docs/dev/debt/libkernel.md
PR 8726 docs/dev/debt/libkernel.md

@jotitadev jotitadev 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.

Linux run (Ubuntu 26.04, Intel i7-8700, GCC 15.2, full build, non-GPU tests), head 57dbfcadd merged onto main 44df21632.

  • Builds; guest_dynamic_loader and guest_dynamic_loader_fixed_base pass.
  • With Module.cpp from main and the PR's test, both abort at GuestDynamicLoader.cpp:106 (the /gkbHtXc3Wq/common/lib/<name>.sprx load), so the test protects the change on Linux too.

Non-GPU suite (ctest -E "^agc"): same result as main; only file_writer_binary and file_writer_text fail, and they fail on main too on this machine (Ubuntu 26.04 coreutils).

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

@Get-fix

Get-fix commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the Linux run, @jotitadev, including the check that the test fails at the sandboxed-path load without the change.

About the overlap the bot lists with #6544: I merged #6544 with git merge-file against main 5d9dcc42d, with and without this change. The only conflict is in core/libs/tests/GuestDynamicLoader.cpp, where each pull request adds an independent block of test code at the same place: this one its console-path loads, #6544 its nested prx/*.guest.prx case. Keeping both blocks resolves it. The production changes, Module.cpp here and General.cpp in #6544, do not overlap.

AI-assisted: yes (Claude Code).

🤖 Generated with Claude Code

PS4 programs load system libraries with sceKernelLoadStartModule and
their console path. The OpenOrbis piglet sample loads
/<sandbox word>/common/lib/libScePigletv2VSH.sprx and
libScePrecompiledShaders.sprx, the sandboxed form of
/system/common/lib/ that sceKernelGetFsSandboxRandomWord names. The path
was opened as a guest file and the load failed with ENOENT.

A path in /system/common/lib/ or in the sandboxed /<word>/common/lib/
whose file name ends in .sprx now loads the host libs/<name>.prx, as
libSceSysmodule does for module IDs. Names with a directory part are
not mapped, so such a path cannot leave libs/.
@xXPBSXx

xXPBSXx commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Rebase handoff — this PR conflicts with main only in docs/dev/debt/libkernel.md (two entries appended at the end of the file). I rebased it onto main 892a4f1328: the original commit and its author are unchanged, the only difference is the conflict resolution in the debt file (both entries kept). Nothing in the code or the test was changed.

Windows data (Windows 10 19045, MinGW-w64 GCC 15.2.0, Release): guest_dynamic_loader fails with Module.cpp taken back to main (GuestDynamicLoader.cpp:176, exit code 0xc0000409) and passes with this change, 3 of 3 runs; guest_sysmodule and guest_module_info pass; python tools/check_conventions.py --base upstream/main passes. Not run: Linux, macOS, the piglet sample. The relinker Python tests guest_module_* did not run in my build (relinker binary not built), so they are not covered.

To pick it up:

git fetch https://github.com/xXPBSXx/AnyPS5 fix/system-library-console-paths
git checkout <your branch>
git reset --hard FETCH_HEAD

(fdacba6338 on top of 892a4f1328.) I did not open a second pull request.

AI-assisted (Claude Code).

@oneandonlydean oneandonlydean self-assigned this Oct 21, 2026
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 21, 2026
@oneandonlydean
oneandonlydean merged commit ee67624 into boykopovar:main Oct 21, 2026
10 checks passed
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.

5 participants