feat(libSceSysUtil): send text notifications as firmware 13.42 does #13824

Merged
zaryabzip merged 1 commit from upstream-pr/13824 into main 2026-11-01 01:24:52 +00:00
zaryabzip commented 2026-10-31 08:20:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by zaryabzip on 2026-10-31T08:20:24Z.


What

sceSysUtilSendSystemNotificationWithText(int32_t type, const char* message) no longer throws. It does what @BunnyFl's firmware 13.42 run of the export shows. That run used an emulator with sceKernelSendNotificationRequest stubbed, not a console.

  • It checks nothing itself and builds a 0xc30-byte request: kind 5 in the first dword, type at +0xc, and the message at +0x2d, cut to 179 characters (strncpy_s(dst, 0xb4, message, 0xb3) in the firmware). A null message leaves the text empty.
  • It returns what sceKernelSendNotificationRequest(0, request, 0xc30, 0) returns.

This replaces #9081 by @shanu337, who handed it over. It follows @oneandonlydean's outline there. Because the call sends a real request, it isn't a silent stub.

sceKernelSendNotificationRequest on main refused any request whose first dword isn't 0, so it would have refused this one. It now prints kind 5 requests to the host's standard error, as it already did for kind 0. Its other refusals are unchanged. The run shows that firmware 13.42's libkernel only writes the request to the notification device and returns the write's result, so the new libkernel debt entry says those refusals are this library's own. The new SysUtil entry records the run and that what the console shows for each type is unknown. libSceSysUtil goes from 0 to 1 of 24.

The new GuestSysUtilNotification.cpp redirects stderr to a file, as GuestFilesystem.cpp does for sceKernelDebugOutText. It sends "hello" with type 7, a null message with type -1, and a 300-character message. It checks that each returns 0 and that the output is exactly the three texts, the last cut to 179 characters. The export is already declared with these parameters on main, so the test builds there and aborts at the first call.

Tested

