docs(libkernel): record the text location, unwind info, SoC id and model queries as measured on a PS5 #11253

Merged
orezraey merged 4 commits from upstream-pr/11253 into main 2026-10-27 07:26:54 +00:00
orezraey commented 2026-10-25 22:46:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by orezraey on 2026-10-25T22:46:40Z.


What

This records what a retail PS5 (firmware 13.60) returns for several module and process queries whose debt entries said "unverified" or "unknown". Only docs/dev/debt/libkernel.md and docs/dev/debt/libkernel_sys.md change. A payload process is not a title, so these results are written down as measurements and not copied into the code. Measured with homebrew probes; the sources and console logs are in this gist (ptextloc, psocid).

  • sceKernelGetLibkernelTextLocation.
    • Returned 0 with address 0 and size 0, twice, although libkernel's text segment was at 0x800000000 (size 0x4c000). AnyPS5 returns the main program's first segment, as fpPS4 does.
    • A null address or size faulted; AnyPS5 throws.
    • libkernel.sprx and libkernel_sys.sprx export it at the same address.
  • sceKernelGetModuleInfoForUnwind. The name was empty for libkernel and libSceLibcInternal, where AnyPS5 writes the mapped path. Segment 0 matched each module's first segment. An address inside the payload, which is in no loaded module, returned 0x80020003 (ESRCH) with st_size cleared to 0. AnyPS5 answers for any mapped region. This is a new entry, because changing the unwinder path is risky.
  • sceKernelGetMainSocId, sceKernelGetCpumode, sceKernelGetCpuFrequency.
    • On a CFI-2014 console they returned 0x840f80, 1 and 800000000. AnyPS5 returns 0, 0 and the host TSC frequency.
    • A pointer argument to sceKernelGetMainSocId is ignored, as here.
    • The SoC id may differ between console models, and the CPU mode of a title may differ from a payload's, so neither is copied.
  • sceKernelGetHwModelName, sceKernelIsProspero (new entry; both throw here).
    • sceKernelGetHwModelName(char*) returned 0 and wrote "CFI-2014 A01X" plus a terminator.
    • sceKernelIsProspero() returned 0 on a PS5.
    • The model string belongs to one console, and the buffer size and null behaviour are unknown, so neither is implemented.

Tested

Documentation only. Head 45082e0614 on main 2ba343e731 (main merged in after #9632 landed; its pthread_rwlockattr_settype_np entry and this PR's SoC id entry are both kept). tools/check_conventions.py 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: #9263, #10089, #10179, #10695 and #11224 (mine) (they edit debt entries next to these; merge order only)
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5009479616 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11253). Originally posted by [orezraey](https://github.com/orezraey) on 2026-10-25T22:46:40Z. --- ### What This records what a retail PS5 (firmware 13.60) returns for several module and process queries whose debt entries said "unverified" or "unknown". Only `docs/dev/debt/libkernel.md` and `docs/dev/debt/libkernel_sys.md` change. A payload process is not a title, so these results are written down as measurements and not copied into the code. Measured with homebrew probes; the sources and console logs are in [this gist](https://gist.github.com/orezraey/ed36fbf22dd74d6a5fb12514ebd65236) (`ptextloc`, `psocid`). - **`sceKernelGetLibkernelTextLocation`.** - Returned 0 with address 0 and size 0, twice, although libkernel's text segment was at `0x800000000` (size `0x4c000`). AnyPS5 returns the main program's first segment, as fpPS4 does. - A null address or size faulted; AnyPS5 throws. - libkernel.sprx and libkernel_sys.sprx export it at the same address. - **`sceKernelGetModuleInfoForUnwind`.** The name was empty for libkernel and libSceLibcInternal, where AnyPS5 writes the mapped path. Segment 0 matched each module's first segment. An address inside the payload, which is in no loaded module, returned `0x80020003` (ESRCH) with `st_size` cleared to 0. AnyPS5 answers for any mapped region. This is a new entry, because changing the unwinder path is risky. - **`sceKernelGetMainSocId`, `sceKernelGetCpumode`, `sceKernelGetCpuFrequency`.** - On a CFI-2014 console they returned 0x840f80, 1 and 800000000. AnyPS5 returns 0, 0 and the host TSC frequency. - A pointer argument to `sceKernelGetMainSocId` is ignored, as here. - The SoC id may differ between console models, and the CPU mode of a title may differ from a payload's, so neither is copied. - **`sceKernelGetHwModelName`, `sceKernelIsProspero`** (new entry; both throw here). - `sceKernelGetHwModelName(char*)` returned 0 and wrote "CFI-2014 A01X" plus a terminator. - `sceKernelIsProspero()` returned 0 on a PS5. - The model string belongs to one console, and the buffer size and null behaviour are unknown, so neither is implemented. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Documentation only. Head `45082e0614` on `main` `2ba343e731` (main merged in after #9632 landed; its `pthread_rwlockattr_settype_np` entry and this PR's SoC id entry are both kept). `tools/check_conventions.py` passes. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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 under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [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: #9263, #10089, #10179, #10695 and #11224 (mine) (they edit debt entries next to these; merge order only) - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-25 22:57:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T22:57:03Z.

Review: APPROVED


Reviewed the exact documentation diff and both linked console logs. They support the text-location result, module/unwind behavior and the reported SoC, CPU mode/frequency, model string and Prospero query values; the entries keep title-vs-payload and model-specific unknowns explicit. Diff-check and current-base conventions pass. Documentation-only; no product test run was needed.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5645777509 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11253#pullrequestreview-5645777509). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-25T22:57:03Z. **Review:** APPROVED --- Reviewed the exact documentation diff and both linked console logs. They support the text-location result, module/unwind behavior and the reported SoC, CPU mode/frequency, model string and Prospero query values; the entries keep title-vs-payload and model-specific unknowns explicit. Diff-check and current-base conventions pass. Documentation-only; no product test run was needed.
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!11253
No description provided.