Skip to content

feat(libkernel): read param.sfo when param.json is absent - #5993

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
Get-fix:ps4/param-sfo
Oct 18, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
Get-fix:ps4/param-sfo

Conversation

@Get-fix

@Get-fix Get-fix commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

What

PS4 titles and homebrew ship sce_sys/param.sfo instead of param.json. The OpenOrbis graphics, input and pngdec samples stop right after main: Creating a scene with what(): param.json not found. When param.json is absent, the application metadata now reads the title, title ID, download data size and user defined parameters from param.sfo, and /data and /download0 are mounted for it as for param.json. param.json is still preferred when both files exist.

The parser checks the PSF header, the table and entry bounds, string terminators, 32-bit integer entries, repeated keys and a negative download data size, and throws on each. The localized TITLE_00 to TITLE_30 are not selected by the console language; that is recorded in the libkernel debt file.

Part of the PS4 homebrew work tracked in #3093.

Tested

Windows 11 Pro 26200, WinLibs GCC 15.2.0 r7, Release, full build with BUILD_TESTING=ON, on main e442f4c2e:

  • param_sfo_parser (new), guest_app_info, param_json_parser and the download_data_mount_* cases, including the new sfo case: 9/9. guest_app_info checks that param.json wins over param.sfo and that a process with only param.sfo gets its title ID; download_data_mount_sfo starts a process whose run directory has only param.sfo and checks /data, /download0 and the title ID.
  • Each of these makes a test fail: preferring param.sfo; never reading it; not mounting /data or /download0 for it; ignoring integer entries; shifting the user parameters; not checking the entry count or the data length; accepting repeated keys or a negative download data size.
  • OpenOrbis samples with the other changes listed in Relinker rejects PS4 executables: SCE dynamic tables and data in the code segment (two ready branches) + remaining PS4 work #3093 (left out one at a time on main 84b01f9cd, all together on e442f4c2e): graphics, input and pngdec start with their own param.sfo.
  • tools/check_conventions.py --base origin/main passes.

Not tested on Linux.

Checklist

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Oct 14, 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 6658 docs/dev/debt/libkernel.md L210
PR 6936 docs/dev/debt/libkernel.md L210
PR 6977 core/libs/prx/libkernel/AppMetadata/include/ParamSfoParser.hpp
core/libs/prx/libkernel/AppMetadata/src/ParamSfoParser.cpp
core/libs/tests/ParamSfoParser.cpp
PR 7049 docs/dev/debt/libkernel.md L210
PR 7105 docs/dev/debt/libkernel.md L210
PR 7149 docs/dev/debt/libkernel.md L210
PR 7447 docs/dev/debt/libkernel.md L210
PR 7464 docs/dev/debt/libkernel.md L210
PR 7509 docs/dev/debt/libkernel.md L210
PR 7556 docs/dev/debt/libkernel.md L210

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 4972 core/libs/prx/libkernel/CMakeLists.txt
PR 5021 core/libs/prx/libkernel/CMakeLists.txt
docs/dev/debt/libkernel.md
PR 5999 docs/dev/debt/libkernel.md
PR 6044 core/libs/prx/libkernel/CMakeLists.txt
core/libs/tests/GuestAppInfo.cpp
core/libs/tests/GuestDownloadDataMount.cpp
PR 6222 core/libs/prx/libkernel/CMakeLists.txt
docs/dev/debt/libkernel.md
PR 6510 docs/dev/debt/libkernel.md
PR 6534 docs/dev/debt/libkernel.md
PR 6908 core/libs/prx/libkernel/CMakeLists.txt
docs/dev/debt/libkernel.md
PR 7088 docs/dev/debt/libkernel.md
PR 7201 core/libs/prx/libkernel/CMakeLists.txt
PR 7299 core/libs/prx/libkernel/CMakeLists.txt
docs/dev/debt/libkernel.md

This was referenced Oct 14, 2026
@Get-fix

Get-fix commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto main (now Get-fix/AnyPS5@c8d40fc48) for the needs rebase label. main had added a bullet at the end of docs/dev/debt/libkernel.md, where this pull request adds its param.sfo bullet; both are kept. The code is unchanged. The param tests (param_sfo_parser, guest_app_info, param_json_parser, download_data_mount_*) pass on a full build of the rebased branch merged with main 92cdc7b62.

I checked the overlap the bot lists. I fetched each listed pull request and, for every file it shares with this one, merged its change with git merge-file into current main (a5e2a80c6) and into main with this pull request merged. A conflict that appears only in the second case is one this pull request adds.

The bot lists 61 pull requests, with 88 shared files between them. This pull request adds a conflict in two:

The other 59 merge the same with and without this pull request.

AI-assisted: yes (Claude Code). I ran these checks myself on Windows 11.

🤖 Generated with Claude Code

@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Oct 15, 2026
@Get-fix

Get-fix commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto main 03c4cb5e7 (now Get-fix/AnyPS5@91117ec4d) for the needs rebase label. main had added a sceKernelVirtualQuery entry at the end of docs/dev/debt/libkernel.md, where this one adds its param.sfo entry; I kept both. main also added a lock in ensureTitleLoaded, which Git merged around this change's parseParams call; parseParams takes no lock, so the title is loaded once under it. In a build of main 03c4cb5e7 with my other open pull requests, guest_app_info, param_sfo_parser, param_json_parser, param_json_utf8 and the five download_data_mount_* tests pass, the full ctest passes except two tests this change does not touch (agc_driver_gpu_indirect_arguments_misaligned_writer_ahead does not compile with MinGW on main (#6452 fixes it), and prx_thread_local_destructors fails as it did on main 92cdc7b62 on this machine without my changes), and 15 of the 16 OpenOrbis sample programs start (networking was not run).

AI-assisted: yes (Claude Code).

🤖 Generated with Claude Code

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 15, 2026

@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 91117ec4d merged onto main 44df21632.

  • Builds; param_sfo_parser, param_json_parser, param_json_utf8, guest_app_info and the five download_data_mount_* cases (including the new sfo) pass, 9/9.
  • With AppMetadata.cpp from main (parser and tests kept): download_data_mount_sfo and guest_app_info abort; the other seven pass.

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, and for checking that download_data_mount_sfo and guest_app_info fail with main's AppMetadata.cpp.

AI-assisted: yes (Claude Code).

🤖 Generated with Claude Code

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 16, 2026
@adriadam10 adriadam10 self-assigned this Oct 16, 2026
PS4 titles ship sce_sys/param.sfo instead of param.json. When param.json
is absent, the application metadata now reads the title, title ID,
download data size and user defined parameters from param.sfo, and
/data and /download0 are mounted for it as for param.json. param.json
is still preferred when both files exist.
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 17, 2026
@adriadam10
adriadam10 merged commit 50fafac into boykopovar:main Oct 18, 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.

3 participants