Windows 11 (WinLibs MinGW-w64 GCC 15.2.0 UCRT r7, CMake 4.3.1, Ninja 1.13.2) and Ubuntu 24.04 on WSL2 (GCC 13.3.0, CMake 3.28.3, Ninja 1.11.1), both with the head 520a8249a3 merged into main e8c25dd3ba.

  • No warnings in the two changed sources or the new test.
  • ctest -R "guest_sys_util_notification|guest_filesystem$": 2 of 2 pass on both hosts, and guest_sys_util_notification passes 3 of 3 on --repeat until-fail:3. On Windows the capture works without a skip: _dup2 onto fd 2 also redirects the handle libkernel writes to.
  • Baseline: on that main with only the new test and its CMakeLists.txt block, the test builds and then aborts with sceSysUtilSendSystemNotificationWithText not implemented on both hosts (Windows exit 0xc0000409, Linux SIGABRT).
  • The patched libSceSysUtil.prx still exports Btgtlzfk9EQ, and now lists libkernel.prx as needed.
  • tools/check_conventions.py passes. tools/pr_overlap.py finds no overlap with mergeable pull requests. 48 that already conflict with main share core/libs/CMakeLists.txt or docs/dev/debt/libkernel.md and couldn't be compared. No open pull request touches either function.

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
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes (Claude Code)
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5095892174 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13824). Originally posted by [zaryabzip](https://github.com/zaryabzip) on 2026-10-31T08:20:24Z. --- ### What `sceSysUtilSendSystemNotificationWithText(int32_t type, const char* message)` no longer throws. It does what @BunnyFl's [firmware 13.42 run](https://github.com/boykopovar/AnyPS5/pull/9081#issuecomment-6418015178) of the export shows. That run used an emulator with `sceKernelSendNotificationRequest` stubbed, not a console. - It checks nothing itself and builds a 0xc30-byte request: kind 5 in the first dword, `type` at +0xc, and the message at +0x2d, cut to 179 characters (`strncpy_s(dst, 0xb4, message, 0xb3)` in the firmware). A null message leaves the text empty. - It returns what `sceKernelSendNotificationRequest(0, request, 0xc30, 0)` returns. This replaces #9081 by @shanu337, who [handed it over](https://github.com/boykopovar/AnyPS5/pull/9081#issuecomment-6540924275). It follows @oneandonlydean's [outline](https://github.com/boykopovar/AnyPS5/pull/9081#issuecomment-6419670806) there. Because the call sends a real request, it isn't a silent stub. `sceKernelSendNotificationRequest` on `main` refused any request whose first dword isn't 0, so it would have refused this one. It now prints kind 5 requests to the host's standard error, as it already did for kind 0. Its other refusals are unchanged. The run shows that firmware 13.42's libkernel only writes the request to the notification device and returns the write's result, so the new libkernel debt entry says those refusals are this library's own. The new SysUtil entry records the run and that what the console shows for each `type` is unknown. libSceSysUtil goes from 0 to 1 of 24. The new `GuestSysUtilNotification.cpp` redirects stderr to a file, as `GuestFilesystem.cpp` does for `sceKernelDebugOutText`. It sends `"hello"` with type 7, a null message with type -1, and a 300-character message. It checks that each returns 0 and that the output is exactly the three texts, the last cut to 179 characters. The export is already declared with these parameters on `main`, so the test builds there and aborts at the first call. ### 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. --> Windows 11 (WinLibs MinGW-w64 GCC 15.2.0 UCRT r7, CMake 4.3.1, Ninja 1.13.2) and Ubuntu 24.04 on WSL2 (GCC 13.3.0, CMake 3.28.3, Ninja 1.11.1), both with the head 520a8249a3 merged into `main` e8c25dd3ba. - No warnings in the two changed sources or the new test. - `ctest -R "guest_sys_util_notification|guest_filesystem$"`: 2 of 2 pass on both hosts, and `guest_sys_util_notification` passes 3 of 3 on `--repeat until-fail:3`. On Windows the capture works without a skip: `_dup2` onto fd 2 also redirects the handle libkernel writes to. - Baseline: on that `main` with only the new test and its `CMakeLists.txt` block, the test builds and then aborts with `sceSysUtilSendSystemNotificationWithText not implemented` on both hosts (Windows exit 0xc0000409, Linux SIGABRT). - The patched `libSceSysUtil.prx` still exports `Btgtlzfk9EQ`, and now lists `libkernel.prx` as needed. - `tools/check_conventions.py` passes. `tools/pr_overlap.py` finds no overlap with mergeable pull requests. 48 that already conflict with `main` share `core/libs/CMakeLists.txt` or `docs/dev/debt/libkernel.md` and couldn't be compared. No open pull request touches either function. ### 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: <!-- #PR, or none --> none - [x] Fixes: <!-- issue it closes as Fixes #N, or none --> none - [x] Unblocks: <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> none - [x] GPUs tested: <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> n/a - [x] AI-assisted: <!-- yes / no --> yes (Claude Code)
MarcZX10 commented 2026-10-31 08:23:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T08:23:24Z.

Review: APPROVED


Reviewed — looks good

The wrapper follows the recorded firmware 13.42 request layout and returns the existing kernel send result; the host kernel accepts kind 5 and the test checks null, ordinary, and truncated messages.

What I ran

Reviewed head 520a8249a36bab85d3790a28d21459cb1e4c006f against PR base/current main e8c25dd3baa6e78531d5eee067fec5cbe8af3dcf; the merge preview was clean. Local environment: Linux x86-64, Python 3.11.2; no compiler used. I ran:

python3 tools/pr_precheck.py --pr 13824 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-13824
python3 tools/pr_abi_audit.py --base e8c25dd3baa6e78531d5eee067fec5cbe8af3dcf --head 520a8249a36bab85d3790a28d21459cb1e4c006f --json
gh api repos/boykopovar/AnyPS5/contents/core/libs/CMakeLists.txt?ref=520a8249a36bab85d3790a28d21459cb1e4c006f --jq '.content' | base64 -d | grep -n -E 'guest_sys_util_notification|GuestSysUtilNotification.cpp'

The precheck’s optional helper scripts were absent from its isolated checkout. I ran the workspace ABI audit directly; the exported function has one existing declaration, one definition, and no symbol finding. The test-quality heuristic warned that the new C++ test might be unregistered; the changed CMake block explicitly builds and registers guest_sys_util_notification.

Results

Check Result
Diff and conventions/template Passed
ABI audit Passed; sceSysUtilSendSystemNotificationWithText declaration/definition found, no finding
CMake test registration Confirmed
Current-main merge preview Clean
Author-reported tests Windows 11 and Ubuntu/WSL2 focused CTest passed; main-based negative controls failed at the expected unimplemented-export assertion. Not run locally.
Hosted checks Conventions, intake, labels, report, eligibility, and portability passed; Linux and specialized jobs skipped; Windows build/test was still in progress at review time
Raw output from local checks
All conventions checks passed.
/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-13824/stack/stack-report.md
/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-13824/stack/stack-report.json
status passed
exports [{'name': 'sceSysUtilSendSystemNotificationWithText', 'computed_nid': 'Btgtlzfk9EQ', 'declarations': ['core/libs/prx/libSceSysUtil/include/Api.hpp'], 'definitions': ['core/libs/prx/libSceSysUtil/Export.cpp'], 'explicit_aliases': [], 'version': 'not encoded by these source declarations; not verified'}]
related findings []
944:    add_test_executable(guest_sys_util_notification_tests tests/GuestSysUtilNotification.cpp)
945:    target_include_directories(guest_sys_util_notification_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
946:    target_link_libraries(guest_sys_util_notification_tests PRIVATE libSceSysUtil libkernel libc)
947:    configure_windows_unwind(guest_sys_util_notification_tests)
948:    add_test(NAME guest_sys_util_notification COMMAND guest_sys_util_notification_tests)

Negative control

Assertion Change reported against Result
New notification test reaches the implementation Author reports using main with the new test and CMake block It aborted at the existing unimplemented-export assertion on Windows and Linux; not independently reproduced here.

Findings

Blocking: None found.

Non-blocking: The firmware behavior was observed in an emulator with the kernel send stubbed, not on a physical PS5. The PR records that what the console UI displays for each notification type remains unknown.

Sources

Not verified

I did not compile or run the C++ test, test a physical console, or verify the system UI’s display. The platform runs and baseline controls above are author-reported. The PR head remained 520a8249a36bab85d3790a28d21459cb1e4c006f when I submitted this review.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5721978993 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13824#pullrequestreview-5721978993). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-31T08:23:24Z. **Review:** APPROVED --- # Reviewed — looks good The wrapper follows the recorded firmware 13.42 request layout and returns the existing kernel send result; the host kernel accepts kind 5 and the test checks null, ordinary, and truncated messages. ## What I ran Reviewed head `520a8249a36bab85d3790a28d21459cb1e4c006f` against PR base/current `main` `e8c25dd3baa6e78531d5eee067fec5cbe8af3dcf`; the merge preview was clean. Local environment: Linux x86-64, Python 3.11.2; no compiler used. I ran: ```sh python3 tools/pr_precheck.py --pr 13824 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-13824 python3 tools/pr_abi_audit.py --base e8c25dd3baa6e78531d5eee067fec5cbe8af3dcf --head 520a8249a36bab85d3790a28d21459cb1e4c006f --json gh api repos/boykopovar/AnyPS5/contents/core/libs/CMakeLists.txt?ref=520a8249a36bab85d3790a28d21459cb1e4c006f --jq '.content' | base64 -d | grep -n -E 'guest_sys_util_notification|GuestSysUtilNotification.cpp' ``` The precheck’s optional helper scripts were absent from its isolated checkout. I ran the workspace ABI audit directly; the exported function has one existing declaration, one definition, and no symbol finding. The test-quality heuristic warned that the new C++ test might be unregistered; the changed CMake block explicitly builds and registers `guest_sys_util_notification`. ## Results | Check | Result | |---|---| | Diff and conventions/template | Passed | | ABI audit | Passed; `sceSysUtilSendSystemNotificationWithText` declaration/definition found, no finding | | CMake test registration | Confirmed | | Current-main merge preview | Clean | | Author-reported tests | Windows 11 and Ubuntu/WSL2 focused CTest passed; main-based negative controls failed at the expected unimplemented-export assertion. Not run locally. | | Hosted checks | Conventions, intake, labels, report, eligibility, and portability passed; Linux and specialized jobs skipped; Windows build/test was still in progress at review time | <details><summary>Raw output from local checks</summary> ```text All conventions checks passed. /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-13824/stack/stack-report.md /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-13824/stack/stack-report.json status passed exports [{'name': 'sceSysUtilSendSystemNotificationWithText', 'computed_nid': 'Btgtlzfk9EQ', 'declarations': ['core/libs/prx/libSceSysUtil/include/Api.hpp'], 'definitions': ['core/libs/prx/libSceSysUtil/Export.cpp'], 'explicit_aliases': [], 'version': 'not encoded by these source declarations; not verified'}] related findings [] 944: add_test_executable(guest_sys_util_notification_tests tests/GuestSysUtilNotification.cpp) 945: target_include_directories(guest_sys_util_notification_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) 946: target_link_libraries(guest_sys_util_notification_tests PRIVATE libSceSysUtil libkernel libc) 947: configure_windows_unwind(guest_sys_util_notification_tests) 948: add_test(NAME guest_sys_util_notification COMMAND guest_sys_util_notification_tests) ``` </details> ## Negative control | Assertion | Change reported against | Result | |---|---|---| | New notification test reaches the implementation | Author reports using `main` with the new test and CMake block | It aborted at the existing unimplemented-export assertion on Windows and Linux; not independently reproduced here. | ## Findings **Blocking:** None found. **Non-blocking:** The firmware behavior was observed in an emulator with the kernel send stubbed, not on a physical PS5. The PR records that what the console UI displays for each notification type remains unknown. ## Sources - [SysUtil request construction at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/520a8249a36bab85d3790a28d21459cb1e4c006f/core/libs/prx/libSceSysUtil/Export.cpp) - [Host kernel request validation and output at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/520a8249a36bab85d3790a28d21459cb1e4c006f/core/libs/prx/libkernel/System/src/Notification.cpp) - [Guest regression test and CMake registration](https://github.com/boykopovar/AnyPS5/blob/520a8249a36bab85d3790a28d21459cb1e4c006f/core/libs/tests/GuestSysUtilNotification.cpp), [CMake block](https://github.com/boykopovar/AnyPS5/blob/520a8249a36bab85d3790a28d21459cb1e4c006f/core/libs/CMakeLists.txt) - [Recorded firmware 13.42 emulator observation](https://github.com/boykopovar/AnyPS5/pull/9081#issuecomment-6418015178); [debt note at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/520a8249a36bab85d3790a28d21459cb1e4c006f/docs/dev/debt/libSceSysUtil.md) ## Not verified I did not compile or run the C++ test, test a physical console, or verify the system UI’s display. The platform runs and baseline controls above are author-reported. The PR head remained `520a8249a36bab85d3790a28d21459cb1e4c006f` when I submitted this review.
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!13824
No description provided.