Skip to content

feat(libkernel): declare physhm_open and physhm_unlink - #6915

Open
Nixitov wants to merge 1 commit into
boykopovar:mainfrom
Nixitov:feat/physhm
Open

Nixitov wants to merge 1 commit into
boykopovar:mainfrom
Nixitov:feat/physhm

Conversation

@Nixitov

@Nixitov Nixitov commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

What

Declare physhm_open and physhm_unlink in libkernel. Forever Launcher (bizkut/ps5-forever, PPSA99030) stops at physhm_open on current main:

FAIL: unresolved ELF import n371J5cP+uo from libkernel.prx

The PS5 physical shared memory API is not documented, and shadPS4's module generator also declares both with no arguments and returns ORBIS_OK, so the no-argument int signature follows shadPS4 and the console's behaviour is unmeasured. The relinker resolves no call site for either in this title, so both are declared as throwing exports (NotImplemented_nid_no_patch) rather than fabricating a handle, like the declaration-only exports already in this file; recorded in docs/dev/debt/libkernel.md.

Tested

Windows 11, MinGW-w64 GCC 15.2.0 (WinLibs r7), Release.

  • Forever Launcher (bizkut/ps5-forever, PPSA99030, v01.000.006), eboot.bin unwrapped and relinked with the built relinker --windows: on current main it stops at n371J5cP+uo (physhm_open); with this change it passes physhm_open and physhm_unlink and stops at b7uXQmnfB2s (sysarch, libkernel), which this PR does not cover.
  • python tools/check_conventions.py --base origin/main passes.

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: Forever Launcher (bizkut/ps5-forever, PPSA99030) — removes its current start-up stop; it then stops at sysarch
  • GPUs tested: n/a
  • AI-assisted: yes

@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Progress report (134a351 → ce8f328)

📉 System libraries: 91.44% (-0.05%, +2 declared functions)

🆕 2 declared as stubs
Library Name
libkernel physhm_open_nid_postfix
libkernel physhm_unlink_nid_postfix

@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

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 6149 docs/dev/debt/libkernel.md
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 core/libs/prx/libkernel/Unimplemented.cpp
docs/dev/debt/libkernel.md
PR 7039 docs/dev/debt/libkernel.md
PR 7049 docs/dev/debt/libkernel.md
PR 7075 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 7129 docs/dev/debt/libkernel.md
PR 7149 docs/dev/debt/libkernel.md
PR 7192 docs/dev/debt/libkernel.md
PR 7332 docs/dev/debt/libkernel.md
PR 7509 docs/dev/debt/libkernel.md
PR 7565 docs/dev/debt/libkernel.md
PR 7653 docs/dev/debt/libkernel.md

@milescoviello

Copy link
Copy Markdown
Contributor

A Linux check of Forever Launcher (PPSA99030, 01.000.006, catalog build), Ubuntu 24.04, GCC 13.3, Release, main 1b1f848:

AI-assisted: yes

@milescoviello

Copy link
Copy Markdown
Contributor

An update for the current catalog build of Forever Launcher (PPSA99030, 01.000.012), Linux, main bf20538:

One note for whoever merges second: this PR and #6028 both add a declaration at the same place in libkernel/Unimplemented.cpp, so the second one needs a rebase. I'll rebase #6028 if this one goes in first.

AI-assisted: yes (Claude Code)

@babyhuey

babyhuey commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Windows runs of Forever Launcher (PPSA99030, catalog 01.000.012). Windows 11, RTX 3080, WinLibs GCC 15.2, Release, on main e5f18ea99. Plain merges, no conflicts; Unimplemented.cpp merged cleanly. No warnings in Unimplemented.cpp. This PR adds no test, so none was run.

That is the same stop as on Linux: Wine fails to place its shared user data at 0x7ffe0000. A memory trace on Windows shows the guest never asks the emulator for a fixed mapping there: every anonymous map request on this path reaches DoMapAnon with no address and no MAP_FIXED, and each succeeds inside the guest arena. c0000018 is Wine's own result after the page lands elsewhere. (An earlier version of this comment blamed Windows' own KUSER_SHARED_DATA page; the trace doesn't show that.)

AI-assisted: yes

@github-actions github-actions Bot added unblocks title Names a title ID on the Unblocks line needs rebase Conflicts with main, rebase needed labels Oct 18, 2026
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 19, 2026
@milescoviello

Copy link
Copy Markdown
Contributor

@babyhuey thanks for the Windows runs, and sorry for the slow answer. That's the same stop I hit on Linux. On Linux it goes away with #6469 (QRMOE, still a draft), which honours a low mapping hint, so Wine's shared user data lands at 0x7ffe0000.

On main with #6915, #6939, #6787, #7070 and #6469, the next stop is sendmsg with SCM_RIGHTS (#7090). After that, Forever Launcher ran the whole 60 s, 2 of 2, on Linux; NOTE_LOWAT (#7092) and sysarch (#7095) are already in main. It then reaches its own prefix setup and Wine exits with 0xC0000135, because the prefix "must be initialized by payload Wine". On Windows, #7090 still refuses SCM_RIGHTS (control data is not supported on Windows), so that's likely the next stop there after #6469.

AI-assisted: yes (Claude Code)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs libkernel unblocks title Names a title ID on the Unblocks line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants