Commit Graph
7963 Commits
Author SHA1 Message Date
David bbd9ee6d2c feat(libkernel_sys): implement SIGEV_NONE POSIX timers 2026-10-21 19:09:14 +01:00
Adrià 8e72738df6 Merge pull request #8437 from xXPBSXx/fix/mprotect-ignore-undefined-bits
fix(libkernel): drop undefined protection bits in mprotect
2026-10-21 20:08:57 +02:00
Superhe11 595dcacdf2 docs(libc): avoid competing debt insertions at the section start 2026-10-21 21:08:18 +03:00
wail-arch 03fae5dfcb fix(relinker): bind SDK guest module imports on Linux
A bundled module that names a console file dependency (.sprx, .suprx,
.debug_prx) imports by symbol name, as homebrew built with the
ps5-payload-dev SDK does. Bind those imports to the NID of the name,
except names another bundled module or the executable exports, and name
the module's host dependencies with the .prx library of the same stem.
2026-10-21 18:06:47 +00:00
Federico Marras 310cb0c4b5 fix(libSceNgs2.native): validate the system option with the module's error codes 2026-10-21 20:06:25 +02:00
SueryandClaude Opus 5.5 7ae3fc8c22 feat(libSceVideoOut): open the display window fullscreen with ANYPS5_FULLSCREEN
A launcher that shows games fullscreen can set ANYPS5_FULLSCREEN instead of
pressing F11 after the window appears. The window opens with
SDL_WINDOW_FULLSCREEN_DESKTOP, the same mode F11 switches to.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017Dqgm9nUKygsXzr6poJsHJ
2026-10-21 14:03:29 -04:00
Adrià FranchandClaude 32f8205390 docs(libkernel): say the receive-after-SHUT_RD answer is Windows only
Co-Authored-By: Claude <[email protected]>
2026-10-21 20:01:26 +02:00
xXPBSXxandClaude Sonnet 5.5 ba8b881fa6 fix(libkernel): answer a receive after SHUT_RD or with no buffer without the host
soreceive_generic returns 0 for a socket whose receive side is shut and for a
zero-length receive on a connected stream socket (ENOTCONN when it is not
connected), without waiting. Winsock fails the first with WSAESHUTDOWN, which
reached the guest as EPIPE, and blocks the second until data arrives. recv and
recvfrom now answer both themselves.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-21 20:01:18 +02:00
Ondra97 7210515acf test(libSceFreeType): separate char-size coverage from pending kerning work 2026-10-21 20:00:49 +02:00
Ondra97 b74f4e24e8 feat(libSceFreeType): implement FT_Set_Char_Size 2026-10-21 20:00:49 +02:00
Adrià 606297f34f Merge pull request #8474 from xXPBSXx/fix/recv-msg-waitall
feat(libkernel): accept MSG_WAITALL in recv, recvfrom and recvmsg on a stream socket
2026-10-21 20:00:45 +02:00
Federico Marras 6978f110ee Merge branch 'fix/ngs2-atrac9-parsed-delay' into feat/ngs2-atrac9-module-loops 2026-10-21 20:00:38 +02:00
Kraken 35c508e9a2 test(libc): isolate feraiseexcept errno from barriers 2026-10-21 18:59:49 +01:00
Adrià 95d17687ae Merge pull request #8267 from thuanquang/fix/amd-robust2
fix(agc): give AMD's proprietary driver robustBufferAccess2 again
2026-10-21 19:59:43 +02:00
HQasperandClaude Opus 5.5 71ce2fe6da feat(libSceLibreSsl3): implement MD5 and SHA1
Both one-shots threw. They run Init, Update and Final through
libSceLibreSsl's MD5_* and SHA1_*, which libSceLibreSsl3 now links,
and return the digest buffer. A null digest buffer throws, since
LibreSSL up to 3.8 hashes into a static buffer and later versions do
not check it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-21 17:50:18 +00:00
HQasperandClaude Opus 5.5 ab4be13c94 feat(libSceLibreSsl): implement the MD4, MD5, SHA-1 and SHA-2 digests
MD4, MD5, SHA1, SHA224, SHA256, SHA384 and SHA512 Init/Update/Final and
the SHA256 one-shot threw. They now hash as LibreSSL does, on the
caller's MD4_CTX, MD5_CTX, SHA_CTX, SHA256_CTX and SHA512_CTX laid out as
in LibreSSL's md4.h, md5.h and sha.h, so a context copied or inspected
by the title stays valid: the bit count in Nl/Nh, the partial block in
data with its length in num, and md_len selecting the truncated digest.
Final pads and clears the buffer as LibreSSL's sources do.

