Commit Graph
1116 Commits
Author SHA1 Message Date
Adrià ec709cede3 Merge pull request #12436 from milescoviello/fix/vm-loadavg
fix(libkernel): answer vm.loadavg with the host's load averages
2026-10-30 02:31:30 +01:00
Adrià 365f857609 Merge pull request #12427 from simnJS/feat/kernel-is-neo-mode
feat(libkernel_sys): answer sceKernelIsNeoMode from the param.sfo Neo-mode attribute
2026-10-30 02:30:27 +01:00
Adrià c9f87549ef Merge pull request #12531 from olegon85/test-kernel-apr-prefixed-batch
test(libkernel): cover the prefixed APR batch resolve without sizes
2026-10-30 02:04:17 +01:00
Adrià 28b490ea5c Merge pull request #12296 from JJenkx/windows/kernel-shm-mmap-checks
fix(libkernel): map Windows shared memory with the regular file checks
2026-10-30 02:04:04 +01:00
Adrià f9a8813b11 Merge pull request #12179 from p3n1cillin/claude/kernel-executable-module-handle
feat(libkernel): add sceKernelGetExecutableModuleHandle
2026-10-30 02:01:01 +01:00
Adrià 4725feb152 Merge pull request #11431 from p3n1cillin/claude/pthread-getaffinity-set-size
fix(libkernel): answer pthread_getaffinity_np for the console's 8- and 16-byte sets
2026-10-30 01:20:44 +01:00
Adrià 96613bba67 Merge pull request #12060 from Ragbie/fix/windows-directory-flock
fix(libkernel): lock directories with flock on Windows as FreeBSD does
2026-10-30 01:04:03 +01:00
Adrià 1aff97d3c8 Merge pull request #12093 from dantdmdarealguy/fix/kqueue-windows-snapshot-times
fix(libkernel): read a watched file's times again after its size on Windows
2026-10-29 21:20:39 +01:00
Adrià 43332e5f3b Merge pull request #11865 from ionut27001/fix/libkernel-sched-own-pid
fix(libkernel): sched_getparam reads out-of-range priorities, sched_setparam EPERM outside 256-767, own pid on the main thread
2026-10-29 20:34:52 +01:00
Oleg d0157c7d1b test(libkernel): cover the prefixed APR batch resolve without sizes 2026-10-29 15:09:11 +01:00
Adrià 9036e3c9e4 Merge pull request #12126 from morten-holm/fix/macos-host-stack-above-arena
fix(libkernel): move the macOS main stack out of the guest arena
2026-10-29 14:51:57 +01:00
Adrià cba260828e Merge pull request #11864 from ionut27001/fix/libkernel-get-app-info-layout
fix(libkernel): fill 0x58-byte sceKernelGetAppInfo record, throw for other pids
2026-10-29 14:33:12 +01:00
Adrià efc24518bc Merge pull request #11862 from ionut27001/fix/libkernel-setrlimit-store-limits
fix(libkernel): store setrlimit RLIMIT_CORE soft limit, ignore raised DATA/STACK hard limits
2026-10-29 13:47:57 +01:00
JJenkxandClaude Opus 5.5 dc1d801c4c fix(libkernel): map Windows shared memory with the regular file checks
On Windows, mmap sent a shared memory descriptor straight to the shared
file mapper, skipping the checks and the private path that a regular
file descriptor takes. A private mapping of a named or anonymous object
then failed with EOPNOTSUPP, and a writable shared mapping of a
read-only descriptor failed with EIO instead of EACCES. Shared memory
objects are files on Windows, so they now take the same access checks
and the same private copy as a regular file; only the directory, device
and file-type refusals stay limited to other descriptors.

guest_named_shm_windows_mapping covers shared mappings through two
descriptors, pread and pwrite against them, an offset mapping, a private
mapping, read-only mappings and the mappings after shm_unlink.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 08:47:28 -04:00
p3nicillinandClaude Opus 5.5 7c97d68937 fix(libkernel): throw for every set size the console was not measured with
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 12:18:00 +00:00
p3nicillinandClaude Opus 5.5 615414a7db docs(libkernel): keep the getaffinity entry apart from the cpuset entry
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 12:18:00 +00:00
p3nicillinandClaude Opus 5.5 b4861eb197 fix(libkernel): answer pthread_getaffinity_np for the console's set sizes
PS5_PayloadSDK measured in a title (firmware 12.09) that
pthread_getaffinity_np answers sets of 8 and 16 bytes and returns ERANGE
for 32 bytes or more, so FreeBSD's 32-byte cpuset_t is refused. The call
accepted exactly 32 bytes and refused every other size. Sizes under 8
keep ERANGE; 17 to 31 bytes, between the measured sizes, throw.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 12:18:00 +00:00
p3nicillinandClaude Opus 5.5 4cf7411a46 feat(libkernel): add sceKernelGetExecutableModuleHandle
Return the main program's handle, the first one sceKernelGetModuleList
lists and one sceKernelGetModuleInfo accepts. reSOT (PPSA99023) imports
it from libkernel and passes the handle to sceKernelGetModuleInfo to find
its own code segment; before this its eboot failed to load on the
unresolved import.

