Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,46 @@ All notable changes to PS5Droid are documented here. The project follows
its honesty policy (docs/development.md, section 6): nothing in these
notes claims console execution that has not happened.

## [1.0.3] - 2026-10-22

### Added (Android app & APK inspection)

* **Android Binary XML (AXML / AndroidManifest.xml) parser.** Implemented
`parse_binary_axml` in `src/android/image_manager.cpp` to parse string
pools (UTF-8 and UTF-16LE) and XML tree element/attribute chunks. Extracts
real `package_name`, `min_sdk_version`, `target_sdk_version`,
`version_code`, `version_name`, and `activity_count` from binary
`AndroidManifest.xml` files.
* **APK ZIP archive extraction.** Upgraded `inspect_apk` to parse ZIP
headers, extract `AndroidManifest.xml` (with STORE/uncompressed and DEFLATE
decompression support), and populate `ApkInspection` with real package and SDK
metadata.
* **Android system properties (`build.prop`) parser.** Added `parse_build_prop`
to parse Android system configuration files (`ro.build.version.release`,
`ro.build.version.sdk`, `ro.product.model`, `ro.product.brand`,
`ro.build.display.id`).

### Added (Linux ABI surface, +5 syscalls)

The emulated surface grew from 31 to 36 syscalls (79 tracked total):
`uname` (synthesizes Linux x86_64 kernel identity), `prctl` (emulates
`PR_SET_NAME` / `PR_GET_NAME`), `pipe2` (in-process guest unidirectional
pipes), `dup3` (fd duplicate with flags), and `readlink` (host symlink and
`/proc/self/exe` resolution).

### Added (Guest fd table)

* **In-process guest pipe implementation.** Added `create_pipe` and
`PipeFdEntry` in `CompatFdTable` to provide thread-safe unidirectional pipe
buffers, powering `kPipe2` (syscall 293) and epoll readiness monitoring.

### Changed (docs / project)

* Project version bumped to `1.0.3` in `src/version.h`, `CMakeLists.txt`,
and documentation files.
* Updated Linux ABI compatibility matrix counts across README, architecture,
platform constraints docs, and unit tests (`matrix_counts_match_v1_0_3_release`).

## [1.0.2] - 2026-10-22

### Fixed (correctness)
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
cmake_minimum_required(VERSION 3.16)