Cases that differ between LibreSSL versions throw: SHA256 with a null
digest buffer and SHA512_Final with the SHA-512/224 or SHA-512/256
length. The test checks the RFC 1320, RFC 1321 and FIPS 180 vectors over
several chunk sizes, the context fields, copied contexts and those
cases.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-21 17:49:47 +00:00
Kraken d324106dc7 docs(libkernel): record cleanup unwind and allocation limits 2026-10-21 18:45:42 +01:00
mossyanwar be51ab7bae fix(relinker): resolve symbol-name imports through NIDs on Linux
Homebrew built with the ps5-payload-dev SDK names its system
libraries with .sprx and imports by symbol name, while the libraries
in libs/ are .prx files that export NIDs. On Linux such an executable
converted but stopped at load time on the first .sprx dependency and,
once that was found, on the first symbol name.

The Linux patcher now loads a dependency named with .sprx, .suprx or
.debug_prx as the .prx library of the same stem. In an executable that
names such a dependency, an import without a module that is named by
symbol gets the NID of that name. A name that a bundled module exports
still binds to that module. There is no lookup by the name as written,
because the host loader also searches the host C library. Other
executables keep their unqualified imports as written.
2026-10-21 18:43:42 +01:00
Superhe11 eecffc924b test(libc): cover snprintf size bounds and formatting side effects 2026-10-21 20:34:41 +03:00
Yossi Yadgar 5cca233e98 docs(debt): record where the libkernel_sys default stack size rule comes from 2026-10-21 20:24:13 +03:00
Dean Galvin 58ad4eda77 fix(libkernel): report app0 symlinks as their target type in getdirentries
On Linux sceKernelGetdirentries copied the host d_type, so a directory under app0 that is a host symlink was listed as a link, and a title that only descends into directory entries skipped it. Inside the app0 tree, report a symlink (or an entry of unknown type) as the type of its target; links elsewhere, and dangling links, stay links.
2026-10-22 06:20:04 +13:00
Dean 4ec064d29b Merge pull request #6887 from Amoenus/codex/test-msaa-reader-retile-main143
test(agc): connect MSAA sample readback to tiled layouts
2026-10-22 06:14:29 +13:00
thuanquangandClaude 01e7d158b6 fix(shader): link a table call whose V# is a slice of an s_load_dwordx8 or s_load_dwordx16
Co-Authored-By: Claude <[email protected]>
2026-10-22 00:13:39 +07:00
David 17650eed5f docs(debt): record that libkernel_sys pselect swaps the mask apart from the wait 2026-10-21 18:06:07 +01:00
ShinMalphur f923ebb200 docs(net): state measured parser compatibility gaps 2026-10-21 23:29:59 +06:30
Kraken 65920e6fdc test(libc): cover CRT exit and TLS cleanup lifecycle 2026-10-21 17:56:28 +01:00
ShinMalphur b1ccca5cf7 Merge branch 'main' into feat/net-ether-address-parser 2026-10-21 23:24:11 +06:30
xXPBSXxandClaude Sonnet 5.5 06ca8ffb7f docs(debt): record the storage image refusal over uncommitted guest memory
StorageTexture throws when none of an image's guest pages is committed.
Three titles reach it intermittently in runs of a few minutes, on AMD and
NVIDIA, and the log names no address. The entry states the gap and that
the console behavior for such a descriptor is not known.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-21 18:53:39 +02:00
MarcZX10 2a12152f2b test(agc): clarify imports after partial unmap 2026-10-21 16:42:05 +00:00
Emanueleandmugurc bfa5368657 fix(libkernel): report unwind information for guest and host addresses on macOS
Two unwind queries a title makes went wrong on macOS, so a C++ exception the title would catch ended the process instead: God of War Sons of Sparta (PPSA28997) stops on an IL2CPP exception it normally handles.

- sceKernelGetModuleInfoForUnwind found a relinked image and its PT_GNU_EH_FRAME header but left eh_frame_addr and eh_frame_size at zero, so the title's unwinder found no FDE for its own frame. The tables are now read with EhFrame::ReadTables over the image's load segments, as ModuleInfo does on Linux, and eh_frame_size includes the zero terminator, as on Linux.
- sceSysmoduleGetModuleInfoForUnwind read /proc/self/maps outside Windows and threw on every call on macOS. It now answers from mach_vm_region, with the image path from dladdr, as the Linux branch answers from the mapping.

guest_unwind_module_info now runs on macOS: the test executable carries the __APS5DATA,__meta program headers that the macOS dl_iterate_phdr reads from a relinked image. guest_sysmodule checks the macOS answers against mach_vm_region.

