Commit Graph
96 Commits
Author SHA1 Message Date
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
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à d7fd416992 Merge pull request #11231 from Gruzzberry/feat/kldsym
feat(libkernel_sys): implement kldsym argument checks
2026-10-28 08:56:23 +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
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
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
orezraeyandClaude Opus 5.5 8820aa309f Merge main into docs/libkernel-module-process-info-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 02:49:54 -03: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
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
p3nicillinandClaude Opus 5.5 563844efe0 feat(libkernel_sys): implement sceKernelGetCpumodeGame and sceKernelSetCpumodeGame
ProsperoEden declares the setter with the mode as its argument and the
getter with an int output, and measured on a PS5 that modes 0 and 1 are
accepted, 2 to 7 return 0x80020016 and 1 is the default. Both threw as
discovered stubs. Other modes and a null output throw.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 00:44:24 +00:00
orezraeyandClaude Opus 5.5 ed019e3e73 Merge main into docs/libkernel-module-process-info-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-26 19:11:32 -03:00
Alvaro 0f2a263a20 docs(libkernel_sys): narrow the linkat symbolic link debt to Windows 2026-10-26 23:08:33 +01:00
Dean e6b0b00261 Merge pull request #11268 from camezaro-intc/feat/libkernel-sys-kld-queries
feat(libkernel_sys): implement kldfind, kldfirstmod, kldnext and kldunload
2026-10-27 11:06:13 +13:00
Dean 5a2aa03726 Merge pull request #9195 from gazaret/feat/libkernel-sys-uuidgen
feat(libkernel_sys): implement uuidgen
2026-10-27 10:29:18 +13:00
Adrià 071552ef7f Merge pull request #10196 from orezraey/fix/libkernel-sys-pathconf-measured-ps5
fix(libkernel_sys): answer every pathconf name as the console's UFS mount does
2026-10-26 16:58:02 +01:00
orezraeyandClaude Opus 5.5 45082e0614 Merge main into docs/libkernel-module-process-info-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-26 07:25:38 -03:00
Dean 8100e480f7 Merge pull request #11186 from camezaro-intc/feat/libkernel-sys-load-start-sysmodule
feat(libkernel_sys): forward sceKernelLoadStartModuleForSysmodule to sceKernelLoadStartModule
2026-10-26 22:09:58 +13:00
camezaro-intc dcdd9c301e feat(libkernel_sys): implement cpuset, cpuset_getid and cpuset_setid 2026-10-26 00:19:31 -06:00
Nikolay Polukhin a05498c099 feat(libkernel_sys): implement uuidgen
Generate version 1 UUIDs as FreeBSD 11's kern_uuidgen does: consecutive
timestamps from the guest CLOCK_REALTIME, a 14-bit clock sequence that is
randomised on first use and incremented when the clock has not passed the
last batch, and a random multicast node. A count outside 1 to 2048 fails
with EINVAL and a null store with EFAULT.
2026-10-26 11:10:39 +05:00
camezaro-intc d4200caffc feat(libkernel_sys): implement kldfind, kldfirstmod, kldnext and kldunload 2026-10-25 23:58:13 -06:00
Dean e5759e7ee6 Merge pull request #10524 from YossiYad/feat/kernel-sys-console-identity
feat(libkernel_sys): implement sceKernelIsCEX, sceKernelIsDevKit, get_authinfo and sceKernelGetOpenPsIdForSystem
2026-10-26 17:37:52 +13:00
orezraeyandClaude Opus 5.5 f940729f00 docs(libkernel): record the text location, unwind info, SoC id and model queries as measured on a PS5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 19:44:11 -03:00
camezaro-intc 1257830a26 feat(libkernel_sys): forward sceKernelLoadStartModuleForSysmodule to sceKernelLoadStartModule 2026-10-25 14:56:34 -06:00
Adrià aeff26bd97 Merge pull request #9573 from zaryabzip/feat/pthread-create-suspended
feat(libkernel_sys): create threads suspended and resume them
2026-10-25 20:21:07 +01:00
zaryabzip 0b60e97834 feat(libkernel_sys): create threads suspended and resume them
Implement pthread_attr_setcreatesuspend_np, pthread_resume_np,
pthread_resume_all_np and pthread_multi_np with the sce forms
scePthreadAttrSetcreatesuspend, scePthreadResume, scePthreadResumeAll
and scePthreadMulti, following FreeBSD 11.4 libthr and the firmware
13.42 libkernel_sys module. A thread created suspended waits before its
start routine, outside any cancellation point, until it is resumed.
sceKernelRaiseException throws on Windows for a thread still suspended
at creation.
2026-10-25 21:51:02 +05:00
Yossi Yadgar 866ab27a80 docs(debt): clarify unverified console identity behavior 2026-10-25 13:11:03 +02:00
Yossi Yadgar 803601ffa4 fix(libkernel_sys): publish identity types and reject null system IDs 2026-10-25 13:08:55 +02:00
Yossi Yadgar 0d851dd1f3 docs(debt): note the retail console identity in libkernel_sys 2026-10-25 13:06:28 +02:00
Dean 61fc572cee Merge pull request #10434 from Retr0G28/fix/linkat-directory-descriptor
fix(libkernel_sys): resolve linkat paths relative to a directory descriptor
2026-10-25 19:16:10 +13:00
Yunus Shaikh fe9d31edae test(libkernel_sys): pin the AMM writers' narrowing of a wide type
The map, map direct and mtype-protect writers take type as a 64-bit
value and store it in the record's 32-bit field. That matches
sceKernelWriteModifyMtypeProtectCommand and the libSceAmpr siblings,
whose type is 32 bits, but nothing checked it. A type with bit 32 set
now has to record the same bytes as the sibling given the low 32 bits,
and the debt entry says the console's handling of such a type is not
measured.
2026-10-24 19:49:48 -07:00
Yunus Shaikh afd5c4a20e feat(libkernel_sys): wait for AMM command buffer completion
sceKernelWaitCommandBufferCompletion waits for an AMM submission as
libSceAmpr's sceAmprAmmWaitCommandBufferCompletion does: 0 once the
submission has run, SCE_KERNEL_ERROR_ESRCH for an id that was never
submitted. The signature follows ampr_emu's libkernel hook targets,
where the libSceAmpr wait forwards to it.

