fix(libkernel): report the operation mode the console reports #3944

Merged
hugodearaujo merged 1 commit from upstream-pr/3944 into main 2026-10-12 03:10:44 +00:00
hugodearaujo commented 2026-10-11 19:31:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-10-11T19:31:37Z.


What

sceKernelGetOperationMode reported 0 for both values, which TechnicalDebt listed as unknown. I called the console's export from a homebrew payload on a PS5 (firmware 13.60), with each output followed by a sentinel int:

Console main
mode 2 0
submode 0 0
int after each output untouched untouched
result register 0xab65612e on all three calls, not a status code 0

So the function now writes 2 and 0 and returns nothing. Null outputs still throw: passing them on the console was not tried.

Title: Hollow Knight: Silksong (PPSA12544) zeroes both ints, calls the function (call at 0x16a5889 in eboot.bin), ignores the result and logs sceKernelGetOperationMode mode=%d submode=%d. A submode of 1 sets a flag. The call runs during boot; line 7 of the title's output on main:

sceKernelGetOperationMode mode=0 submode=0

On the console it would read mode=2 submode=0.

The payload is not a title process, and the libkernel code is execute-only on the console, so I could not read where the 2 comes from. The TechnicalDebt entry now gives the measurement and says that a title process reading the same values is unverified.

Tested

  • PS5 firmware 13.60: the table above, three calls.
  • Linux: full CTest 833/833. The new guest_operation_mode checks both values, the untouched neighbours and the null outputs; it aborts on main.
  • Windows Server 2025 VM, WinLibs GCC 15.2, CI configure flags: 834/837, guest_operation_mode passes; guest_kernel_sys, windows_exceptions and guest_filesystem exit with 0xc0000409 the same way on current main in this VM.

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: none
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4821736627 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3944). Originally posted by [hugodearaujo](https://github.com/hugodearaujo) on 2026-10-11T19:31:37Z. --- ### What `sceKernelGetOperationMode` reported 0 for both values, which TechnicalDebt listed as unknown. I called the console's export from a homebrew payload on a PS5 (firmware 13.60), with each output followed by a sentinel int: | | Console | `main` | |---|---|---| | `mode` | **2** | 0 | | `submode` | 0 | 0 | | int after each output | untouched | untouched | | result register | `0xab65612e` on all three calls, not a status code | 0 | So the function now writes 2 and 0 and returns nothing. Null outputs still throw: passing them on the console was not tried. Title: Hollow Knight: Silksong (PPSA12544) zeroes both ints, calls the function (`call` at `0x16a5889` in `eboot.bin`), ignores the result and logs `sceKernelGetOperationMode mode=%d submode=%d`. A submode of 1 sets a flag. The call runs during boot; line 7 of the title's output on `main`: ``` sceKernelGetOperationMode mode=0 submode=0 ``` On the console it would read `mode=2 submode=0`. The payload is not a title process, and the libkernel code is execute-only on the console, so I could not read where the 2 comes from. The TechnicalDebt entry now gives the measurement and says that a title process reading the same values is unverified. ### Tested - PS5 firmware 13.60: the table above, three calls. - Linux: full CTest 833/833. The new `guest_operation_mode` checks both values, the untouched neighbours and the null outputs; it aborts on `main`. - Windows Server 2025 VM, WinLibs GCC 15.2, CI configure flags: 834/837, `guest_operation_mode` passes; `guest_kernel_sys`, `windows_exceptions` and `guest_filesystem` exit with `0xc0000409` the same way on current `main` in this VM. ### 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 - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in TechnicalDebt - [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: none - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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!3944
No description provided.