Co-authored-by: mugurc <[email protected]>
2026-10-21 18:39:48 +02:00
MarcZX10 c443b512c2 docs(agc): describe label trace packet coverage 2026-10-21 16:33:58 +00:00
Nixitov 5aa33fe271 feat(libScePosixForWebKit): export pthread_setname_np
AI-assisted: yes
2026-10-21 18:04:13 +02:00
Nixitov 4bd46aa9ef feat(libSceVideodec2): declare sceVideodec2InitLibrary
AI-assisted: yes
2026-10-21 18:01:44 +02:00
zmeizyandClaude Opus 5.5 059d3f2a16 fix(shader): round v_cvt_pk_u8_f32 in the FLOAT_MODE f32 round mode
v_cvt_pk_u8_f32 rounds its source in the f32 round mode of FLOAT_MODE
and flushes a denormal source when f32 denormals are flushed, as
measured on RDNA2 (gfx1030). It was always rounded to nearest even, so
the three directed modes gave wrong bytes for non-integer sources.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 18:54:57 +03:00
EdouardSenceandClaude Opus 5.5 8c9444b5ae feat(libSceNgs2): process the custom Gain module
A custom submixer rack now accepts the Gain module (0x15). Its voice
parameter 0x40001500 | module index sets one linear level per channel
(37 levels, default 0), and each grain multiplies the voice's samples
by a level that ramps linearly from the previous one to the new one,
following fma-rc's reading of the PS5 12.70 module (#8039). Gain on a
custom sampler rack, whose parameter index is offset, still throws, as
do levels outside -32 to 32.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 17:51:44 +02:00
Kraken c22483ac33 feat(libc): implement feupdateenv 2026-10-21 16:51:00 +01:00
Savvanis SpyrosandClaude Opus 5.5 960863f0e2 feat(relinker): log deferred Windows modules the executable imports from
Since #8162 a --module-dir module that the executable needs is deferred
on Windows: the entry stub maps it and the title starts it with
sceKernelLoadStartModule. A module the executable imports from but the
title never loads gets no module_start and no initializers, silently.

The entry stub now prints one line at startup for each deferred guest
module that an import of the executable names. Guest module bytes are
unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 18:38:23 +03:00
erickerxhalliandClaude Opus 5.5 deeea9d284 feat(libkernel_sys): implement sceKernelGetCompiledSdkVersion
Write the low 32 bits of the SDK version field at offset 0x10 of the
title's process parameters and return EINVAL (0x80020016) for a null
output, following shadPS4.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WYjMwvLdPR8iX8EP8tQYWa
2026-10-21 15:37:11 +00:00
zmeizyandClaude Opus 5.5 959efbb8d3 fix(shader): take the hardware f32 flush only in shaders that flush f32 denormals
When the startup probe chose the hardware f32 flush, every module declared
DenormFlushToZero 32, also shaders whose FLOAT_MODE keeps f32 denormals
(f32 denormal field 1, 2 or 3), so the device flushed what they keep and
DenormPreserve 32 was never declared. The hardware flush now applies to
shaders that flush f32 denormals (field 0, or no float mode); the others
declare DenormPreserve 32 where the device supports it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 18:34:55 +03:00
Yossi Yadgar 3cf57aa463 docs(debt): record the libSceNpManager Plus membership and content restriction calls 2026-10-21 18:33:39 +03:00
Claude 8f13fe70b9 feat(libkernel): implement pthread_rwlock_reltimedrdlock_np and pthread_rwlock_reltimedwrlock_np
Both were missing from libkernel.prx, so a title importing either
(dYv-+If2GPk, RRnSj8h8VR4) failed to load. They take a relative timeout
in microseconds and are scePthreadRwlockTimedrdlock and
scePthreadRwlockTimedwrlock with POSIX error numbers; a zero lock is
initialized as by pthread_rwlock_rdlock. The signature comes from
shadPS4, which registers one function for each NID and its
scePthreadRwlockTimed* twin; FreeBSD 11.4 has no such calls. The throwing
libkernel_sys copies are removed, as an export may live in one library
only. Recorded in the libkernel debt file.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-21 15:27:52 +00:00
slopggobblercobbler81 d28c74af94 feat(libkernel): implement setresuid and setresgid
Follow FreeBSD 11.4 sys_setresuid and sys_setresgid (sys/kern/kern_prot.c):
accept real, effective, and saved user and group IDs for the guest process,
which is assumed to run as root with IDs 0. Setting an ID to 0 or -1 (unchanged)
is accepted without changing credentials and returns 0; any other value throws.
Cover both in guest_credentials test and update libkernel debt documentation.
2026-10-21 17:25:25 +02:00
Felipebmaitan 18213e0f3a feat(libc): implement fegetexcept 2026-10-21 12:24:14 -03:00
Maz 0b411ccee0 docs(architecture): record main-module entry register contracts
Answer #9048 from the host stubs: Linux, Windows and macOS differ, and the console is not measured.
2026-10-21 19:08:57 +04:00
MarcusandClaude Opus 5.5 9e3cac0d89 feat(hw-oracle): run on Windows through the AMD driver's HIP runtime and comgr
tools/hw-oracle needed Linux with ROCm, so Windows measurements went
through private runners. oracle_hip.py assembles and links template.s
kernels with the driver's amd_comgr and dispatches them with its HIP
runtime, with the same rows, padding, dispatch splitting and report as
oracle.c. hw_oracle.py selects it with HW_ORACLE_RUNTIME, by default on
Windows, and loads it in-process so the DLLs are loaded once per run.

