Commit Graph
272 Commits
Author SHA1 Message Date
Adrià acf46d4ff8 Merge pull request #12577 from iAbdulrrahman/feat/libkernel-sys-is-ps4-process
feat(libkernel_sys): implement sceKernelIsPs4Process query
2026-10-30 03:03:26 +01:00
Adrià 87d938c650 Merge pull request #12556 from babyhuey/fix/sched-efault
fix(libkernel): return EFAULT from rtprio_thread and sched_rr_get_interval for a bad pointer
2026-10-30 02:32:23 +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à d85a6745c2 Merge pull request #12368 from kyon-eth/feat/kernel-sys-1360-inventory
feat(libkernel_sys): declare 328 missing callable exports
2026-10-30 02:01:59 +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à c8bc4a20d7 Merge pull request #12606 from EagleBearerYS/feat/libkernel-sys-settimeofday
feat(libkernel_sys): implement sceKernelSettimeofday
2026-10-29 21:20:32 +01:00
iAbdulrrahman 2281511a01 feat(libkernel_sys): identify PS4 compatibility process from CUSA title ID prefix 2026-10-29 16:18:34 +01:00
iAbdulrrahman a59bf262a2 feat(libkernel_sys): implement sceKernelIsPs4Process query 2026-10-29 16:18:34 +01:00
Dean 478b5f1a93 Merge pull request #12635 from Lindamea1/feat/libkernel-sys-internal-libc-mutex-init
feat(libkernel_sys): implement scePthreadMutexInitForInternalLibc and scePthreadMutexattrInitForInternalLibc
2026-10-30 02:26:47 +13:00
Dean b6408701c7 Merge pull request #12636 from Lindamea1/feat/libkernel-sys-kldstat
feat(libkernel_sys): implement kldstat
2026-10-30 02:20:06 +13: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à 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
Lindamea1andClaude Opus 5.5 443fea643c feat(libkernel_sys): implement scePthreadMutexInitForInternalLibc and scePthreadMutexattrInitForInternalLibc
Both call libkernel's pthread_mutex_init and pthread_mutexattr_init and
return 0x80020000 | errno on error, as shadPS4 (ce74386) exports them as
ORBIS(posix_pthread_mutex_init) and ORBIS(posix_pthread_mutexattr_init)
and ChonkyStation4 (c101a23) maps them to its POSIX init functions. A
mutex made without attributes is error-checking. FreeBSD 11.4's
malloc-internal _pthread_mutex_init_calloc_cb makes a normal mutex
instead; the gap is recorded in the libkernel_sys debt file.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 23:16:31 +00:00
Lindamea1andClaude Opus 5.5 c85368d0b5 feat(libkernel_sys): implement kldstat
kldstat was a NotImplemented stub. It now follows FreeBSD 11.4's
sys_kldstat (sys/kern/kern_linker.c): only the version field is read
(EFAULT when that fails), and a version other than 1056
(struct kld_file_stat_1) or 2080 (struct kld_file_stat) is EINVAL.
No linker file is listed here, as for kldnext, so every file id then
gets ENOENT and the structure is never written.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 23:16:31 +00:00
Yunus Shaikh 3e5441dd86 feat(libkernel_sys): implement sceKernelSettimeofday 2026-10-28 21:05:36 +00:00
Dean 93909fb801 Merge pull request #10695 from MarcZX10/marc/signatures-libkernel-sys
feat(libkernel_sys): declare eight Discovery stubs with the OpenOrbis signatures
2026-10-29 07:27:07 +13:00
Dean 1847b0bd00 Merge pull request #11754 from iAbdulrrahman/feat/libkernel-sys-console-identity
feat(libkernel_sys): implement genuine console and platform identity queries
2026-10-29 07:23:11 +13:00
babyhuey c565100965 fix(libkernel): return EFAULT from rtprio_thread and sched_rr_get_interval for a bad pointer
rtprio_thread read and wrote the guest rtprio struct in place, and
sched_rr_get_interval wrote the interval in place, so a non-null pointer
into unmapped or read-only memory crashed the host. rtprio_thread now
copies the struct in with GuestCopyIn_nid_no_patch before the thread
lookup for RTP_SET, as FreeBSD's sys_rtprio_thread does, and builds the
RTP_LOOKUP result locally and copies it out with
GuestCopyOut_nid_no_patch. sched_rr_get_interval copies its interval out
the same way. A failed copy returns EFAULT.
2026-10-28 14:15:57 -04: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
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
Kyon facacb4684 fix(libkernel_sys): resolve known NID aliases and document identities 2026-10-28 12:40:14 +00:00
Dean 750cf6cf48 Merge pull request #11595 from alvaroelpob/fix/libkernel-sys-linkat-symlink-itself
fix(libkernel_sys): link a symbolic link itself in linkat without AT_SYMLINK_FOLLOW
2026-10-29 01:32:29 +13:00
Dean d580b1f552 Merge pull request #11441 from p3n1cillin/claude/kernel-cpumode-game
feat(libkernel_sys): implement sceKernelGetCpumodeGame and sceKernelSetCpumodeGame as measured on a PS5
2026-10-29 01:32:11 +13:00
AdriàandClaude Sonnet 5.5 735dd0bdd7 fix(libkernel): declare the unnamed ksem exports once in the public header
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-28 12:58:01 +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
David c2939224e8 feat(libkernel_sys): implement the unnamed ksem semaphores 2026-10-28 12:56:42 +01:00
Kyon d7e647cbc2 Merge remote-tracking branch 'origin/main' into feat/kernel-sys-1360-inventory 2026-10-28 11:14:02 +00:00
Adrià 241649ed7e Merge pull request #11296 from tablefrogpillow/fix/fpathconf-kqueue-shm-eopnotsupp
fix(libkernel_sys): fail fpathconf on a kqueue or shm descriptor with EOPNOTSUPP
2026-10-28 09:41:16 +01:00
Adrià d7fd416992 Merge pull request #11231 from Gruzzberry/feat/kldsym
feat(libkernel_sys): implement kldsym argument checks
2026-10-28 08:56:23 +01:00
AdriàandClaude Sonnet 5.5 f87b6289ac fix(libkernel): export the kqueue descriptor check to libkernel_sys
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-28 08:43:15 +01:00
tablefrogpillowandClaude Opus 4.8 d8dfb7eab4 fix(libkernel_sys): fail fpathconf on a kqueue or shm descriptor with EOPNOTSUPP
_fpathconf_nid_postfix only treated FIFOs and sockets as descriptors without
a vnode, so a kqueue or shm_open descriptor fell through to the UFS constants
(LINK_MAX 32767, NAME_MAX 255, PIPE_BUF 512). FreeBSD 11.4 kern_fpathconf
(kern_descrip.c:1411-1429) answers _PC_ASYNC_IO for every descriptor and
returns EOPNOTSUPP for a no-vnode descriptor that is not a pipe or socket.
Return EOPNOTSUPP for kqueue and shared-memory descriptors.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-10-28 08:43:15 +01:00
GruzzberryandClaude Sonnet 5.5 762a280ee3 feat(libkernel_sys): implement kenv
Follow FreeBSD 11.4 sys_kenv: KENV_GET, KENV_SET, KENV_UNSET and KENV_DUMP over
an in-memory kernel environment of at most 512 variables, with the 128-byte
name and value limits, ENOENT, EINVAL, ENAMETOOLONG and EFAULT.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-28 07:50:01 +01:00
Dean ba8845d2e7 Merge pull request #9442 from Gruzzberry/feat/lchflags
feat(libkernel_sys): implement lchflags
2026-10-28 13:00:19 +13:00
Kyon 69a27e9517 chore(kernel-sys): isolate inventory source registration 2026-10-27 19:15:13 +00:00
Kyon 9df1243c13 chore(kernel-sys): avoid overlapping source-list edits 2026-10-27 19:14:06 +00:00
Kyon a36cdb3d6e feat(kernel-sys): complete unclaimed callable export inventory 2026-10-27 19:12:26 +00:00
Kyon 5b25c2176d feat(libkernel_sys): declare 7 additional exports 2026-10-27 17:06:10 +00:00
Adrià eece5da035 Merge pull request #10838 from EagleBearerYS/feat/libkernel-sys-finish-calls-v2
feat(libkernel_sys): finish sched_setscheduler and sigreturn
2026-10-27 13:20:31 +01:00
MarcZX10 731bf07eb1 fix(libkernel_sys): give the eight Discovery stubs their signatures in the public header
main declares them with empty parameter lists in Api.hpp, which conflict with the definitions.
2026-10-27 08:24:25 +00:00
MarcZX10 6b7ea3acd5 feat(libkernel_sys): declare eight Discovery stubs with the OpenOrbis signatures
They still throw through NotImplemented_nid_no_patch; only the parameter
lists and, for sceKernelLwfsLseek and sceKernelLwfsWrite, the 64-bit return
type change. The only source is the PS4 OpenOrbis libkernel.h.
2026-10-27 08:24:24 +00:00
Adrià 13926067ac Merge pull request #11026 from Gruzzberry/feat/profil
feat(libkernel_sys): implement profil argument checks
2026-10-27 08:18:36 +01:00
GruzzberryandClaude Sonnet 5.5 6b6ec00fad feat(libkernel_sys): implement kldsym argument checks
Follow FreeBSD 11.4's sys_kldsym: EFAULT for an unreadable lookup
structure, EINVAL for a wrong version or command, EFAULT or
ENAMETOOLONG for the symbol name, ENOENT for a negative file id. Any
other lookup throws, as no kernel module is modelled. Adds
GuestCopyIn_nid_no_patch for the checked structure read.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-27 08:01:39 +01:00
iAbdulrrahman c8b4b292a9 feat(libkernel_sys): implement genuine console and platform identity queries 2026-10-27 09:55:24 +03:00
Adrià FranchandClaude Sonnet 5.5 511735840c fix(libkernel_sys): keep the owner check of chown, lchown and fchownat as on main
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-27 06:14:13 +01:00
Yunus Shaikh 8f007d234a feat(libkernel_sys): implement sigreturn
sigreturn applies FreeBSD 11's amd64 sys_sigreturn checks:
- EFAULT for a null context;
- EINVAL for unknown mc_flags, and for rflags bits outside
  PSL_USERCHANGE that differ from the current flags;
