The loader gives the payload its connection as stdin/stdout/stderr, so
println! output already reaches the terminal running prospero-deploy.
scripts/run.sh (bash /dev/tcp) also forwards the keyboard to stdin and,
unlike prospero-deploy -i, returns as soon as the payload exits.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On 13.60 a thread asleep in a blocking accept() when the console
enters rest powers it off, while one asleep in kevent survives. The
shims wait in kevent first (honouring SO_RCVTIMEO) and then make the
call; non-blocking sockets are untouched. Adds rest_kevent and
rest_recv probes and documents rest mode in the README.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The PS5 kernel lacks clock_nanosleep, and the generic stub returned -1,
so std's sleep hit assert_eq!(r, EINTR). The shim returns the error
number directly and falls back to nanosleep.
Rest-mode probes on 13.60: an idle payload survives frozen; a thread
blocked in accept() during rest powers the console off; sockets polled
without blocking survive but fail with os error 163 after wake.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- ps5-std-rt: faccessat over access, readlinkat over readlink, for
AT_FDCWD or absolute paths; relative to another dir fd stays ENOSYS.
AT_EACCESS tries eaccess (also ENOSYS on the PS5) and only falls back
to access when real and effective ids match; payloads run as uid 1 /
euid 0, so it stays ENOSYS there instead of answering for the wrong user.
- build.rs: faccessat and readlinkat left out of the generated stubs.
- err_probe: success and error cases for both, uid/gid info, symlink
test reported as info when the filesystem has none.
Tested on CFI-1215A, fw 13.60: 0 FAIL. Found: uid 1 euid 0; /data
has no symlinks (EOPNOTSUPP); access and readlink exist, eaccess doesn't.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The SDK libc.a's syscalls.o stubs (mov $N,%rax; syscall; ret) never check
the carry flag, so a failing call returns the errno value as a result:
openat "returned" fd 2 for ENOENT, unlinkat "succeeded". std linked dup,
openat and unlinkat from there.
- ps5-std-rt/build.rs: disassembles the installed SDK's syscalls.o and
generates all 232 stubs (fstatat excluded, it's ours) with the same
numbers plus `jb __ps5_cerror` (errno + -1); any stub with another
shape stops the build. Drops syscalls.o from the patched libc copy,
which no longer needs the fstatat rename.
- std-examples/err_probe: provokes failures (bad fds, missing paths,
refused connect, port in use) via libc and std, port 9960.
Tested on CFI-1215A, fw 13.60: all errors reported as -1 + errno; the
SDK-style stub returns 2. faccessat/readlinkat give ENOSYS from the PS5
kernel itself. fs_probe and https_probe unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- ps5-std-rt/build.rs: copies the installed SDK's libc.a with
llvm-objcopy and bundles it into the rlib: renames the SDK's fstatat
out of the way, and points mktemp.o's stat/lstat at FreeBSD 11 helpers
- ps5-std-rt: fstatat with the FreeBSD 12 struct stat (own syscall: the
SDK stub returns errno as a positive value), __ps5_stat11/__ps5_lstat11,
scandir/alphasort over the shim readdir, fts_* stubs (ENOSYS) so the
SDK's fts never hands FreeBSD 11 structs to Rust
- std target: no-default-libraries + Sony libs in late-link-args, since
prospero-clang put the SDK's -lc ahead of the patched copy
- fs_probe: fstatat (incl. ENOENT), mkstemp, mkdtemp, scandir, fts_open
Tested on CFI-1215A, fw 13.60: fs_probe 0 FAIL, https_probe unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- ps5-std-rt: getrandom() over arc4random_buf (FreeBSD 12+ API the
getrandom crate needs for ring/rustls)
- std-examples: C code in crates builds with prospero-clang/prospero-ar
(CC_/AR_x86_64-sie-ps5-std); ring had silently used the host gcc
- std-examples/https_probe: DNS via std getaddrinfo, HTTPS GET with
rustls + ring + webpki-roots, results on port 9959
Tested on CFI-1215A, fw 13.60: DNS resolves; https://example.com 200 and
https://www.rust-lang.org 301 over TLS 1.3 with verified certificates.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- ps5-std-rt: stat/lstat/fstat call the FreeBSD 11 syscalls (188-190)
and widen struct stat (120 -> 224 bytes)
- ps5-std-rt: own opendir/fdopendir/readdir/closedir/dirfd over the
console's getdirentries, widening each dirent; the buffer is sized
from st_blksize (64 KB on /data, where a fixed 8 KB gave EINVAL),
with bounds checks on every record
- fstatat left unwrapped: it clashes with the SDK libc.a (std doesn't
use it on FreeBSD)
- std-examples/fs_probe: std::fs checks in /data/ps5-rust-fs-test,
results on port 9958
Tested on CFI-1215A, fw 13.60: fs_probe 0 FAIL, scratch dir removed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- targets/x86_64-sie-ps5-std.json: build-std compiles FreeBSD std
against the SDK libc
- crates/ps5-std-rt: bridges the PS5 (FreeBSD 11 + gaps) and Rust's
FreeBSD 12 assumptions: stub link libs, accept4, pthread_setname_np,
dl_iterate_phdr, kevent layout conversion, F_DUPFD_CLOEXEC emulation
- std-examples: hello_std, tokio_server (async server, port 9956),
kq_probe (diagnostics)
- README: std/tokio section; fix the alloc table row that landed above
the title
Tested on CFI-1215A, fw 13.60: hello_std and tokio_server run, /slow
does not block other requests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>