The driver's comgr 2.9 numbers its assemble and link actions 0x8 and
0x7, not 0xA and 0x9, so each step tries both and keeps the one that
returns exactly one output of the expected kind.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 11:07:06 -04:00
Yossi Yadgar a4e9e7ce20 docs(debt): record the retail answers of libSceGnmDriverForNeoMode 2026-10-21 18:05:43 +03:00
NikoandClaude Opus 5.5 c8ad92f878 feat(libSceLibcInternal): export _err, _warn and _getprogname
The PS5 3.20 export inventory lists _err, _warn and _getprogname in
libSceLibcInternal next to err, warn and getprogname, with the NIDs
UhKI6z9WWuo, XQFE8Y58WZM and iI6kGxgXzcU. In FreeBSD 11.4 libc the
underscore names are the definitions and the public names are weak
references to them (lib/libc/gen/err.c, lib/libc/gen/getprogname.c),
and libthr interposes none of them, so each pair is one function.

_err and _warn now hand their arguments to verr and vwarn, which use
errno at the call as err and warn do; _getprogname returns
getprogname(). The debt file records that the console's module was not
read.

guest_err checks the _warn and _err text for errno 13 with a formatted
message, that _err passes its status to the err_set_exit hook, and that
_warn without a format returns without calling the hook.
guest_program_name checks that _getprogname returns the current
__progname pointer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 17:02:54 +02:00
NikoandClaude Opus 5.5 0ac2b0bc6f feat(libkernel): export the underscore entry points of the socket, directory and signal calls
The PS5 libkernel exports _accept, _bind, _connect, _getdirentries,
_getpeername, _getsockname, _getsockopt, _listen, _recvfrom, _recvmsg,
_sendmsg, _sendto, _setsockopt, _sigaction and _sigsuspend (PS5 3.20
export list, DNNDHH/PS5-3.20_Libs b2a77c0 libkernel.c), and main
exports none of them, so a title importing one fails at startup. Each
now forwards to the export without the underscore, as _close, _ioctl
and _nanosleep already do.

In FreeBSD 11.4 (8c639945a4) these are libc's plain system call
entries: lib/libc/amd64/SYS.h makes bind, getdirentries, getpeername,
getsockname, getsockopt, listen and setsockopt one stub under both
names, and lib/libc/sys/Makefile.inc gives accept, connect, recvfrom,
recvmsg, sendmsg, sendto, sigaction and sigsuspend a separate public
name that goes through libthr's interposing table, which adds the
cancellation points and the sigaction wrapper. The exports without the
underscore have no libthr layer here, so forwarding gives the system
call. docs/dev/debt/libkernel.md records what stays unverified: the
console is not measured, _sigaction shares the handler table of
sigaction, and a null set throws in _sigsuspend as in sigsuspend,
where FreeBSD's system call returns EFAULT.

guest_underscore_entries calls every new export: a loopback TCP
connection, UDP datagrams with scatter, truncation and sender
addresses, a directory listing compared with getdirentries, a SIGTERM
handler set by _sigaction, and a pending SIGUSR1 that _sigsuspend
delivers before returning EINTR with the mask restored. It checks the
errors they pass on (EBADF, EINVAL, EFAULT, ENOPROTOOPT, EOPNOTSUPP)
and that outputs stay untouched on failure.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 17:02:54 +02:00
SimoneandClaude Opus 5.5 b53ca6243d feat(libSceNpParty): report no party from the remaining signed exports
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 16:59:49 +02:00
simnJS 66f467e406 feat(libSceUsbd): pass configuration and descriptor queries through to libusb 2026-10-21 16:57:03 +02:00