- set_fpcontext's FPU format and ownership cases.
It then restores the context through the path setcontext uses, which
now lives in RestoreContext. A non-user %cs and an extended FPU state
still throw.
2026-10-27 06:14:13 +01:00
Yunus Shaikh 51849e7e41 feat(libkernel_sys): implement sched_setscheduler for the calling thread
FreeBSD 11's sys_sched_setscheduler checks: a null parameter is EFAULT,
another process is ESRCH and an unknown policy is EINVAL. Pid 0 sets the
calling thread through scePthreadSetschedparam. Values that call
rejects, and the guest's own pid, whose first thread is not tracked,
still throw.
2026-10-27 06:14:13 +01:00
Yunus Shaikh 788a87cb8e feat(libkernel_sys): fail chown, lchown and fchownat with EPERM for another owner
An owner or group other than the guest's (0) or the unchanged value
returns EPERM after the path lookup, as FreeBSD 11's chown(2) does for
a caller without the superuser privilege. That is the answer #8457
gives for fchown. A lookup error still comes first.
2026-10-27 06:14:13 +01:00
Adrià e3a2b3846d Merge pull request #10741 from camezaro-intc/feat/libkernel-sys-cpuset
feat(libkernel_sys): implement cpuset, cpuset_getid and cpuset_setid
2026-10-27 06:13:49 +01:00
Dean 1075c38f07 Merge pull request #10799 from EagleBearerYS/feat/libkernel-sys-ampr-command-writers
feat(libkernel_sys): write the AMM commands and wait for their completion
2026-10-27 15:00:11 +13:00