The PS5 3.20 export lists have it in libkernel as well as libkernel_sys,
and on Windows a libkernel import never reaches libkernel_sys, so the
throwing libkernel_sys stub moves to libkernel as pselect did.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 12:17:59 +00:00
Adrià 578b8311ac Merge pull request #11267 from kallmek3nny/feat/libkernel-sem-setname
feat(libkernel): implement sem_setname
2026-10-29 11:31:34 +01:00
Adrià 0e5dad41c2 Merge pull request #9575 from DavidSamir/feat/libkernel-kqueue-evclear
feat(libkernel): support EV_CLEAR on a kqueue watched by another kqueue
2026-10-29 11:23:08 +01:00
Adrià c70c75ad13 Merge pull request #9284 from DavidSamir/feat/libkernel-sys-ksem-unnamed
feat(libkernel): implement the unnamed ksem semaphores
2026-10-29 08:48:19 +01:00
Dean e0a11b3fba Merge pull request #9515 from EagleBearerYS/fix/libkernel-getsockopt-net-sockets
fix(libkernel): getsockopt reads options of libSceNet sockets
2026-10-29 18:49:11 +13:00
milescovielloandClaude Opus 5.5 20d8e0c35d docs(libkernel): list a failed getloadavg next to Windows in vm.loadavg's debt entry
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 03:48:30 +00:00
Dean 3a2b919816 Merge pull request #11863 from ionut27001/fix/libkernel-soc-sensor-channels
fix(libkernel): return -49 from sceKernelGetSocSensorTemperature channel 64 as a PS5 payload process does
2026-10-29 12:17:03 +13:00
Dean d775fc5958 Merge pull request #11403 from MarcZX10/marc/fix-libkernel-shm-anon-windows
fix(libkernel): recognize Windows anonymous shared memory descriptors
2026-10-29 11:49:22 +13:00
Dean 319621ba2e Merge pull request #12339 from medazizktata/fix/windows-exec-shared-mapping
fix(libkernel): map shared memory and files executable on Windows
2026-10-29 07:28:16 +13:00
ionut27001 7dc80f7f37 fix(libkernel): fill 0x58-byte sceKernelGetAppInfo record, throw for other pids 2026-10-28 20:16:32 +02:00
Adrià 027989a44a Merge pull request #11858 from jotitadev/fix/macos-poll-hangup-both-directions
fix(libkernel): report POLLHUP on macOS only once both directions of a stream have ended
2026-10-28 18:20:12 +01:00
kenny soloandClaude Opus 5.5 20c9a93999 feat(libkernel): implement sem_setname
Keep a copy of the name with the semaphore and move the export from the libkernel_sys stub into libkernel next to the other sem_* exports.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-28 14:51:17 +01:00
Adrià 5b9e1a8652 Merge pull request #12242 from milescoviello/docs/kernel-debug-raise-exception
docs(libkernel): list sceKernelDebugRaiseException and its release-mode form as silent stubs
2026-10-28 14:47:54 +01:00
Adrià c8fc68ebe5 Merge pull request #12073 from milescoviello/docs/sanitizer-replace-tables
docs(libkernel): note how titles' libc reads the sanitizer replacement tables
2026-10-28 14:47:05 +01:00
Adrià 5ff3328652 Merge pull request #11937 from milescoviello/docs/map-direct-memory-protections
docs(libkernel): note the protections ten titles pass to sceKernelMapDirectMemory
2026-10-28 14:46:49 +01:00
milescovielloandClaude Opus 5.5 ef9c7a06a5 fix(libkernel): answer vm.loadavg with the host's load averages
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 13:11:49 +00:00
simnJS 215192dd37 feat(libkernel_sys): answer sceKernelIsNeoMode from the param.sfo Neo-mode attribute
A title with param.sfo gets bit 23 (0x00800000) of its ATTRIBUTE key,
the PS4 Pro (Neo) mode support flag, and 0 without the key, as shadPS4
answers on a Neo console; sceKernelHasNeoMode and sceKernelIsAuthenticNeo
already report one. A title with param.json still throws: what a PS5
application gets is unknown. The param.sfo parser now reads ATTRIBUTE and
libkernel exposes it to the other libraries.
2026-10-28 14:10:21 +01:00
MarcZX10 436769c634 fix(libkernel): recognize Windows anonymous shared memory descriptors 2026-10-28 13:04:38 +00:00
AdriàandClaude Sonnet 5.5 638996829b docs(libkernel): shorten the kevent on a kqueue debt entry
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-28 13:45:47 +01:00
AdriàandClaude Sonnet 5.5 7cdb7a8780 test(libkernel): shrink the cleared kqueue race, match watched notes by ident, correct the kqueue debt entry
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-28 13:45:37 +01:00
David 4c77b6ab65 feat(libkernel): support EV_CLEAR on a kqueue watched by another kqueue
FreeBSD re-evaluates a kqueue's EVFILT_READ note from kqueue_wakeup,
which runs whenever the watched kqueue queues a note, so an EV_CLEAR
note fires again only after such an activation. The equeue now counts
activations, and the EV_CLEAR note fires when the count moves while
notes are queued.
2026-10-28 13:44:50 +01:00
David 0e693817d8 docs(debt): list the unnamed ksem calls under Functional 2026-10-28 12:57:05 +01:00
David fd6513d6ff refactor(libkernel): move the unnamed ksem calls into libkernel
The PS5 3.20 export lists have ksem_* in libkernel as well as
libkernel_sys, and on Windows a libkernel import never reaches
libkernel_sys, so titles importing them from libkernel did not find
them. Following pipe1os's review on #9284, also: ENOSPC from
ksem_init when no descriptor is left, the SEM_MAX limit of 30 with
ENOSPC, and dup/dup2 from a ksem id throwing as for a kqueue.
2026-10-28 12:57:04 +01:00
dantdmdarealguy a793bd1341 fix(libkernel): read a watched file's times again after its size on Windows
TakeSnapshot read FileBasicInfo and then FileStandardInfo. A truncate or
write landing between the two left a snapshot with the new size and the
old LastWriteTime, and the next poll reported the same size with a newer
LastWriteTime as NOTE_WRITE. guest_kqueue's FileWatch aborts on Windows
when that happens after its ftruncate to 0.