guest_kernel_sys submits a map written by sceKernelWriteMapCommand,
waits for it and uses the mapped page, and checks ids 0 and past the
last submission.
2026-10-25 00:09:03 +00:00
Yunus Shaikh 92f7271cc6 feat(libkernel_sys): write the AMM map, unmap, remap and protection commands
The twelve AMM kernel writers record into a caller buffer the command
their libSceAmpr command buffer sibling appends, built with the shared
encoder: sceKernelWriteMapCommand, sceKernelWriteMapWithGpuMaskIdCommand,
sceKernelWriteMapDirectCommand, sceKernelWriteMapDirectWithGpuMaskIdCommand,
sceKernelWriteUnmapCommand, sceKernelWriteRemapCommand,
sceKernelWriteRemapWithGpuMaskIdCommand, sceKernelWriteMultiMapCommand,
sceKernelWriteMultiMapWithGpuMaskIdCommand,
sceKernelWriteModifyProtectCommand,
sceKernelWriteModifyProtectWithGpuMaskIdCommand and
sceKernelWriteModifyMtypeProtectWithGpuMaskIdCommand.

The signatures follow ampr_emu's libkernel hook targets: the sibling's
arguments as 64-bit values between the destination and the size output.
A null destination only reports the size and a null size output only
writes, as for sceKernelWriteModifyMtypeProtectCommand. Invalid ranges,
offsets and protections return the sibling's SCE_KERNEL_ERROR_EINVAL and
write nothing; protection or mask bits above 32 are rejected too.

guest_kernel_sys compares each writer with its sibling on valid and
invalid arguments, in both modes.
2026-10-25 00:07:53 +00:00
orezraeyandClaude Opus 5.5 88bf509e20 Merge main into fix/libkernel-sys-pathconf-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 20:04:44 -03:00
Dean Galvin b0b291be0b Merge main into feat/libkernel-sys-underscore-openat 2026-10-24 21:42:59 +13:00
Retr0 d44d5685eb fix(libkernel_sys): resolve linkat paths relative to a directory descriptor 2026-10-24 02:58:00 +03:00
Dean c675a415f2 Merge pull request #9103 from HQasper/claude/project-thread-w0s18y-chown
feat(libkernel_sys): implement chown, lchown, fchownat and linkat
2026-10-24 11:56:40 +13:00
orezraeyandClaude Opus 5.5 f32fd62397 Merge main into fix/libkernel-sys-pathconf-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 17:14:25 -03:00
orezraeyandClaude Opus 5.5 9fc8d159bd fix(libkernel_sys): answer every pathconf name as the console's UFS mount does
Measured in a payload process on a PS5 (firmware 13.60) through libkernel_sys.sprx's pathconf: /system_data gives 65536 for the allocation, transfer and hole sizes, 16384 for the transfer alignment, 3 for _PC_ACL_PATH_MAX and 0 for the ACL and MAC flags, and EINVAL for _PC_MAX_CANON, _PC_MAX_INPUT, _PC_VDISABLE and _PC_ASYNC_IO, which used to throw.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 09:37:36 -03:00
xXPBSXxandClaude Sonnet 5.5 fba61c0da0 docs(debt): shorten the pathconf entry under the length limit
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-23 14:01:12 +02:00
xXPBSXxandClaude Sonnet 5.5 01655d7219 fix(libkernel_sys): answer fpathconf for pipes and _PC_ASYNC_IO as FreeBSD does
kern_fpathconf answers _PC_ASYNC_IO with _POSIX_ASYNCHRONOUS_IO (200112) after the descriptor lookup, and a pipe or socket (no vnode) with PIPE_BUF for _PC_PIPE_BUF and EINVAL for every other name. Drop the unused File.hpp include and the duplicate KernelErrors.hpp include.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-23 13:44:46 +02:00
QuentinRemondandClaude Sonnet 5.5 07d3d6447a feat(libkernel_sys): implement fpathconf and _fpathconf
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-23 13:44:43 +02:00
Dean 58ceeb8ed5 Merge pull request #9040 from YossiYad/feat/kernel-sys-workaround-process-type
feat(libkernel_sys): implement sceKernelTitleWorkaroundIsEnabled and sceKernelGetProcessType
2026-10-24 00:33:16 +13:00
Dean 513ca7e558 Merge pull request #9141 from MarrasFederico/feat/kernel-sys-pthread-scope-atfork
feat(libkernel_sys): implement the scePthread scope, atfork and setconcurrency forms
2026-10-23 23:18:24 +13:00
Dean ff191e29d1 Merge pull request #9382 from MarcZX10/codex/libkernel-sys-sched-interval
feat(libkernel_sys): implement sched_rr_get_interval
2026-10-23 22:47:27 +13:00
Dean 1f1acb195e Merge pull request #9322 from zaryabzip/feat/kernel-sys-condattr-getclock
feat(libkernel_sys): implement scePthreadCondattrGetclock
2026-10-23 22:16:46 +13:00
Dean aef58d4674 Merge pull request #9355 from DavidSamir/feat/libkernel-sys-aio
feat(libkernel_sys): implement the POSIX aio calls
2026-10-23 21:28:48 +13:00