project(ps5droid
VERSION 1.0.2
VERSION 1.0.3
DESCRIPTION "PS5Droid - native Android runtime research for PS5"
LANGUAGES C CXX)

Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ Waydroid is used as an *architectural reference* only (see
code is imported. Low-level console facts come from the open-source
[ps5-payload-sdk](https://github.com/ps5-payload-dev/sdk) ecosystem.

## Current status (v1.0.2)
## Current status (v1.0.3)

| Area | Status |
|---|---|
| Portable platform layer (memory, threads, fs, IPC) | **Implemented and tested (host)** |
| Linux ABI dispatch experiment (guest fd table with Linux `O_*` flags, readiness-based epoll/eventfd, mmap/brk/futex subset, path-stat family, writev, getrandom) | **Implemented and tested (host)** |
| Compatibility matrix (79 syscalls: 31 emulated / 4 partial / 44 unsupported) | **Implemented and tested (host)** |
| Linux ABI dispatch experiment (guest fd table with Linux `O_*` flags, readiness-based epoll/eventfd, guest pipes, mmap/brk/futex, path-stat family, writev, uname, prctl, getrandom) | **Implemented and tested (host)** |
| Compatibility matrix (79 syscalls: 36 emulated / 4 partial / 39 unsupported) | **Implemented and tested (host)** |
| Capability probes + runtime manager with structured blockers | **Implemented and tested (host)** |
| Android image manifest + SHA-256 + read-only ext4 superblock probe | **Implemented and tested (host)** |
| APK structural inspection (honest: no package name fabricated) | **Implemented and tested (host)** |
| Android image manifest + SHA-256 + read-only ext4 superblock probe + build.prop parser | **Implemented and tested (host)** |
| APK inspection (binary AXML manifest parsing, ZIP entry extraction, package name & SDK levels) | **Implemented and tested (host)** |
| Launcher UI model + 8x8 framebuffer font + shared screen builders | **Implemented and tested (host)** |
| Native PS5 payload (`ps5droid.elf`, video-out + pad + probe/status/matrix/about screens) | **Implemented, NOT tested on console** |
| PS5 PKG packaging | **Not implemented** (ELF-payload path only) |
Expand All @@ -34,7 +34,7 @@ code is imported. Low-level console facts come from the open-source
| Audio output | **Not implemented** (explicitly reported unsupported) |
| Vulkan / GPU-accelerated Android graphics | **Blocked** (no Vulkan driver for homebrew; proprietary AGC/GNM only) |

Build status: host build + 65 unit tests green (gcc and clang, ASan/UBSan
Build status: host build + unit tests green (gcc and clang, ASan/UBSan
clean). The PS5 target is cross-built in CI, using the official
open-source SDK.

Expand All @@ -54,15 +54,15 @@ app/main.cpp (host CLI) app/ps5_main.cpp (PS5 payload)
provenance-documented firmware declarations.
* **compat/** — accepts Linux x86_64 syscall numbers and executes an
honestly classified subset (anonymous memory, clocks, futex wait/wake,
a guest fd table with Linux `O_*` flag values, readiness-based
epoll/eventfd, path stat family, writev, getrandom); everything else
a guest fd table with Linux `O_*` flag values, guest pipes, readiness-based
epoll/eventfd, path stat family, writev, uname, prctl, getrandom); everything else
returns `-ENOSYS` with an explanation. The verified
Linux→FreeBSD number mapping (e.g. mmap 9→477) is data in
`src/compat/linux_abi.h`.
* **android/** — image handling (manifest, SHA-256, ext4 superblock
probe; no mounting is possible on Orbis), the in-process Binder RPC
engine, and the runtime manager whose start attempt always reports
structured, reasoned blockers today.
probe, build.prop parsing; no mounting is possible on Orbis), binary AXML
manifest inspection, the in-process Binder RPC engine, and the runtime manager
whose start attempt always reports structured, reasoned blockers today.
* **ui/** — pad/keyboard-driven launcher model, a framebuffer font, and
the shared screen builders (`ui/screens`) that turn runtime and
matrix data into the exact lines both entry points render.
Expand Down
41 changes: 22 additions & 19 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ src/
├── compat/ Linux ABI experiment (Milestone 3+)
│ ├── linux_abi.h/.cpp syscall constants + tables + verified FreeBSD mapping
│ ├── memory_compat.cpp Linux brk + anonymous MAP_PRIVATE mmap semantics
│ ├── fd_table.h/.cpp guest fd table: Linux O_* flags, lowest-free fds,
│ ├── fd_table.h/.cpp guest fd table: Linux O_* flags, lowest-free fds, guest pipes,
│ │ readiness-based epoll, eventfd (EFD_SEMAPHORE/overflow)
│ ├── syscall_dispatch.cpp Linux syscall number -> emulated op dispatch
│ ├── bionic_loader.cpp x86_64 ELF inspection + auxv/initial-stack builder
│ └── ipc_compat.cpp SPSC ring + Binder-style block allocator
├── android/
│ ├── sha256.cpp FIPS 180-4 (clean-room)
│ ├── image_manager.cpp manifest parsing + ext4 superblock + APK probe
│ ├── image_manager.cpp manifest parsing + ext4 superblock + AXML parser + ZIP + build.prop
│ ├── runtime_manager.cpp capability probes + honest start attempts
│ └── binder/
│ ├── binder_engine.h/.cpp in-process Binder RPC engine (Milestone 5)
Expand Down Expand Up @@ -72,7 +72,8 @@ Build rules enforced by CMake:
+---------------------------+----------------------------------+
| android/runtime_manager | android/image_manager |
| - capability probes | - manifest + ext4 probe |
| - blocker reporting | - sha256 verification |
| - blocker reporting | - AXML + ZIP + build.prop |
| | - sha256 verification |
+---------------------------+----------------------------------+
| compat/syscall_dispatch (Linux ABI experiment) |
| uses compat/memory_compat + platform::Futex |
Expand Down Expand Up @@ -100,21 +101,22 @@ numbers and executes a curated subset:
* `futex` WAIT/WAKE (private) over `platform::Futex` (registry-based,
wake-atomicity mirrors Linux's kernel-side check-and-enqueue);
* a **guest fd table** (`compat::CompatFdTable`) with Linux `O_*` flag
values, lowest-free fd allocation, `dup`/`dup2`, positioned `pread64`
that never moves the shared offset, eventfd counters honoring
`EFD_SEMAPHORE` and the overflow ceiling, and `writev` gather output;
values, lowest-free fd allocation, `dup`/`dup2`/`dup3`, in-process guest pipes (`pipe2`),
positioned `pread64` that never moves the shared offset, eventfd counters
honoring `EFD_SEMAPHORE` and the overflow ceiling, and `writev` gather output;
* **readiness-based epoll**: `epoll_ctl` enforces Linux `EEXIST`/
`ENOENT` semantics and `epoll_wait` reports only entries whose target
fd is currently ready (eventfd counters drive the readiness);
fd is currently ready (eventfd counters and pipes drive readiness);
* the path family `stat`/`newfstatat` (AT_FDCWD only), `access`,
`mkdir`, `unlink`, `getcwd` over host stat/stdio calls;
`mkdir`, `unlink`, `readlink`, `getcwd` over host stat/stdio/symlink calls;
* `uname` and `prctl` (process/thread naming);
* `getrandom` (PARTIAL) from the host `/dev/urandom`;
* `write` to the process streams (fd 1/2);
* `exit_group` flags the context.

Everything else returns `-ENOSYS` with a *stable, explanatory note*
sourced from the syscall table. The matrix (31 emulated / 4 partial /
44 unsupported = 79 tracked at the v1.0.2 release) is data, not prose:
sourced from the syscall table. The matrix (36 emulated / 4 partial /
39 unsupported = 79 tracked at the v1.0.3 release) is data, not prose:
`ps5droid-host --matrix` prints it, tests pin the counts, and the
release documents repeat them.

Expand Down Expand Up @@ -158,29 +160,30 @@ documented in `development.md`; CI cross-builds the ELF on every push.
| Waydroid component | PS5Droid equivalent |
|---|---|
| LXC container manager | none — single-process emulation context |
| loop-mounted ext4 rootfs | read-only image inspection (ext4 probe) |
| loop-mounted ext4 rootfs | read-only image inspection (ext4 probe) + build.prop parser |
| binder/binderfs | in-process Binder RPC engine (Milestone 5) + SPSC ring + block allocator |
| Wayland hwcomposer HAL | direct video-out + bitmap-font UI |
| PulseAudio audio HAL | nothing yet (explicitly unsupported) |
| D-Bus/systemd orchestration | RuntimeManager state machine |
| OTA images + sha256 | ImageManifest + Sha256 (reimplemented) |
| waydroid.prop | ImageManifest properties |
| waydroid.prop | ImageManifest properties / BuildProp |

## 8. Roadmap (from the milestone plan)

1. **M1 done** — host foundation, tests, CI, PS5 build path (ELF-only).
2. **M2 next** — run the same probes on a real console via elfldr and
fill the [ASSUMPTION] items in `platform-constraints.md`.
3. **M3 mostly done (v1.0.2)** — anonymous-memory subset, guest fd
table with Linux flag semantics, readiness-based epoll/eventfd, and
the path-stat family demonstrated end-to-end; remaining: sockets,
signals, directory streams, kqueue-backed poll on Orbis.
3. **M3 mostly done (v1.0.3)** — anonymous-memory subset, guest fd
table with Linux flag semantics, guest pipes (`pipe2`), readiness-based
epoll/eventfd, `uname`, `prctl`, and path-stat family demonstrated end-to-end;
remaining: sockets, signals, directory streams, kqueue-backed poll on Orbis.
4. **M4 done at feasibility level** — bionic ELF inspection + auxv/
initial-stack construction tested on host; full dynamic linker
namespaces remain un-hosted.
5. **M5 done at engine level** — in-process Binder RPC engine
(handles, transactions, block-allocated buffers) tested on host; not
wire-compatible with the kernel protocol and never claiming to be.
6. **M6 done at inspection level** — APK structure probing (ZIP magic,
manifest/DEX/native-lib presence, honest package-name refusal);
launch research waits on M4/M5 runtime evidence.
6. **M6 done at inspection level (v1.0.3)** — APK structure probing (ZIP
extraction, binary AXML AndroidManifest parsing for package name & SDK
levels, DEX/native-lib presence); launch research waits on M4/M5 runtime
evidence.
2 changes: 1 addition & 1 deletion docs/development.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Development Guide

Current release: **v1.0.2** (see `CHANGELOG.md` and `src/version.h`).
Current release: **v1.0.3** (see `CHANGELOG.md` and `src/version.h`).

## 1. Repository layout

Expand Down
14 changes: 7 additions & 7 deletions docs/platform-constraints.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,31 +120,31 @@ Consequences (all encoded in `src/compat/linux_abi.h` and tested in
paths are a known risk. The compat layer returns `-ENOSYS` for the
signal family.

## 6. Linux ABI compatibility matrix (v1.0.2)
## 6. Linux ABI compatibility matrix (v1.0.3)

Authoritative live output: `./build/ps5droid-host --matrix`. Summary of
the 79 tracked syscalls:

* **EMULATED (31)** — real in-process behavior, unit tested:
* **EMULATED (36)** — real in-process behavior, unit tested:
memory (`mmap`, `brk`), clocks (`clock_gettime`, `clock_getres`,
`gettimeofday`, `nanosleep`, `sched_yield`), identity
(`getpid`, `gettid`), the guest fd table family (`read`, `write`,
(`getpid`, `gettid`), system & process (`uname`, `prctl`), the guest fd table family (`read`, `write`,
`writev`, `open`, `openat`, `close`, `lseek`, `pread64`, `fstat`,
`dup`, `dup2`, `epoll_create1`, `epoll_ctl`, `epoll_wait`,
`eventfd2`), the path family (`stat`, `newfstatat`, `access`,
`dup`, `dup2`, `dup3`, `pipe2`, `epoll_create1`, `epoll_ctl`, `epoll_wait`,
`eventfd2`), the path family (`stat`, `newfstatat`, `access`, `readlink`,
`mkdir`, `unlink`, `getcwd`), and `exit_group`
* **PARTIAL (4)** — implemented with documented restrictions:
`munmap` (whole mappings only), `mprotect` (R/W only; PROT_EXEC not
granted), `futex` (WAIT/WAKE + PRIVATE flag only), `getrandom`
(host `/dev/urandom`; pool distinction not modeled)
* **UNSUPPORTED (44)** — return `-ENOSYS` with an explanatory note. The
* **UNSUPPORTED (39)** — return `-ENOSYS` with an explanatory note. The
hard blockers remain `clone/fork/vfork/execve` (no process creation
for payloads), the socket and signal families, and directory streams.

`getpid` returns the emulation-context id and `gettid` the platform
thread id — single-process model, documented in
`src/compat/syscall_dispatch.h`. The counts are pinned by
`tests/test_compat_matrix.cpp` (`matrix_counts_match_v1_0_2_release`)
`tests/test_compat_matrix.cpp` (`matrix_counts_match_v1_0_3_release`)
so docs and code cannot drift silently.

## 7. Filesystem
Expand Down
Loading
Loading