Read FileBasicInfo again after FileStandardInfo and retry until both
reads agree. The window NTFS itself leaves, a truncate's new
LastWriteTime shown before its new size, stays and is listed in the
libkernel debt.
2026-10-28 11:42:55 +01:00
Mohamed Aziz Ktata dbd826bc88 fix(libkernel): map shared memory and files executable on Windows
A guest mmap with PROT_EXEC and MAP_SHARED of a shared-memory object or a regular file threw on Windows. The section is now created from a handle reopened with GENERIC_EXECUTE, as PAGE_EXECUTE_READ or PAGE_EXECUTE_READWRITE, the owner ACE of named objects grants execute with read, and a writable shared mapping of a read-only descriptor fails with EACCES, as FreeBSD 11.4 shm_mmap and vn_mmap do.

Fixes #12337
2026-10-28 11:14:08 +01:00
Dean 846ae118f9 Merge pull request #11861 from ionut27001/fix/libkernel-sysconf-measured-names
fix(libkernel): sysconf answers the names a PS5 payload process answers
2026-10-28 22:52:41 +13:00
Dean bc7cc27e55 Merge pull request #10856 from Felipebmaitan/feat/guest-signal-cancellation
fix(libkernel): avoid cancellation wakeups during thread exit
2026-10-28 22:52:08 +13:00
Dean 4a6693acf8 Merge pull request #12083 from KernelPanicNT/fix/libkernel-mutexattr-setkind-any-kind
fix(libkernel): store any scePthreadMutexattrSetkind kind as firmware 13.42 does
2026-10-28 22:46:46 +13:00
Adrià e52fd8377d Merge pull request #11897 from ionut27001/docs/libkernel-payload-measurements
docs(libkernel): record PS5 results for two libkernel exports
2026-10-28 10:33:32 +01:00
Adrià ab168194d4 Merge pull request #11732 from milescoviello/docs/virtualquery-title-reads
docs(libkernel): note the sceKernelVirtualQuery fields seven titles read
2026-10-28 10:09:05 +01:00
harisibrar1andClaude Opus 5.5 5bb96d08ad docs(libkernel): keep the map protection debt entry under the length limit
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 01:28:34 -04:00
harisibrar1 6413eacf9d Merge remote-tracking branch 'origin/main' into fix/map-undefined-protection-einval
# Conflicts:
#	docs/dev/debt/libkernel.md
2026-10-28 01:28:03 -04:00
milescovielloandClaude Opus 5.5 9a12233a76 docs(libkernel): list sceKernelDebugRaiseException and its release-mode form as silent stubs
Both log their arguments and the caller and return. Note what the
titles' bundled libc.prx passes them and that three of its
sceKernelDebugRaiseException calls are followed by ud2 in every build
checked, so the guest reaches that ud2 here.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 04:25:31 +00:00