Commit Graph
148 Commits
Author SHA1 Message Date
Adrià 5adefa6f89 Merge pull request #5643 from Amirtheshwaran/feat/libkernel-mincore
feat(libkernel): implement mincore
2026-10-14 16:25:54 +02:00
Adrià 8488fa7274 Merge pull request #5749 from OleksandrS23/feat/macos-file-event
feat(libkernel): EVFILT_VNODE on macOS through the host kqueue
2026-10-14 16:08:18 +02:00
Adrià eb59c7642e Merge pull request #5666 from Kurenaiiiii/feat/libkernel-sigsuspend
feat(libkernel): implement sigsuspend on the pending-signal set
2026-10-14 16:04:55 +02:00
Adrià 1b55ee4ab3 Merge pull request #5610 from Dripl1x/codex/feat-libkernel-fixed-anonymous-mmap
feat(libkernel): support fixed anonymous mmap
2026-10-14 14:52:53 +02:00
Adrià 24f58e534a Merge pull request #5605 from babyhuey/feat/libkernel-soc-power
feat(libkernel): export sceKernelGetSocPowerConsumption
2026-10-14 14:51:36 +02:00
Adrià 4e0cb18d1e Merge pull request #5545 from Nixitov/feat/setpriority
feat(libkernel): implement setpriority
2026-10-14 14:46:16 +02:00
Adrià a628765e58 Merge pull request #5053 from YossiYad/feat/libkernel-mmap-regular-files
feat(libkernel): map regular files with mmap on Linux
2026-10-14 14:41:32 +02:00
Adrià FranchandClaude 2854d51352 fix(libkernel): follow kern_mincore order and report reserved pages as not resident
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-14 14:40:12 +02:00
Amirtheshwaran Navaneethakrishnan 3699eff904 fix(libkernel): round mincore address down as FreeBSD does
Follow FreeBSD 11's sys_mincore by rounding unaligned address down to page boundary rather than returning EINVAL. Update guest memory test and document unmodeled residency/referenced/modified bits in libkernel technical debt.
2026-10-14 14:40:08 +02:00
Amirtheshwaran Navaneethakrishnan 7781eda113 feat(libkernel): implement mincore
Implement mincore (+hFjyohmOU0) in libkernel following FreeBSD 11's sys_mincore (sys/vm/vm_mmap.c). Validate page alignment, return EFAULT for null vector, check range bounds and residency via sceKernelVirtualQuery, and report MINCORE_INCORE (1) for resident pages. Required by Java 25 LAN / DNS (PPSA99869).
2026-10-14 14:40:08 +02:00
Adrià 9a3e2ac4da Merge pull request #5187 from p3n1cillin/claude/getrlimit-nofile
feat(libkernel): report RLIMIT_NOFILE through getrlimit
2026-10-14 14:27:42 +02:00
Adrià aa6b757662 Merge pull request #4725 from akkadbakkad89/feat/kernel-page-table-stats
feat(libkernel): count committed ranges in sceKernelGetPageTableStats
2026-10-14 12:56:24 +02:00
Oleksandr SierovandClaude Opus 5.5 84bb450d48 feat(libkernel): EVFILT_VNODE on macOS through the host kqueue
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 10:48:35 +01:00
Dean 318f237602 Merge pull request #5258 from JAB-dev/perf/unwind-info-cache
perf(libkernel): cache the unwind tables and image name per module on Windows
2026-10-14 22:39:58 +13:00
Dean 1a40d3d81f Merge pull request #5013 from p3n1cillin/claude/select-pipes
feat(libkernel): select on pipes on Windows
2026-10-14 22:39:38 +13:00
Dean Galvin 83a268a867 feat(libkernel): stop at start-up on a host CPU without the PS5's extensions
Titles run natively, so a host CPU without an extension that compiled Zen 2 code uses faults with an illegal instruction deep inside a title (#3719: SHLX, BMI2). libkernel now reads CPUID and XCR0 when it loads on Linux and Windows, logs the host CPU's extensions and throws, naming the CPU and the missing extensions, before any title code runs.
2026-10-14 20:29:57 +13:00
p3nicillinandClaude Opus 5.5 f288daf6fe feat(libkernel): select on pipes on Windows
select now checks pipe descriptors on Windows with the readiness test poll
already uses, so a pipe next to a libSceNet socket no longer throws.
RetroArch (PPSA99169) selects on libmicrohttpd's wake-up pipe beside its
listening socket. guest_select now runs on Windows too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 08:19:48 +01:00
p3nicillinandClaude Opus 5.5 1aaec9728d feat(libkernel): report RLIMIT_NOFILE through getrlimit
XPSemu (PPSA97358) queries RLIMIT_NOFILE at start-up in QEMU's
os_setup_limits and stopped on the unsupported resource. It reports the
descriptor count after which AnyPS5 fails with EMFILE: the C runtime's
8192 low-level descriptors on Windows and the host limit on Linux.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 08:12:33 +01:00
Dean f87799aa3a Merge pull request #5061 from p3n1cillin/claude/getdtablesize
feat(libkernel): add getdtablesize
2026-10-14 19:33:57 +13:00
Kurenaiiiii 1ce5c2c4e1 feat(libkernel): share pause wait loop and _sigprocmask restore in sigsuspend 2026-10-14 11:43:57 +05:30
Kurenaiiiii 38e2db378c docs(libkernel): record sigsuspend 32-signal mask limit 2026-10-14 11:42:20 +05:30
Kurenaiiiii b3d850d077 feat(libkernel): implement sigsuspend on the pending-signal set 2026-10-14 11:42:20 +05:30
Dean ea53213fd4 Merge pull request #4674 from zaydzaari/research/kernel-system-version-size-1342
fix(libkernel): accept measured system version record values
2026-10-14 19:06:34 +13:00
Yossi Yadgar 6b8ddfb5de docs(debt): note regular file mappings of mmap 2026-10-14 09:04:56 +03:00
JAB-devandClaude Sonnet 5.5 19c55dc804 fix(libkernel): drop the unwind cache's freshness check and let a failed forget throw
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 07:41:54 +02:00
akkadbakkad89 975ed1213d feat(libkernel): count committed ranges in sceKernelGetPageTableStats
Charge each recorded protection ranges 2 MiB granules to the gpu
pool when the range has GPU-access protection bits and to the cpu
pool otherwise, so the available counts reflect committed usage
instead of staying at the 2048-entry budget. Follows KytyPS5s
counting model.
2026-10-14 05:14:20 +00:00
Dean ee50655414 Merge pull request #5109 from pushkarreddyy/feat/libkernel-foreign-module-protect
feat(libkernel): support sceKernelMprotect on foreign guest module images on Windows
2026-10-14 17:26:42 +13:00
Dean 718ae1355c Merge pull request #4903 from ErenYeager1836/carry/fstat-guest-socket
fix(libkernel): report socket status from fstat on a guest socket
2026-10-14 17:26:23 +13:00
Dean a14ae8e232 Merge pull request #5186 from p3n1cillin/claude/carry-fioclex
fix(libkernel): handle FIOCLEX and FIONCLEX in ioctl
2026-10-14 16:31:08 +13:00
milescovielloandClaude Opus 5.5 472437a703 fix(libkernel): report socket status from fstat on a guest socket
fstat on a guest socket descriptor passed the guest number to the host,
which has no such descriptor, and threw ("FillFileStat: fstat failed for
fd 268435460"); sceKernelFstat returned EBADF. FreeBSD fills the stat
buffer for a socket through soo_stat (sys/kern/sys_socket.c):

	bzero((caddr_t)ub, sizeof (*ub));
	ub->st_mode = S_IFSOCK;
	...
	if ((sb->sb_state & SBS_CANTRCVMORE) == 0 || sbavail(sb))
		ub->st_mode |= S_IRUSR | S_IRGRP | S_IROTH;
	ub->st_size = sbavail(sb) - sb->sb_ctl;
	...
	if ((sb->sb_state & SBS_CANTSENDMORE) == 0)
		ub->st_mode |= S_IWUSR | S_IWGRP | S_IWOTH;

and pru_sense_null (sys/kern/uipc_socket.c) adds
st_blksize = so->so_snd.sb_hiwat.

fstat and sceKernelFstat now answer a guest socket from the socket
table: S_IFSOCK, the read bits until the receive side is shut down and
drained, the write bits until the send side is shut down, st_size from
the bytes queued and st_blksize from the send buffer size, other fields
zero. shutdown records which side it closed. A closed socket descriptor
returns EBADF. The differences from the console (peer shutdown, the
host's FIONREAD and SO_SNDBUF, socketpair identity) are listed in
TechnicalDebt.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 08:34:16 +05:30
Dean Galvin 46989a7d8a docs(libkernel): keep the memory protection bits entry 2026-10-14 16:00:06 +13:00
pushkarreddyy 516b06f945 feat(libkernel): support sceKernelMprotect on foreign guest module images on Windows 2026-10-14 08:19:25 +05:30
Dean 94f96c8e2c Merge pull request #5255 from Nesyth/fix/libkernel-apr-read-past-eof-v2
fix(libkernel): zero-fill APR reads that reach the end of the file
2026-10-14 15:44:14 +13:00
Dean 9b6555bd47 Merge pull request #4796 from xXPBSXx/feat/socket-options-sol-socket
fix(libkernel): report SO_ERROR and the other SOL_SOCKET options like FreeBSD
2026-10-14 15:37:41 +13:00
Nixitov afc04c73ad feat(libkernel): implement setpriority
PPSA50011 imports setpriority and stops at start-up once getpriority is implemented. Accept PRIO_PROCESS, PRIO_PGRP and PRIO_USER for the guest's own process and fail with ESRCH for any other id and EINVAL for any other which, leaving errno unchanged on success like FreeBSD's libc; the value is not applied, since the guest nice is not the host's scheduling class.
2026-10-14 04:27:54 +02:00
p3nicillinandClaude Opus 5.5 dad29cac43 feat(libkernel): report vm.overcommit through sysctlbyname
The mimalloc in PS5MC (PPSA99420) reads vm.overcommit at start-up and
stopped on the unsupported name. It reports FreeBSD's default, 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 14:44:48 +13:00
Dean dff25dd604 Merge pull request #5098 from p3n1cillin/claude/sysctl-hw-realmem
feat(libkernel): report hw.realmem through sysctl
2026-10-14 14:44:32 +13:00
Dean 8a51486bd2 Merge pull request #5393 from yixx16/fix/libkernel-vnode-windows-delete
fix(libkernel): keep the Windows vnode watch when the watched file is deleted
2026-10-14 14:25:11 +13:00
p3nicillinandClaude Opus 5.5 fe54938490 feat(libkernel): report hw.realmem through sysctl
The dolphin_libretro core of RetroArch (PPSA99169) reads {CTL_HW,
HW_REALMEM} as the machine's memory size and stopped on the unsupported
MIB. It reports the same value as hw.physmem.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 14:23:55 +13:00
Dean fc1e388ed2 Merge pull request #5185 from p3n1cillin/claude/sysconf-clk-tck
feat(libkernel): report _SC_CLK_TCK through sysconf
2026-10-14 14:22:06 +13:00
Dean b16a1a72f3 Merge pull request #4776 from babyhuey/feat/libkernel-sysctl-tsc-freq
feat(libkernel): report machdep.tsc_freq from sysctlbyname
2026-10-14 14:09:31 +13:00
JAB-devandClaude Sonnet 5.5 434e0b9edf fix(libkernel): forget unwind images only when their module is unloaded and read tables outside the lock
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 02:49:16 +02:00
Evgeniy Kazarin 6215101d28 feat(libkernel): support fixed anonymous mmap
Map fixed private anonymous ranges through the existing guest arena. Preserve occupied ranges for MAP_EXCL and use FreeBSD 11.4 errors.

Cover replacement, exclusivity, range validation, rounding, and memory access.
2026-10-14 03:48:36 +03:00
babyhuey 31abd1a2af feat(libkernel): export sceKernelGetSocPowerConsumption 2026-10-13 20:32:24 -04:00
Adelmo Junior 12851ef037 docs: document flexible memory budget behavior 2026-10-13 20:13:14 -03:00
ducloc080202 3cab3c05ec fix(libkernel): use per-descriptor locks for positioned transfers and seeks 2026-10-14 11:18:07 +13:00
p3nicillinandClaude Opus 5.5 9be93156be feat(libkernel): add getdtablesize
VLC (PPSA85300) fails to load on the missing getdtablesize import now that
readdir_r is in. Its only call is in a spawn child that never runs, and the
console's descriptor limit is unknown, so the export throws.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 22:48:54 +01:00
David 1ba0a81820 feat(libkernel): implement getpriority for the guest process
PS5MC (PPSA99420, Kodi 22) imports getpriority (miQ1wVwSexE) from
libkernel.prx, one reference, next to chflags in its import order.
Predicted stop once the imports ahead of it are covered (not a run):

  FAIL: unresolved ELF import miQ1wVwSexE from libkernel.prx

The NID is computed with tools/nid_names.py and matches aerolib.

Follows FreeBSD 11.4 sys/kern/kern_resource.c sys_getpriority
(8c639945a44588f6cfdddfb057bb5aad88735da0) for the only guest process,
taken to run at nice 0 and to lead its own process group (as kill and
setsid already assume): PRIO_PROCESS and PRIO_PGRP with 0 or its pid,
and PRIO_USER with 0 or its uid 0, return 0; other ids give ESRCH and
an unknown which gives EINVAL. getpriority is a bare system call in
FreeBSD's libc (lib/libc/sys/Symbol.map), so errno is left unchanged
on success.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
(cherry picked from commit 63262245d274342b693fda146ae9feca3752b6e3)
2026-10-14 10:23:41 +13:00
Dean cf5f5b53b5 Merge pull request #4379 from MarcZX100/codex/carry-chflags-3632
feat(libkernel): carry chflags implementation
2026-10-14 10:22:02 +13:00
Dean 7d757bbf0a Merge pull request #4383 from pushkarreddyy/feat/libkernel-sigpending-sigsuspend
feat(libkernel): implement sigpending
2026-10-14 10:21:01 +13:00