Compare commits

..
314 Commits
Author SHA1 Message Date
waozi 0ae2fb7949 Document all-Ziran TaijiOS architecture and research foundation 2026-11-09 11:21:28 -03:00
waozi 2d813c5c7b Repin packages to the rewritten history 2026-10-19 11:51:54 -03:00
waozi d34a55c74f Rename Terminal references for the KryonLabs repository move 2026-10-04 17:53:16 -03:00
waozi 0666f587db Use TaijiOS repositories for Terminal and Rill 2026-10-02 13:11:28 -03:00
waozi 82aecfdb4c Initialize fresh native desktops before staging recovery 2026-10-01 13:14:56 -03:00
waozi 457182ec06 Restore native desktop recovery for interrupted file copies 2026-10-01 12:59:28 -03:00
waozi 76479b6ab5 Restore native desktop Undo and replacement recovery 2026-10-01 11:36:46 -03:00
waozi c5520b44c4 Restore native desktop transfer retry after interruptions 2026-10-01 10:46:23 -03:00
waozi e9f79dd2a9 Restore recoverable native file replacement in the desktop 2026-10-01 02:24:41 -03:00
waozi 3e3f6cde47 Restore native desktop Trash through Ziran and Kryon 2026-10-01 01:50:27 -03:00
waozi dc98d3735c Recover native Rill PNG assets with Ziran and Kryon 2026-09-30 23:48:34 -03:00
waozi 846676accf Integrate verified Ziran folder moves and clipboard transfers 2026-09-30 21:30:21 -03:00
waozi 2410154d13 Integrate verified native Rill file copy and clipboard services 2026-09-30 20:14:51 -03:00
waozi 6355744487 Replace rc document opening with verified native Ziran dispatcher 2026-09-30 19:48:25 -03:00
waozi 36b0d469b7 Integrate Ziran desktop files and native folder operation checks 2026-09-30 17:49:49 -03:00
waozi 4369223493 Integrate restored Ziran Settings and About with native preference locking 2026-09-30 16:35:05 -03:00
waozi 89fbe48778 Integrate the Ziran Kryon desktop and native panel validation 2026-09-30 14:07:44 -03:00
waozi c4d7d7520e Integrate the Ziran clock and calendar with native install checks 2026-09-30 12:16:57 -03:00
waozi 59581bf8c0 Integrate the Ziran Applications menu and native desktop validation 2026-09-30 11:08:16 -03:00
waozi a3e8c59c8a Integrate the Ziran Kryon Run dialog and native rendering checks 2026-09-30 01:34:32 -03:00
waozi 901131292d Integrate Ziran Rill services and PID guarded rio controls 2026-09-29 22:37:07 -03:00
waozi b04454e60b Integrate Ziran Rill persistence and native file gates 2026-09-29 21:21:01 -03:00
waozi 6e74206c74 Integrate the Ziran Rill shell and native Plan 9 gate 2026-09-29 20:45:06 -03:00
waozi f7769fddc3 Update T9 for Ziran selection migration 2026-09-29 14:41:29 -03:00
waozi 1c22b151fa Update T9 for Ziran sixel migration 2026-09-29 14:30:17 -03:00
waozi ea0e690c4b Update T9 for Ziran DCS migration 2026-09-29 14:11:45 -03:00
waozi cc411fcb2d Update T9 profile Ziran migration 2026-09-29 14:00:03 -03:00
waozi 004dee08b1 Update T9 Ziran profile migration 2026-09-29 13:30:31 -03:00
waozi 931f82d445 Update T9 Ziran migration 2026-09-29 12:35:54 -03:00
waozi feb8622b1c Update t9 reflow migration 2026-09-29 11:31:03 -03:00
waozi ca20c70c0f Update t9 render migration 2026-09-29 11:25:21 -03:00
waozi dc7b17ef1f Update t9 session migration 2026-09-29 11:20:34 -03:00
waozi 302041aeeb Update t9 profile color migration 2026-09-29 10:24:51 -03:00
waozi 4378c533a6 Update t9 mouse Ziran migration 2026-09-29 10:16:41 -03:00
waozi 347ec2fdbf Update T9 modes Ziran migration 2026-09-29 01:13:39 -03:00
waozi 1d434fb5f0 Update T9 CSI Ziran migration 2026-09-28 22:15:13 -03:00
waozi 04d98320a7 Update T9 SGR Ziran migration 2026-09-28 21:23:18 -03:00
waozi d489b8b926 Update T9 Ziran text migration 2026-09-28 19:38:33 -03:00
waozi 56e3d061ea Ignore generated Kryon Plan 9 archive 2026-09-28 19:18:14 -03:00
waozi 1b0366d117 Advance Ziran package migration dependencies 2026-09-28 19:17:50 -03:00
waozi d2e7620eaa Move repository links to TaijiOS 2026-09-28 18:25:39 -03:00
waozi cf4dd41e37 Ignore disposable rootfs runtime output 2026-09-28 18:25:39 -03:00
waozi 181cff4436 Update published dependency pointers 2026-09-28 18:24:55 -03:00
waozi e61e6e2ea3 Bump Pass to remove legacy vendored dependencies 2026-09-28 18:23:16 -03:00
waozi 2fa03299f7 Update Pass to Ziran packages 2026-09-28 17:42:34 -03:00
waozi fb41bbbe1c Advance Pass Ziran compatibility core 2026-09-28 11:51:49 -03:00
waozi ebc8c25319 Use the Ziran Pass CLI 2026-09-28 11:14:46 -03:00
waozi 945897f123 Advance Pass Ziran generation 2026-09-28 11:07:09 -03:00
waozi e2f5f0a041 Advance Ziran Pass key derivation 2026-09-28 03:24:48 -03:00
waozi 001c7dd58f Start Pass migration in Ziran 2026-09-28 03:06:07 -03:00
waozi f560c11759 Record native Plan 9 Kryon verification 2026-09-28 02:52:58 -03:00
waozi cf41434459 Verify Kryon native Plan 9 ABI 2026-09-28 02:40:31 -03:00
waozi 7b2f6d0222 Remove stale Plan 9 build artifacts 2026-09-28 01:19:51 -03:00
waozi 032a756f0f Add native Plan 9 Kryon smoke gate 2026-09-28 01:07:54 -03:00
waozi 9db910bd20 Update Kryon to native Plan 9 ABI 2026-09-28 01:05:18 -03:00
waozi 7fac02a35f Boot the graphical profile straight to the desktop, console on serial only
A new *noconscreen= plan9.ini flag keeps putstrn console output off the
display while the serial console stays live, so the GUI profiles boot
from firmware into the rendered Rill desktop with no kernel or rc text
on screen; panics still reach the display. Text-mode boots keep the
screen console. desktop-boot-smoke passes on the rebuilt kernel
(1024x768 rendered-desktop assertion).

The status and windows-plan documents record this revision: trixie
namespace with Wine 10, the linuxrun epoll fix that stopped the X
server spin, and the refined wine rfork reading (thread children
inherit SG_SHARED segments via sameseg; the fault is inside the
rfork-from-note-context itself and still wants the live kernel
debugging round).
2026-09-20 19:29:17 -03:00
waozi 51fd885552 Rebuild linuxrun and xbridge with the epoll and selftest fixes; rename fetch script reference 2026-09-20 19:13:06 -03:00
waozi 3405a6135a debian: restage the namespace from Debian 13 trixie i386
fetch-debian.sh (was fetch-xfce.sh) and fetch-wine.sh take SUITE and
default to trixie: Xvfb/xterm/x11-apps/dash/nano base with the Xfce
remnants dropped, and Wine 10 (wine, wine32, libwine) preinstalled
from trixie i386. Text Editor launches nano in xterm because trixie
no longer ships xedit; the matrix follows. debian_version records the
real suite (13.7) while os-release keeps the TaijiOS identity.
2026-09-20 19:12:29 -03:00
waozi de4ba20794 q9: nice the VM, prep the kryon plan9 codegen in the smoke
QEMU runs under nice -n 19 (Q9_QEMU_NICE= to disable) so development
boots do not compete with real work. The kryon smoke regenerates
kryon's build/plan9 (k2c runtime modules, embedded assets, icon
tables) on the host before booting, raises its timeout for the larger
library build, probes the current theme catalog, and the workflow
initializes utf8proc beside raylib.
2026-09-20 19:12:21 -03:00
waozi 6379003fea xbridge: fail the selftest fast; tolerate one trixie selection flake
The wire selftest now runs under a 30-second alarm so an unanswered
request ends the test instead of hanging the boot, and the unified
smoke retries it once: trixie's Xvfb intermittently drops the
selection dance under churn (traced to the epoll spin, fixed
separately), and one retry separates the residual flake from real
clipboard damage.
2026-09-20 19:12:21 -03:00
waozi 1f16226786 linuxrun: stop reporting EPOLLOUT for sockets that never asked for it
Connected bridge sockets returned EPOLLOUT on every epoll_wait scan
regardless of the registered mask, so any IN-only watch produced a
spurious event per poll. Xorg's main loop woke continuously and the
emulated Xvfb burned a full CPU doing nothing (700+ epoll_wait traces
in a 25-second soak). Report EPOLLOUT only when the registration
includes it; EPOLLIN stays data-driven as the dbus fix requires.
After the change the same soak logs three epoll_wait traces.
2026-09-20 19:12:05 -03:00
waozi c1d166145a Move Taiji Terminal to t9 and update Kryon 2026-09-20 17:15:31 -03:00
waozi 9552ec3806 Point Taiji Terminal at t9 2026-09-20 16:24:53 -03:00
kryonlabs 7144f538ea wine: preloader exec failure is expected Debian behavior, not a gap
Verified against the bookworm wine32 package contents: Debian ships no wine-preloader (only wine, wineapploader, wineserver32), so the probe trace exec failure of wine-preloader followed by the direct wine exec is normal. The frontier remains the round-18 rfork fault.
2026-09-19 16:56:43 -03:00
kryonlabs 02ce3a5e4d wine: the frontier syscall is definitively rfork (19)
Checked against sys/src/libc/9syscall/sys.h: the faulting stub loads RFORK, the clone dispatch own rfork call executed from note-handler context, faulting on a read of the guest stack inside the Stackbase segment. The documented mechanism hypothesis (int80 note state referencing guest sp, child fork-rebuild detaching the stack segment) requires live kernel debugging to confirm and fix.
2026-09-19 16:52:29 -03:00
kryonlabs d05e06f001 linuxrun: guard crash-report stack dumps; name the frontier syscall
The crash-report guest-stack dumps now check guestok first, so the diagnostic itself can no longer mask the underlying fault (verified: the wine probe now dies at the real fault, not in the dump). The faulting native stub decodes to syscall 19 (stat or rfork depending on the table indexing) - a native call receiving a guest stack pointer from a context where the segment is absent; the fork-rebuild copy loop is the documented prime suspect for live debugging. Verified: taiji-linuxrun-smoke-ok, taiji-unified-smoke-ok.
2026-09-19 16:50:54 -03:00
kryonlabs 5dcfe748a9 linuxrun: LOADELF traces name every loaded image and its segments
loadelf now prints (capped) the entry point, program-header count, and every LOAD segment vaddr+memsz for each loaded image, so an exec whose segments target unmapped guest memory is identifiable before it kills the process.  Measured with the wine display probe: every image layout is sane (ld.so at 0x68000000, the X-transport helper at 0x7d000000); the 0xdfff GUESTPTR reads belong to an earlier phase and the final fault at 0x6001d874 is a native-syscall read of a parent-mapped region from a context where the segment is absent - the remaining investigation for a live kernel-debugging session.  Verified: taiji-linuxrun-smoke-ok, taiji-unified-smoke-ok.
2026-09-19 16:15:30 -03:00
kryonlabs bb7d07642b linuxrun: back guest stacks before exec-argument copying
The execve argument copy now backs the argv/env region (and each string) on demand, so Wine execs with stacks in its 0xdfff reservation area no longer read unmapped memory during the copy.  Measured: the GUESTPTR traces persist and are now understood as ELF LOAD vaddr targets at 0xdfff from loadelf readat - the exec path is loading an image whose phdrs land there, so the next increment is validating and tracing execpath plus program headers in sysexecve before loadelf runs.  Verified: taiji-linuxrun-smoke-ok, taiji-unified-smoke-ok.
2026-09-19 16:11:33 -03:00
kryonlabs de903f6efc wine: guest-pointer diagnostics; clone thread stacks backed on demand
Round 14 of the Wine path:

- readat now validates its guest buffer against the mapped segments
  and names unmapped pointers (GUESTPTR) instead of dying silently -
  the round-13 decoded stub is now attributable.
- Clone children with a requested thread stack (CLONE_SETTLS path)
  back the stack region on demand (ensurestack) from the post-rfork
  context: Wine creates threads with stacks anywhere in its reserved
  area (observed at 0xdfff0000), outside every segment.
- Measured with the diagnostics in place: Wine's own guest stack sits
  in the 0xdfff region and reaches readat during exec-argument copying
  in a forked child before any backing exists - the GUESTPTR traces
  pin it.  The next increment is to back that region at fork/exec
  entry (the same ensurestack treatment at the copyguestenv call
  sites), after which the argument copy succeeds.

Verified: taiji-linuxrun-smoke-ok, taiji-unified-smoke-ok (default
memory).
2026-09-19 16:07:43 -03:00
kryonlabs bc5ede5955 wine: decode the frontier pc as a native syscall stub
The faulting pc 0x13fdf disassembles from the binary to mov eax,0x13; int 0x40 - a native Plan 9 syscall stub receiving a guest pointer whose segment is absent. The windows application plan records this and redirects the next increment to validating guest pointers at the native call sites (file readat, socket paths, exec/fork child re-attach ordering).
2026-09-19 16:00:46 -03:00
kryonlabs b57336b58b wine: clone children attach low guest memory
The clone/fork child block re-attaches the opt-in low segment right
after rfork - the post-rfork context is the one where registernotestack
and atnotify already succeed, and Wine's clone children run low-address
code immediately.  Gated by LINUXRUN_LOW as before, so nothing changes
for ordinary guests.

Measured: the display probe's next fault is unchanged (a guest-stack
read at 0x6001d874 from pc inside linuxrun's early child path, before
the note handlers are registered - FAULTCODE stays silent for it).  The
windows application plan records this as the next investigation: the
fault lands in the pre-atnotify window of the exec/clone child.

Verified: taiji-linuxrun-smoke-ok, taiji-unified-smoke-ok (default
memory, no opt-in).
2026-09-19 15:59:19 -03:00
kryonlabs 1760cf4021 wine: low guest memory, opt-in; note-context segattach finding
Round 11 of the Wine path:

- segattach from the trap handler always fails ("virtual memory
  allocation failed") regardless of size - the low segment now attaches
  at the initial load, outside note context.  This is also why every
  in-syscall attach attempt failed in earlier rounds.
- Low guest memory [0x200000, 0x8000000) (the notestack's shared
  segment sits at 0x8000000) enables Wine's low fixed mappings; with it,
  under Q9_MEM=2G and LINUXRUN_LOW=1, the notepad probe shows Wine
  executing code at low addresses - the furthest yet - before the next
  fault (a stack-region read, consistent with the documented
  notestack-missing failure mode when Wine's signal_init ordering is
  still pending).
- The eager attach is opt-in (LINUXRUN_LOW in the host environment):
  attaching it unconditionally destabilized ordinary guests - the
  unified smoke's Xvfb child died with note-stack pointers leaking into
  syscalls (0xdeffef24/220, matching the round-3 signature).  The wine
  display probe opts in; every other path is unchanged, verified by
  taiji-unified-smoke-ok with taiji-unified-cleanup-ok and
  taiji-linuxrun-smoke-ok at the default memory size.
2026-09-19 15:54:45 -03:00
kryonlabs 488fde82a9 wine: virtual memory round — reservations, low memory, mprotect correctness
The notepad probe with signal delivery in place surfaced Wine's real
next requirement and two genuine bugs:

- virtual_init builds its views area from many small fixed mappings at
  low addresses (0xe40000 onward); linuxrun's mmap only accepted
  [0x40000000, +512MB).  Giant anonymous PROT_NONE mappings (256MB+) are
  now recorded as virtual reservations materialized by mprotect, and a
  low-memory segment attaches on demand for low fixed mappings (fork
  children reset the flag; segments do not survive rfork).
- mprotect no longer zeroes its target unless it was a recorded
  reservation: the first cut wiped loaded libraries - libc's version
  tables - breaking every dynamic program with 'undefined symbol: free'.
  Caught by the unified smoke before shipping; re-verified clean.
- Measured limit recorded in the windows application plan: the 1GB VM
  cannot host a second large segment next to the 512MB main guest
  segment (every size from 1GB to 127MB fails segattach); the next step
  is more VM memory or one segment spanning both regions.  Wine now
  exits cleanly instead of crashing.

Verified: taiji-linuxrun-smoke-ok; taiji-unified-smoke-ok with
taiji-unified-cleanup-ok (an initial flaky xbridge snapshot failure did
not reproduce on retry).
2026-09-19 15:39:49 -03:00
kryonlabs 2389fb848a linuxrun: i386 signal delivery — rt_sigaction, rt_sigframe, rt_sigreturn
Implements the subsystem the decoded Wine fault requires:
- rt_sigaction (174) records each signal handler and restorer instead
  of discarding them; registrations are traced (SIGACTION).
- Trap-class faults now deliver SIGSEGV to a registered handler by
  building an i386 rt_sigframe on the guest stack (pretcode doubling as
  the handler return address, sig/pinfo/puc as its stack arguments,
  128-byte siginfo, ucontext with the full register set, and the
  popl/movl $173/int $0x80 trampoline), then resuming the ureg in the
  handler.
- rt_sigreturn (173) restores the frame context after the dispatcher,
  including a redirected pc when the handler dispatched a thunk.

Measurement: the wine notepad flow still faults before Wine registers
  any SIGSEGV handler (only SIGABRT/default passes through), so the next
  investigation is the ordering between wine signal_init and the first
  hlt thunk — possibly inside the forked wineserver child; SIGACTION
  tracing is in place for it.

Verified: taiji-linuxrun-smoke-ok, taiji-unified-smoke-ok with
taiji-unified-cleanup-ok.
2026-09-19 15:08:09 -03:00
kryonlabs 443e438c26 wine: decode the fault — hlt thunk, signal delivery is the missing subsystem
The corrected full-log probe (cat, not tail) shows traphandler running
and FAULTCODE firing; the earlier never-reaches-handlers claim was a
tail-truncation artifact. The faulting instruction at pc=0x4082531a is
hlt (0xF4): Wine i386 uses deliberate privileged faults as dispatch
points and services them from SIGSEGV handlers registered via
rt_sigaction, which linuxrun stubs without bookkeeping. The windows
application plan now specifies the prerequisite subsystem precisely:
rt_sigaction recording, i386 rt_sigframe construction with siginfo,
ucontext, mask, and the rt_sigreturn trampoline, and rt_sigreturn
context restore.

Verified: taiji-linuxrun-smoke-ok.
2026-09-19 14:58:46 -03:00
kryonlabs 030c8e3565 linuxrun: prove the wine crash note never reaches userspace handlers
An unconditional, capped print at the top of traphandler stays silent
while the forked wine child dies with the general-protection violation:
the trap note is swallowed by the foreign-process note-delivery path
before any atnotify handler runs, so FAULTCODE cannot observe it. The
windows application plan now names the prerequisite fix precisely
(kernel postnote/notify handling for up->foreign processes, or the
child note-stack re-registration in registernotestack).

Verified: taiji-linuxrun-smoke-ok.
2026-09-19 14:51:03 -03:00
waozi ecb90d7241 desktop: commit the sources the earlier commits referenced
The earlier commits in this series staged modified tracked files plus a
handful of new paths; several new files that the committed binaries and
mkfiles depend on were never added and remained untracked local work:

- sys/src/cmd/xbridge: the complete bridge sources (xbridge.c, x11.c,
  x11.h, mkfile) — the installed binary was committed without them.
- sys/src/cmd/rio9/overlay.c: the desktop overlay implementation the
  window server builds.
- sys/src/cmd/linuxrun/environment.{c,h}: required by the committed
  mkfile (environment.$O).
- doc/unified-desktop.md and doc/unified-desktop-status.md: the desktop
  notes and status/plan pages all session commits refer to.
- rc/bin/linux-app: the Debian application launcher.
- cfg/q9 probe scripts from the D-Bus/XFCE debugging sessions
  (gtk-probe, kbuild-test, xfce-bisect, xfce-min, xfce-shot series)
  referenced by the status history.

Also records this round's verifications: the desktop renders at both
1024x768 and 1280x1024, and the legacy-reference sweep is clean.
2026-09-19 14:46:53 -03:00
waozi 0aee73a8bd wine: live-display probe and fault-instruction diagnostics
- cfg/q9/wine-display-probe.rc drives notepad against a live Xvfb
  display and captures the X screen through xbridge: Xvfb starts, wine
  stays alive through startup, and Wine's PE initialization proceeds
  until a child faults with a general-protection violation at
  pc=0x4082531a — the new measured frontier, recorded in the windows
  application plan.
- linuxrun's note handler now dumps the instruction bytes around any
  faulting pc inside the guest image (FAULTCODE), so the next session
  can decode and emulate the exact instruction instead of guessing.

Verified: taiji-linuxrun-smoke-ok after the changes; the display probe
completed with Xvfb ready, a captured X screen, and the fault recorded.
2026-09-19 14:39:32 -03:00
waozi e7bed45d5c linuxrun: Wine executes — /proc/self/exe, statx, faccessat
Wine 8.0 now runs through the syscall translation layer: wine --version
prints, ntdll.so loads, and the notepad process survives startup. The
measurements that got there, in order:

- statx (383): all argument forms — absolute, AT_FDCWD, dirfd-relative
  via /proc/pid/fd, and AT_EMPTY_PATH with the flags argument in its
  correct (third) position; ld.so's library search completes with it.
- readlink/readlinkat answer /proc/self/exe and /proc/<pid>/exe with the
  guest-visible executable path, absolute paths only: relative native
  invocations keep the realpath-compatible answer so busybox-style
  multi-call binaries still fall back to argv[0] (caught by the
  linuxrun regression before it could ship).
- /proc/self is rewritten to /proc/<pid> for stat64/lstat64/fstatat64/
  statx/access because the native /proc has no self entry and Wine's
  realpath probes every component.
- faccessat (307) and faccessat2 (439) implemented for ntdll's path
  verification.

Verified: taiji-linuxrun-smoke-ok (full regression after each change),
wine --version output, notepad liveness probe.
2026-09-19 14:32:35 -03:00
waozi 2d4519fd31 wine: stage the runtime, measure the path, land statx
Track 4 groundwork, measured end to end:

- scripts/fetch-wine.sh stages Debian bookworm's i386 wine, wine32, and
  libwine closure (115 packages) into the Debian root, following the
  fetch-xfce.sh staging pattern.
- cfg/q9/wine-measure.rc drives Wine through linuxrun and captures each
  stage; classic rc lacks break/head, so the probe guards its loops and
  uses sed.
- linuxrun implements statx (i386 nr 383): absolute paths, AT_FDCWD,
  dirfd-relative through /proc/pid/fd, and AT_EMPTY_PATH with the flags
  argument in the right position. Wine's ld.so dependency search and
  libc/libwine loading now complete; the measured frontier is Wine's own
  ntdll.so load, which needs dynamic-loader TLS support.
- The windows application plan and status page record the measured
  stage table and the next implementation target.

Verified: taiji-linuxrun-smoke-ok (no regression from statx), wine
measurement logs in the session evidence.
2026-09-19 14:14:34 -03:00
waozi 32e3d2c6a2 desktop: minimize control, tested task switching, cleanup checks, plan groundwork
- rio9: the desktop surface may synthesize keyboard input through
  /dev/kbdin, like the simulated keyboard window; ordinary applications
  still may not.
- window smoke now injects the Ctrl+Tab chord (Kctab) and asserts focus
  cycles to the next window through the taskbar activation path.
- xbridge: a title-bar minimize control hides the window through wctl;
  the taskbar and Ctrl+Tab restore it.
- linux-app prints progress dots while the private display starts.
- unified smoke asserts no linuxrun, xbridge, or Xvfb processes survive
  teardown (taiji-unified-cleanup-ok).
- Groundwork for the remaining plan: windows-application-plan.md records
  the representative application (Wine notepad), requirements, and
  measured blockers; the 64-bit architecture decision and the application
  isolation policy are recorded in the desktop notes and status page.

Verified: taiji-window-smoke-ok (with the chord test), taiji-unified-
smoke-ok with taiji-unified-cleanup-ok.
2026-09-19 13:52:32 -03:00
waozi ab65e936c1 desktop: unified desktop integration with everyday-use features
Completes the one-desktop integration and adds the everyday-use features
from the remaining-work plan:

- rio9 window server integration; the legacy rio desktop implementation,
  flavor selector, namespace/window-manager tables, theme/display
  controllers, and stale Lola manual are removed; rio delegates to rio9.
- Keyboard task switching: Ctrl+Tab cycles application windows through
  the taskbar activation path, restoring hidden windows.
- xbridge: RandR resize negotiation (1.2 RRSetScreenSize with the 1.0
  RRSetScreenConfig fallback, CRTC detach, size-range clamping); text
  clipboard raised to 1 MiB with chunked property writes and INCR
  reception; extended selftest covering 300 KiB round trips, INCR, and
  the close protocol. linux-app boots Xvfb at 1920x1080 for shrink
  headroom and reports launch failures with the application's log tail.
- About opens as a normal window (rill --about); Text Editor registers
  without a default document.
- Document opening: rill-open resolves file-name suffixes through
  /lib/rill/associations (user overrides honored) and translates $home
  paths into the Debian runtime's /home/user view.
- Harnesses: unified/window/linuxrun smokes, desktop-boot-smoke cold GUI
  boot check, driver-smoke payload checks, web image payload additions.
- linuxrun session-environment and syscall refinements from the bridge
  debugging; application matrix and refreshed status documentation.
- Rill submodule pointer: upstream-first commits 8132a17 (--about
  window) and 49aa57d (tolerate stray unmasked fp notes).

Verified on the rebuilt kernel and desktop: taiji-fp-exception-ok,
taiji-window-smoke-ok, taiji-unified-smoke-ok, taiji-linuxrun-smoke-ok,
driver-smoke, taiji-desktop-boot-ok, make site.
2026-09-19 13:44:05 -03:00
waozi 132188cff2 kernel: clear pending FPU exceptions after FXSave; distinct Ctrl+Tab rune
fpssesave0 uses FXSAVE, which leaves pending exceptions in the live FPU,
so FPOFF's WAIT re-triggered the exception inside its own handler
(fpssesave0 -> matherror -> trap). Clear the live exception after
saving the state. Verified by the exception regression in make
window-smoke and by cold GUI boots.

kbtabctrl now emits a distinct rune (Ctab/Kctab, KF|0x19) for Ctrl+Tab
so rio9 can implement keyboard task switching; xbridge maps it back to
Tab for X clients.
2026-09-19 13:43:58 -03:00
waozi 373e4c5603 nsselect/libdraw: fix the chooser-to-session handoff holding the mouse
startsession() wrote the launch command to the pre-forked launcher,
then blocked in waitsession() while STILL holding /dev/mouse.  The
launcher's waitmousefree() times out after 5s and execs the window
manager anyway - its einit then failed with '/dev/mouse already in
use' and the whole desktop boot dropped to a shell ('draw: einit'
right after 'q9: gui ready' in every graphical console boot).

- libdraw gains eshutdown(): closes mousefd/cursorfd so an app can
  release the event devices before handing the session over.
- nsselect's startsession() calls eshutdown() before waitsession().
- together with the previous heap-corruption fix in splitfields,
  the graphical console boot now reaches and keeps the chooser.
2026-09-17 17:53:54 -03:00
waozi 226e538d68 nsselect: fix heap corruption at startup - splitfields freed a stack pointer
When a namespaces/wms line had fewer separators than the requested
field count, splitfields stored a pointer INTO the line buffer as
the last field; freefields then free()d it - a stack address - which
tripped the libc pool 'D2B called on non-block' panic, corrupted the
heap, and crashed nsselect with a null-read fault right after 'gui
ready'.  Every field is now an owned malloc'd copy.
2026-09-17 16:00:01 -03:00
waozi a93b099a5b linuxrun: eventfd-only spurious poll cap; ROOT CAUSE of the glib wedge: thread identity
THE FINDING (harness, t565): g_main_context_is_owner() returns TRUE
from the MAIN for the gdbus worker's shared context - glib's
owner==G_THREAD_SELF comparison matches because per-thread
pthread-key storage (glibc 2nd-level specific blocks in the shared
heap) aliases across the emulator's thread-processes.  The main
therefore (a) suppresses the attach wakeup write (worker sleeps in
poll forever) and (b) wrongly 'acquires' the context (worker blocks
in the acquire cond - FTXW val=0).

- libglib binary patch (offset 0x4f8b6, je->nop): the attach
  wakeup now signals whenever owner!=NULL, even when owner==self -
  the confused match no longer suppresses it.  Verified in t570:
  post-BEGIN activity for the first time (NEGOTIATE_UNIX_FD
  round-trip + eventfd wakeup writes).
- poll(): spurious 0-return after 500ms for infinite polls that
  include an eventfd stand-in only (blanket version broke the
  plain-socket SASL); lets glib loops re-run prepare().
- harness: GError dump, is_owner probe, owner-slot dumps,
  pthread_self/g_thread_self comparison (distinct - the aliasing is
  in the KEY blocks, not the descriptor).
2026-09-16 02:17:34 -03:00
waozi de2aade7c0 q9: harness trace completes the picture - the idle source is never dispatched
Added send()/sendmsg()/recvmsg() interposition and thread-default
context tracing.  Full decoded sequence under the emulator (matches
glib 2.74.6 source):

- main runs the whole SASL via send() (all 5 lines traced, BEGIN last)
- _g_dbus_worker_new attaches '[gio] _g_dbus_worker_do_initial_read'
  (an IDLE source, prepare==TRUE unconditionally) to the shared worker
  context 0x4001add0 - g_source_attach TRACED, and
  g_main_context_push_thread_default TRACED from the worker confirms
  the SAME context address the worker runs
- the attach's internal wakeup is written (fd6, traced) and consumed
  by the worker (traced)
- the worker's loop then re-polls fd6 forever: g_main_context_prepare
  does NOT see the attached idle source - if it did, prepare would
  return ready (idles are always ready) and dispatch would run the
  initial read, then the Hello send would follow via
  schedule_writing_unlocked's own idle (never attached - only 4
  attaches total, all traced)
- the main correctly waits on its own context's wakeup (fd20, 1h) for
  the GTask completion that can never happen

So the wedge is now precisely: an idle source attached to a running
GMainContext from another thread is invisible to that context's
prepare() under the emulator - a glib source-list visibility/locking
question.  Needs qemu-i386 + gdb on the host (sudo) to single-step
g_main_context_prepare in the worker.
2026-09-15 15:40:24 -03:00
waozi 59d2f4b690 q9: i386 GDBus harness + libc/glib interposition - minimal reproducer for the xfwm4 wedge
A 60-line C program linking the rootfs's own i386 glib, with a
hand-rolled _start (no multilib crt needed), reproducing xfwm4's
exact stall in a 7-minute boot: full SASL (BEGIN on the wire, OK +
AGREE_UNIX_FD read back), then the connection's write-source is
attached to the worker context (g_source_attach traced), the wakeup
eventfd is written by the main and consumed by the worker - and the
worker re-polls without ever dispatching (the dbus socket never
enters its poll set).  Natively on the host the same binary completes
(conn=0x... err=0), so the wedge is emulator-specific.

Interposition layer: exe-defined write/writev/poll/read (raw-int80
forwarding) trace libgio's I/O decisions; dlsym-forwarded wrappers
for g_source_attach/g_main_context_invoke_full/prepare/check/
dispatch/is_owner/acquire and g_socket_condition_check (the latter
turn out to be intra-libgio and thus invisible).

Build: gcc -m32 -nostdlib, link -l:libgio-2.0.so.0 etc. against
debian/rootfs/usr/lib/i386-linux-gnu.  Next step this enables:
qemu-i386 user-mode + gdb on the host against the same binary/libs
for a real single-step of the worker's context iteration.
2026-09-15 13:29:02 -03:00
waozi fb390a906c q9: gdbus minimal reproducer attempt (no gdbus CLI in rootfs)
Key negative results: the rootfs has no glib client tools (gdbus/
gsettings/dconf absent), and xfconfd - a glib main-loop dbus SERVICE -
completes g_bus_get_sync + Hello + name ownership fine under the
emulator, so the GDBus sync pattern itself works.  The WM's wedge is
narrower: its gdbus worker thread is never created (no fifth clone;
no thread ever polls the dbus socket) - the stall is inside
g_bus_get_sync between auth completion (BEGIN verified on the wire)
and worker spawn, before any syscall.
2026-09-12 19:45:26 -03:00
waozi a0727b5ae9 linuxrun: recurring 2s self-sampling alarm (SAMPLE pc/sp/bp/ax/bx)
The /proc note-poke sampling failed (only the parent may write
/proc/N/note), so the dispatcher now re-arms a 2s alarm and every
note prints the guest's live context - samples land in userspace
loops that no syscall-level probe sees.  First distribution from the
parked gdbus worker: ~all samples at the ld.so syscall stub =
the worker spins through the syscall boundary (busy poll loop),
never dwelling in glib's check/dispatch long enough to sample.
2026-09-12 19:36:35 -03:00
waozi 4fc5e95e12 linuxrun: guest clock multiplier back to 1x
A/B test at the park: the gdbus-worker dispatch wedge is identical at
8x and 1x - the clock multiplier is exonerated (as is efdwr
coalescing: the worker consumes its wakeup).  Keep the base-relative
clock structure (it fixes the int64 overflow) at 1x as the safer
default.
2026-09-12 18:49:34 -03:00
waozi 06e923188e linuxrun: PSET probe - dump the full pollfd set when a poll blocks idle
Names the wait topology directly: the WM main parks polling ONLY the
gdbus worker channel (fd25, single-fd poll, never ready), while the
worker polls its wakeup eventfd (fd14) - the worker consumed its one
wakeup (8 bytes read) but never dispatched the queued work and went
back to polling.  Everyone-waits-for-everyone confirmed from the poll
sets themselves; the remaining wedge is glib's post-wakeup GSource
dispatch inside the worker.
2026-09-12 18:36:39 -03:00
waozi 83f05b32f5 linuxrun: ALWAYS register accepted sockets (rf==0 collapse) - THE dbus wedge
sysaccept returns (rf<<16)|wf and both accept wrappers only ran
socknewslot when the value was >= 0x10000.  When the acceptor's
stdin had been closed, the adopted read-end pipe landed on host fd 0,
collapsing the packed value to wf - the guard then skipped socket
registration entirely and the connection stayed forever unreadable:
epoll readiness lookups failed (qffff), dbus-daemon never read
xfwm4's connection, xfconfd starved, and the WM parked.

With registration on r >= 0, the WM's full SASL goes through
(AUTH EXTERNAL -> DATA -> NEGOTIATE_UNIX_FD -> BEGIN, daemon replies
OK + AGREE_UNIX_FD verified on the wire).

Also: ticket reaping (dead-client tickets no longer hold listeners
perpetually ready; broken adoptions consumed), CLOSE/LQREADY/FTXW
probes.
2026-09-12 17:53:06 -03:00
waozi 105577faca linuxrun: RDBLK probe (blocking socket reads only); q9 watchdog
The /proc ps-state watchdog (wdog.rc: periodic ps + /proc/*/syscall
dumps in the session log) named the parks: dbus-daemon busy in NSS
opens (fixed host-side with a files-only /etc/nsswitch.conf), while
the WM and xfconfd sit in Sleep with zero syscalls - parked inside
epoll_wait for GSource events that never fire.  RDBLK proves the WM
is NOT blocked in any socket read: the dbus reply simply never
arrives because xfconfd's glib main loop never dispatches.  Main-
loop-driven glib processes wedge under the emulator while plain
libdbus clients (dbus-send) complete full round trips - the frontier
is the glib worker-thread wakeup chain.
2026-09-12 12:35:50 -03:00
waozi c19de8971d q9: long-haul session script (n21) - 8 screenshot cycles over ~3h for the slow xfconf property load 2026-09-12 05:16:50 -03:00
waozi 4fd0e41a5f linuxrun: file readahead, /srv GC and 512K scans, guest clock multiplier; xfwm4 boot chain
t524-t532 chase of the post-selection-claim park:

- 'Missing data from default files' is FATAL in xfwm4 (main.c status
  -2 -> exit): the WM was exiting after the theme warning all along.
  The rootfs shipped NO xfwm4 themes - installed the default theme
  from the upstream tarball - and xfwm4 requires a working xfconf,
  so n20 now launches xfconfd after dbus.
- xfconfd died 'Xfconfd failed to start: Timeout was reached' inside
  g_bus_get_sync (glib's 25s GDBus default): binary-patched the
  single 25000ms constant in libgio-2.0 to 3600000ms (backup kept).
  With that xfconfd starts clean.
- guest clock 8x multiplier (clock_gettime 265/403), scaled around a
  boot-time base - a bare multiply overflows epoch-nanoseconds and
  glib aborts on the 'non-monotonic' negative clock.
- fileread(): readahead cache for guest file reads - freetype reads
  fonts 512 bytes at a time, ~1s per read through ufs (25 min per
  font); 8x64KB per-fd cache, invalidated on close and seek.
- /srv scans enlarged to 512KB with stale-ticket GC: leaked x.c
  tickets pushed fresh connects past the read buffer, so Xvfb never
  accepted xfwm4's later connections and their writes blocked.
- probes: OPENCHK (pre-open path), RDCHK/RDFILE (blocking-read
  identity), fileqlen.
2026-09-12 04:22:10 -03:00
waozi 81fce1542a linuxrun: never publish x.m markers for unconnected slots; republish on connect
THE WM dbus freeze, finally: the stale-hit refresh in sockslot read
the .f marker published when the dbus socket was created unconnected
(packed=0, fd numbers <= 2) - reading a marker dups the stored fd, so
the refresh dup'd fd 0 and blocked reading STDIN forever, wedging the
WM inside sockslot mid-sendmsg (the SASL \0 write never reached
sockwr; the daemon's auth timeout then killed the connection).

- publication (sockmapfd + socknewslot) skips packed==0 entirely
- connect handlers now store through sockmapfd so the markers are
  republished with the connected pipes (the old bare store left them
  absent/stale, starving sibling-thread adoption)
- the stale-hit refresh skips parsed fd numbers <= 2 defensively

With this the WM's dbus \0 completes, xfconf reaches its (expected)
failure against the missing xfconfd, and xfwm4 proceeds into theme
loading - its deepest state yet.
2026-09-11 21:56:23 -03:00
waozi 84352f46e8 q9: guest-side dbus-send reproducer script 2026-09-11 15:10:57 -03:00
waozi 68ccd2dbd3 linuxrun: epoll watch-split fix, data-driven readiness; dbus reproducer proves the bridge
- dbus-run.conf auth_timeout 30s->2h (emulator needs minutes between
  SASL writes; the daemon's timeout killed every WM connection).
- EPOLL_CTL_DEL keeps the fd (libdbus splits one fd into read+write
  watches; the write DEL after the read ADD erased all interest).
- epoll readiness for connected bridge sockets is data-driven
  regardless of registered mask.
- probes: sendmsg/writev dumps, connect-store traces, GDBUS_DEBUG.
- dbus-probe.rc: dbus-send completes a FULL ListNames round trip
  against the daemon cross-process - bridge/auth/pipes all work; the
  remaining xfwm4 stall is its own multithreaded fd-slot state.
2026-09-11 15:10:45 -03:00
waozi 1d0b2a3f3c linuxrun: ENOTCONN for unconnected sockets, eventfd flag through creation, bounded fork park
t498-t503 forensics on the post-selection-claim freeze:

- writes/sends/writev on a sockmap slot with packed==0 (a plain
  socket() whose connect was refused or never made) fell through to
  host fd 0 - the guest's gdbus retry data went to stdin and the
  write could block on the console forever.  These now fail with
  -ENOTCONN immediately, like real Linux.
- socknewslot now takes the eventfd trait as a parameter and records
  it BEFORE publishing the x.m .f marker: the old flow published the
  marker first and set isefd[] afterwards, so the marker always said
  'not an eventfd' and every adopter (and the main process after fd
  reuse) lost the trait - efdwr then never engaged and the wakeup
  write blocked (EFDDBG probe proved isefd==0 at the frozen write).
- the fork/clone parent's forkready park is a polled, bounded wait
  (2 min) instead of a blocking read: a swallowed alarm note makes
  plan9 resume a blocked read, so a child dying before its release
  parked the parent forever.
- close no longer removes the shared x.m markers (thread-group keyed:
  a sibling closing its copy yanked them from under other processes -
  ADOPTFAIL noise); entries leak per session within the 64K scan.
- diagnostics: RAWW (raw-fd write with marker present), ADOPTFAIL,
  EFDDBG, WUNCONN.
2026-09-11 01:03:12 -03:00
waozi 295eda6c7e linuxrun: eventfd stand-ins never block their writer; spin probe
t491-t497 nailed the recurring xfwm4 freeze: a guest write to a glib
wakeup eventfd (pipe stand-in) entered a blocking host write; the
3-second guard alarm's note was swallowed by the trap handler, and a
swallowed note makes plan9 RESUME the interrupted write - one alarm
per arming left the writer stuck inside dosyscall forever (the
dispatcher's 60s userspace-silence alarm never armed because we never
left the call).  The nondeterministic stall depth came from where the
freeze happened to land.

- efdwr: eventfd writes with a wakeup already pending (peer pipe
  qlen > 0) discard the new value instead of writing - the counter
  semantics coalesce wakeups, so nothing is lost and the write can
  never block.  Routed through the write and send paths.
- isefd[] tracks which bridge pipes are eventfd stand-ins, set at
  eventfd/eventfd2 creation and propagated through the x.m .f marker
  (flag bit 2) so adopted siblings keep the trait; peerqlen/drain
  now consult it, so socket pipes (live protocol data) are never
  drained.
- ALARMSPIN probe: the dispatcher re-arms a 60s alarm after every
  syscall; a pure-userspace spin finally shows its pc/stack when the
  note lands.
- with this, xfwm4 for the first time reliably claims WM_S0
  (SetSelectionOwner op 22 + verify seen in t497) and proceeds into
  theme loading.

Also: q9 scripts n17/n18/n19 (long-window WM sessions with periodic
screenshots, GLX-off Xvfb, dbus-first).
2026-09-10 17:47:27 -03:00
waozi 48f47affdd linuxrun: real futex timeouts, WAKE_OP, wakeup-pipe drain, probes
Progress from t476-t480 on the xfwm4 startup stall:

- dofutex rewritten: FUTEX_WAIT/WAIT_BITSET now honor their timeouts
  (relative resp. absolute CLOCK_MONOTONIC deadlines, 1ms polling)
  instead of returning instant ETIMEDOUT/spurious wakeups, which had
  collapsed every glib/glibc timed wait into a zero-delay spin;
  FUTEX_WAKE_OP now performs its atomic op and comparator on the
  second word (it desynced glibc's lowlevellock protocol as a no-op).
  Signature widened to six futex args (a6 = ur->bp).
- sockwr: a write that blocks three seconds on a full pipe drains the
  peer end and retries, so an unread glib eventfd-style wakeup pipe
  can no longer freeze the writing thread forever.
- probes: futex op dump, sockmapfd trace, fcntl F_DUPFD socket trace,
  sysconnect sockaddr dump.
- established with t480: with these fixes xfwm4 reliably completes
  the whole gdk_display_open request stream (formerly stalled inside
  it); the remaining blocker is a single-threaded guest userspace
  spin after an abstract-socket connect refusal - no clone/mmap/
  syscalls at all afterward (xfwm4 never creates threads under the
  emulator yet).
2026-09-10 01:51:19 -03:00
waozi 0db76cd1c8 linuxrun: X write/read stream dumps, /srv scan fixes, GLX-off scripts
Forensics for xfwm4 startup under the emulator (t458-t473):

- XWR/XRD: full per-connection write and read byte dumps for X client
  sockets (byte-order-char detection), plus a DUP trace for socket fds;
  request/reply streams can now be reconstructed offline. Established
  that xfwm4's X stream always ends at the end of gdk_display_open
  (XFIXES SelectSelectionInput + GetSelectionOwner on _NET_WM_CM_S0)
  and the gtk_win is never realized or mapped - the stall is guest-side
  glib/gdbus scheduling, not X transport (transport is byte-exact;
  xfce4-panel, a plain GTK3 client, maps and paints fine).
- sysconnect: sockaddr dump probe + diagnostics on pipe()/postsrvfd
  failures (previously silent early returns left gdbus retrying
  forever with nothing queued for the listener).
- sysaccept/listenqueued: /srv directory scans enlarged 4K->64K and
  made static (the on-stack 64K buffers smashed host stacks after the
  first enlargement - same class as the old splice bug).
- q9 scripts: dbus-first session runs (n13-n16) with -extension GLX on
  Xvfb (swrast/libLLVM loading under the emulator starved the server
  for the whole session), stale ticket-marker cleanup, and a GTK
  discriminator run (n11) that proved GTK startup works.
2026-09-09 23:48:18 -03:00
waozi 29515a28a7 linuxrun: dump ChangeWindowAttributes request heads
The WM's root select-redirect request - its bytes name the target
window and the attribute mask (0x200000 must appear).

Git-Id: f9dbd2b87c5c55a9519eb6b1b16f74e7ba93a99a
2026-09-09 19:11:16 -03:00
waozi 4087c19b16 q9: WM-first ordering session (n10) - launch xfwm4 before any client maps
Git-Id: c76838838be45d2d76cc13f1fbaf9dbf93c37a52
2026-09-09 19:04:11 -03:00
waozi 94fed28d8d linuxrun: dump guest stderr writes (capped)
The WM's last action before idling is a write to stderr whose
content was never logged - it likely names what stops it before
the window tree scan.

Git-Id: e7343f25bf9860b2e1e8c96753e094498883f3ab
2026-09-09 18:12:39 -03:00
waozi e54e180b79 linuxrun: plain EAGAIN for empty nonblocking reads - the alarm probe killed its caller
The probe's own blocked 1-byte read was interrupted by its alarm
and the resume at the ld.so stub's ret trapped invalid-opcode,
killing the calling thread. The WM died exactly here after an
EAGAIN recvmsg - every one of its 8+ connection retries ended
this way. Empty nonblocking reads now return EAGAIN directly;
EOF detection stays with the blocking read path and the poll/epoll
write-end checks.

Git-Id: 3e9710b302e4e1d78bda6a1975a3ecae6a92a9be
2026-09-09 17:37:17 -03:00
waozi aa2f5d3cb1 linuxrun: the EOF probe never serves a stream byte
Serving the probe's 1-byte read duplicated bytes at chunk
boundaries (32-byte reply followed by a spurious n=1 read, next
reply misaligned at n=31), desyncing XCB's parser - the WM tore
down its connection and retried forever at the same split. The
probe byte now goes back to the front of inq and the caller sees
EAGAIN, keeping the stream byte-exact.

Git-Id: b7c8154f7f21d4f34c9e5144db801858909a3d1b
2026-09-09 17:01:39 -03:00
waozi 664fa993ef linuxrun: widen head dump to extension opcodes; replies seq>=50
Opcode 140's request bytes name the extension negotiation (the
WM resends it 4x per attempt) and the reply's version fields are
the suspect.

Git-Id: 31d73a91a55d9987dbfb83ba3c5be2cbd9d4c0d8
2026-09-09 16:37:01 -03:00
waozi 851064aa09 linuxrun: dump the first 12 reads per socket (client side)
The server's setup bytes are verified perfect; concatenating the
client's read chunks against them names any chunking defect.

Git-Id: f0574d1a30b57c0c2fa15ab6c861022fb65d4ca1
2026-09-09 16:23:08 -03:00
waozi fa49776028 linuxrun: extend the write-head dump to 80 bytes
The setup continuation write (9548 bytes) carries the root window
around continuation offset 60 - 16 bytes was not enough to see it.

Git-Id: 1c50a417f7ce7280ba33a1da1d3d3ba71d77a1d0
2026-09-09 16:13:33 -03:00
waozi 8bf20cfc9a linuxrun: dump the first 10 writes per socket (16 bytes each)
The 'setup' the probe caught was actually the ListExtensions reply
(reply header, seq 14) - the real setup write never matched the
old conditions. First-10-writes heads show where the setup lands
and its root-window bytes.

Git-Id: a5b9e33186a6dbc66379586d385c81a1cd9d3d2d
2026-09-09 16:06:55 -03:00
waozi 23ecf096c5 linuxrun: dump the setup reply's raw first 72 bytes
Computed field offsets disagreed with the wire twice; read vendor
length, format count, and the root window straight off the dump.

Git-Id: f4d42f36879d5a2e835299c34f40acca97791ee9
2026-09-09 15:59:22 -03:00
waozi 7153e5bada linuxrun: format count is the single byte at setup offset 29
Git-Id: 34d0c59cf838579f52d0697427c9fda8e70e1b3
2026-09-09 15:50:16 -03:00
waozi ce3a162794 linuxrun: fix the setup probe's field offsets
Vendor length lives at 24-25 and format count at 30-31 of the
connection setup; the first screen starts at 32+8*formats+vendor.

Git-Id: 4b0992f529be45eb47a5cbe3c1a0939a37a4fa3
2026-09-09 15:43:45 -03:00
waozi 06b7b4f236 linuxrun: dump each connection setup reply's root window
The first write per socket carries the setup; the first screen's
root window sits after vendor+formats. Comparing across the WM's
retry connections shows whether any delivery parses root as 0.

Git-Id: d7bd3976934c99bea85a3bdec896b88de1c2a39d
2026-09-09 15:36:22 -03:00
waozi 602feddaca linuxrun: slot-tag the SEQ probe
The WM's two X connections interleaved under one guest-fd label,
mixing two sequence counters - now each print carries its sockmap
slot so the streams separate and replies map to requests.

Git-Id: 6418f8044a2ff405a7316d1f6f51c04b45b90c6
2026-09-09 15:17:58 -03:00
waozi bbf6fc9cf2 linuxrun: rewrite GetInputFocus focus=None replies to PointerRoot
Xvfb answers focus=None until a WM sets the focus; gdk's focus
tracking takes the None path badly (xfwm4 went on to query
attributes of window None - BadWindow/BadDrawable - and its
startup stalled before the tree scan that discovers client
windows). Real servers commonly return PointerRoot here and gdk
handles it cleanly: the bridge now seq-matches GetInputFocus
(op 43) requests and rewrites a None focus field in the reply.

Git-Id: 26cbe3f2cb8e8dcbaa1ec6a4ff74237a46a9a1a8
2026-09-09 14:41:38 -03:00
waozi 1c33776fd4 linuxrun: raise the SEQ cap to 900; dump heads of all high-seq writes
The WM's requests at seq 60+ were invisible (cap consumed by
earlier processes) - those name the window that drew BadWindow.

Git-Id: 046baea8db35657ba0b76870985be63300e9157c
2026-09-09 13:55:16 -03:00
waozi d007da487d linuxrun: dump request heads and short reply bytes in the SEQ probe
Window-bearing request heads (GetWindowAttributes/QueryTree/
GetSelectionOwner/InternAtom) and the full bytes of short replies
- the owner/window fields are the corruption suspects behind the
WM's BadWindow/BadDrawable.

Git-Id: b518079f0a8ceea52a48649cf32a291be1a74f39
2026-09-09 12:34:15 -03:00
waozi af36f69c6b linuxrun: decode error replies in the SEQ probe
The WM received op=0 (X error) replies at seq 70/71 - the code
and major-opcode bytes name which request failed.

Git-Id: 8902c6655a39498a42378357fc932a5270d0a56
2026-09-09 11:57:55 -03:00
waozi c62abc559c linuxrun: log partial writes on the bridge
write and writev report when the delivered count differs from the
requested - a request the guest believes complete but the pipe
never fully delivered would leave it waiting forever.

Git-Id: 53b6e86881d3e0e2ba4b6ed1c99fa40debe86ef6
2026-09-09 11:26:56 -03:00
waozi a7e0f5327f linuxrun: refresh stale sockmap hits from the published packed value
A thread re-registering a guest fd number (the WM's second X
socket landing on a number other host procs still mapped to the
first connection) sent its writes out the wrong pipe: the server
saw conn2 forever empty while conn1's outgoing queue grew 12
unread bytes. The .f publication now carries the live packed
value; a rate-limited stale-hit check re-adopts the endpoints
when the published value differs from our copy.

Git-Id: e0dcde2c8d94345b8d3ea2a1dd2edfe465ee8c0e
2026-09-09 10:52:11 -03:00
waozi b9d74cac65 linuxrun: sample the epoll probe every 20th call
Watch the second accepted connection's readiness in the late
session without waiting 1000 calls between samples.

Git-Id: 86e91ea897464deaf5d94e98bcbdb546db9a6f74
2026-09-09 10:29:33 -03:00
waozi c1a4afa5d9 linuxrun: back to the /srv .b open; keep the corrected qid probes
The /proc/#p channel path cannot work here (that /proc/N/fd is a
text listing), and the fd-mutation theory was printf garbage.  With
true qids, the .b OWRITE open's result is now measurable directly.

Git-Id: 04614b582486b178ae60f4ef8a99f9ab47838b4
2026-09-09 09:50:01 -03:00
waozi 6678a7cdb9 linuxrun: correct the qid probe casts
qid.vers is a ulong; printing it with %llux consumed the next
vararg word in plan9's 32-bit ABI, corrupting every qid pair
after the first - the earlier match/mismatch conclusions were
built on garbage. All three probes now cast explicitly.

Git-Id: 41ad8f8e1cf729e4d7d0ab3ec8f7467c49a3d0b
2026-09-09 09:42:42 -03:00
waozi 8b34e8f599 linuxrun: log the fd number and qid at /srv post time
Completes the identity chain: connect-side qids, post-time fd+qid,
accept-side opened qids - any mismatch or stale fd number is now
visible in one place.

Git-Id: 5e2f0f00c74a6fe14d33908a1bcdf70ff9f92d97
2026-09-09 09:31:13 -03:00
waozi de04969854 linuxrun: open the write end via #p/<pid>/fd/N device syntax
/proc/<pid>/fd resolves into the rootfs's empty /proc directory in
the debian namespace; the #p device path bypasses the bind.

Git-Id: c30fa2e95c46e1c4bd98304f8ad4b8757e8f0f1e
2026-09-09 09:20:12 -03:00
waozi 2312f69c7f linuxrun: the write end arrives via /proc/<pid>/fd, not the .b ticket
The qid probe proved the OWRITE (and ORDWR) open of the .b ticket
does NOT share the client's pipe - wf was another object, so every
server reply vanished before reaching the client. The marker file
now carries the client's s2c[1] fd number and the acceptor opens
/proc/<cpid>/fd/N instead - the same channel-sharing path the
thread adoption already uses successfully.

Git-Id: 8f5be35c66e69fa60e8488e8453ea7cafd7c8ea4
2026-09-09 09:12:11 -03:00
waozi 82d0d445a2 linuxrun: accept opens the .b ticket ORDWR, not OWRITE
The qid probe proved the asymmetry: the OREAD open of .a shares
the client's pipe channel (qids match), but the OWRITE open of .b
does not - it is the POSTING side of devsrv's fd sharing, so wf
was the /srv file itself and every server reply was written into
the ticket file instead of the client's pipe. Open ORDWR first
(fall back to OWRITE only if refused).

Git-Id: f6a5b1f9c64a9c39fbb22749c2d7309611cb22d3e
2026-09-09 09:02:40 -03:00
waozi ebd0c38f9a linuxrun: qid-identity of bridge pipe ends at connect and accept
CONNECT prints the qids of the posted ends (.a=c2s[0], .b=s2c[1]),
ACCEPT the qids of the ends it opened - a mismatch would prove the
/srv open produced a copy instead of sharing the channel, which is
the suspected reason reply bytes vanish server->client.

Git-Id: 31d4ca2b2ff8e4b9a0437a04bf32b1ba9f62b20e
2026-09-09 08:54:10 -03:00
waozi c149b463b4 linuxrun: sample epoll probe every 100th call
The re-scan fix made blocking waits long, so the 1000th-call
sampling printed once per session - useless for watching the
server's accepted-connection readiness.

Git-Id: 2c7df0aa89f0f28b25b20d0eeb30b2878dcd5b4e
2026-09-09 08:19:10 -03:00
waozi 754f51afd4 linuxrun: PBLOCK also dumps the sockmap entry for polled sockets
The WM polls its X fd POLLIN-only with bytes pending in the pipe
yet never wakes - the poll's readiness check must be looking at a
different host fd than the one holding data.

Git-Id: ebe54016990b76b17d34ee78f5a32bea0e97ef4e
2026-09-09 08:02:52 -03:00
waozi c7c5484610 linuxrun: name the fds a still-empty poll waits on
PBLOCK prints fd/events/queue-length after the first empty 20ms
slice - the WM's final block hides in one of these.

Git-Id: a97f41cbd50b34ed2c6730e930c8bd8b4af8b15f
2026-09-09 07:50:40 -03:00
waozi 971ff08fb6 linuxrun: SO_PEERCRED reports a real ucred
getsockopt zeroed optval for every option, so dbus's EXTERNAL
SASL auth saw ucred {0,0,0}; the handshake never completed and
the daemon closed the connection at auth_timeout (30s), killing
the xfconf activation path. Both getsockopt paths (socketcall
and direct) now fill {pid=guestprocid, uid=0, gid=0} for
SO_PEERCRED (optname 17) and log it.

Git-Id: e03b1f995787f9e5e5c13bc1ed69b8a537f0ac9c
2026-09-09 07:13:56 -03:00
waozi 7d42f95b11 linuxrun: blocking epoll_wait re-scans until events or timeout
The empty snapshot returned once and slept: a caller blocking in
epoll_wait with data arriving after the first scan never saw it
(the dbus daemon's client fds held unread bytes while its loop
spun on clock_gettime64+epoll_wait). Blocking and timed waits now
re-scan every 20ms; timeout-0 callers still return immediately.

Git-Id: 26c8b544cb7876bd286820a73efae0fa95910b6c
2026-09-09 06:37:05 -03:00
waozi 5dac3e2e35 linuxrun: log every failing syscall (capped)
Hidden EINVALs from stubs masquerade as application errors - one
line per negative return names the culprit syscall directly.

Git-Id: 71d5327de00e4c8724bb9b88e666baa7392a4bf1
2026-09-09 06:27:16 -03:00
waozi 55d90a8af5 linuxrun: prlimit64 fills both 64-bit rlimit fields
i386's struct rlimit carries rlim_cur and rlim_max as 64-bit
fields; the stub filled only the first 8 bytes, leaving rlim_max
garbage - dbus-daemon then rejected its own fd limit ('Failed to
get fd limit: Invalid argument') and the xfconf activation path
never ran.

Git-Id: 77032946cf299bcbf7727bf3b2dc6b8eb0911e11
2026-09-09 06:20:06 -03:00
waozi cc123544a3 linuxrun: setresuid32 succeeds - it had fallen into splice's body
Case 214 was glued onto the splice label group when splice was
added: setresuid32's stack-pointer fourth argument failed the
splice fd sanity check, every call returned EINVAL, and Xorg's
Popen child - which _exit(127)s when setuid(getuid()) fails -
killed xkbcomp's spawn, so Xvfb died at 'Failed to activate
virtual core keyboard' and never accepted a client.  Also new:
exit-127 dumps the guest scene (pc/stack/sysring - this found
the Popen _exit(127) site directly) and set*id results log.

Git-Id: 0d0f4b5d5058e35e43b876e58a58f23eb53abda8
2026-09-09 05:35:33 -03:00
waozi e24659988c linuxrun: trace forked children's first moments and exec results
The xkbcomp spawn child dies silently: the forktrace probe (80
uncapped syscalls after a snapshot copy) shows BOTH spawn
generations executing exactly set_robust_list, set_tid_address,
setgid32(0), exit_group(127) - a glibc posix_spawn child failing
in userspace BEFORE execve (which would have printed).  sysexecve
now logs entry/ok/failure with the reason for every exec.

Also: bridge connect markers moved out of /srv (devsrv files are
fd-sharing entries; readers got fd dups, not content) to plain
<path>.t.<pid>.<seq> files beside the .req marker, matched by
existence in accept and listener readiness.

Git-Id: c2fa990d2946e024dd8b90367139c0b9738db5c
2026-09-09 05:07:26 -03:00
waozi 1c8f13c558 q9: x-diag script - Xvfb + xeyes quick diagnostic
Two-minute session for accept-path and server-lifecycle checks
between full runs.

Git-Id: 0d1b63685d0ec7f8d07b1f6476b35d7f6eb3c48f
2026-09-09 04:52:30 -03:00
waozi 7fc1a26bd3 linuxrun: chdir is a no-op success - a real one broke Xvfb
Moving the host cwd made Xvfb's xkb lookups resolve from the
wrong root and the server died at 'Failed to activate virtual
core keyboard' - which also explains the zero-accept regression:
the listener never reached its loop. Report success, move
nothing; the guest's own paths are absolute.

Git-Id: 31b058ae95b7029d20e9d4908bf23e2c7a1a2b52
2026-09-09 04:03:38 -03:00
waozi 5a5c09d638 q9: linuxrun binary with ticket-path debug prints
Diagnostic build: LISTEN/TKSKIP prints in the ticket scan - the
.t-gated accept finds no tickets to even check in t410, so the
next step is dumping the raw /srv listing from the scan.

Git-Id: 41aa99d7be9e5f16ea0b3ec7a2d8dd52392d4403
2026-09-09 03:50:17 -03:00
waozi 5731b35897 linuxrun: tickets carry their socket path; listeners only take their own
Connection tickets were anonymous: ANY listener's accept ate ANY
pending connect. The dbus daemon's accept loop consumed the X
server's clients (ACCEPT p142 client=<xeyes/xfwm4> for X connects)
and vice versa - every cross-server connection since the ticket
rework was a lottery. connect() now posts a .t file with the
target path; accept and the listener readiness check match it
against their boundpath before taking a ticket.

Git-Id: 4f075f14be83e0e4c0829ea99d2bf70d8b0b2bb3
2026-09-09 03:23:22 -03:00
waozi b4ec906e13 linuxrun: splice's buffer is static - it smashed the note stack
A 32KB stack frame inside dosyscall (which runs on the 32KB note
stack) faulted the first guest that called splice.

Git-Id: e5b3d97b0ec9ad61465cd1d227e610bc89201a4c
2026-09-09 03:08:02 -03:00
waozi cd7acd3721 linuxrun: splice and chdir; accept logs its client
splice(340) was dbus-daemon's last ENOSYS (one bounded
pipe-to-pipe move per call); chdir(12) removes Xvfb's 'Couldn't
change directory' warning class. accept() now prints which guest
proc each accepted bridge pair belongs to, so server-side reply
writes can be attributed to the right client.

Git-Id: 7d9c3f02ee37c678ac355e2b2ff4373e1a062d5b
2026-09-09 02:49:57 -03:00
waozi 8e6c3a3d8c linuxrun: log refused and queued bridge connects
xfwm4 waits on its dbus fd while the daemon's listener never
reports ready - the probes record whether the connect reached the
ticket stage and under what path, deciding between a lost connect
and a missed ticket scan.

Git-Id: 2c8e0f80a2b8e2e4bc2e478fb56506de7e9c86d5
2026-09-09 02:20:25 -03:00
waozi 8065668019 linuxrun: futex unknown ops report a spurious wakeup
dofutex returned ENOSYS for WAIT_BITSET and the other modern
operations; glibc's locks use them and dbus-daemon aborted its
startup step with 'Failed to get fd limit: Function not
implemented'. A spurious-wakeup zero is legal futex behavior the
callers already tolerate by re-checking.

Git-Id: 6d9acaf62391185dfe651890a3fd7fbdfbf04ba1
2026-09-09 02:04:21 -03:00
waozi e95bf10d7a linuxrun: implement prlimit64 reads
dbus-daemon reads its fd limit through prlimit64 and aborted the
step with 'Failed to get fd limit: Function not implemented' once
the rest of its startup ran. Old limits are reported with the
same values getrlimit uses (stack 8MB, nofile 1024, rest
unbounded); set requests are accepted silently.

Git-Id: a489341f44d522279e49a54baf6bf7ab6fdecaa1
2026-09-09 01:57:24 -03:00
waozi b62031c525 linuxrun: honest readiness for raw fds in epoll and poll
pipe() stand-ins are unregistered host fds; the unknown-fd rule
reported them always-ready, so sd-event woke on its empty wakeup
pipes, took their blocking read, and dbus-daemon froze at boot -
never accepting, xfconfd never activated. Raw fds now report
EPOLLIN/POLLIN only when dirfstat shows queued data (POLLOUT
stands - plan9 pipes barely block).

Git-Id: 71103b3fe91f1c17b81e56968d00c7debbc8ba77
2026-09-09 01:50:32 -03:00
waozi f2918deb08 linuxrun: leaders adopt thread-made sockets from /srv too
The adoption path was forkppid-gated, so a group leader never
adopted connections its own threads created. dbus-daemon's leader
epoll-registered its thread-made eventfd stand-ins, missed them in
its sockmap, and the unknown-fd rule reported them always-ready:
sd-event woke on both, took the blocking read, and the daemon
froze for the whole session - never accepting, xfconfd never
activated, the WM waiting on dbus forever. socksync stays
parent-only; the /srv adoption is keyed by the group-wide
guestprocid.

Git-Id: 6e733e83099a5fa4b80b43ba8e2e67766b3787ce
2026-09-09 01:42:48 -03:00
waozi 044e8a5be7 linuxrun: trace fd identity on open
The frozen dbus-daemon's last calls were read(fd=7)/read(fd=8)
with no way to know what those fds were. open() logs fd and path
(capped) so a stall scene names its file directly.

Git-Id: 503e2be54b623a44ea0877b381bb4bd3f2f0ea5f
2026-09-09 01:34:45 -03:00
waozi b8c9d0928b linuxrun: sockwr writes fully - short counts trickled X replies
A pipe write that took only part of the buffer returned that
partial count, and Xorg honored it: one 32-byte fragment per
dispatch cycle, so a 3MB GetImage reply would have needed ~100k
POLLOUT flush rounds. sockwr now loops until the whole buffer is
pushed (reader and writer are separate host processes, so waiting
for the queue to drain cannot self-deadlock) and reports the first
few short writes with the fragment size.

Git-Id: 89c1e2b5f730f65582241531491ba923a0bc90a2
2026-09-09 01:08:16 -03:00
waozi 078f527cc5 linuxrun: writev returns bytes actually written, not requested
syswritev summed the REQUESTED iovec lengths and returned that,
so a short pipe write reported success for bytes that never left
the process - Xorg believed a 2KB GetProperty reply was delivered
when only its 32-byte header landed, and the client blocked on the
missing value bytes forever. Partial counts are returned now (the
caller buffers the rest, per writev semantics).

Git-Id: 1a447d3e1a4227da7c33cf2ca529c55b49dc4c0a
2026-09-09 00:34:45 -03:00
waozi c50cbb53ea linuxrun: disarm the write-time pre-drain - it stole cross-thread replies
sockpredrain pulled up to a megabyte of pending replies into the
WRITING process' buffer on every guest write. With CLONE_FILES
threads being separate host processes, one thread's ChangeProperty
pre-drained the reply another thread's read was waiting for -
bytes stranded in the wrong process' inq, both sides stalled, the
WM never reached its frame setup (the op histogram showed xfconf's
property sync going quiet mid-exchange with the server-side pipe
empty). Plan9 pipes have no limit so writes never block: the drain
served nothing. The PLOG peek no longer drains either.

Git-Id: 3dbbd8413e11e2361bb1cf6659064a3e97ec2725
2026-09-09 00:14:00 -03:00
waozi bdba3f435b linuxrun: per-fd pipe queue length in the epoll probe
The server's epoll reports no client ready while clients logged
successful writes - the probe now shows each registered fd's pipe
qlen from the server's side, deciding whether the stat or the
write is the liar.

Git-Id: 559671b705a61708b5752aa9f3cf8c76cba08cc3
2026-09-08 23:51:04 -03:00
waozi 55d54e0ebd linuxrun: drop the sampler - its pokes destabilized note handling
The 2s postnote pokes on every guest correlated with processes
dying at the int80 stub's ret (692 such invalid-opcode traps in
one session; the xwd client itself died that way mid-capture).
The profiler did its job - it found the RLIMIT_NOFILE walk - so it
is gone; the UD-crash dump stays.

Git-Id: e8fe69456ba9c5ea9adcb38a5fd0c4c7283476cc
2026-09-08 23:26:51 -03:00
waozi d1e88ab6a3 linuxrun: dump the scene when a guest invalid opcode is not our gate
The TrapUD fallthrough returned silently - a guest that jumped to
garbage died with nothing but the suicide note (dbus-daemon at
pc=0xe70a took the whole desktop with it).  Registers, the syscall
ring, segments and stack words are dumped before the default
disposition, same as the fault path.

Git-Id: b15b58b8dcd5d6b5b9206c1b96e4ee7a4c7ac7f0
2026-09-08 22:52:26 -03:00
waozi 6a5a7c34f0 q9: dbus-first screenshot session + diagnostics scripts
xfce-shot-n9 launches dbus-daemon before the X stack (its config
read hangs when launched later), using a fixed-path session bus
config written into the rootfs; dbus-test isolates the daemon; n8
dumps /proc state for stall forensics.

Git-Id: 2ff4d00b6b1e0d1a0f9389be3bd5f85da62c8db1
2026-09-08 22:47:27 -03:00
waozi be82e09878 linuxrun: RLIMIT_NOFILE is 1024, not infinite
A note-poked sampling profiler (RFMEM sibling postnote + a handler
that prints the interrupted guest pc) finally caught the dbus-daemon
startup spin: glibc's __close_nocancel walking the whole fd space
one fcntl at a time because getrlimit reported RLIMIT_NOFILE as
infinite - a million note round-trips before main() ever ran, on
every dbus-daemon invocation including --version. The limit is
1024 now, matching the stack-limit fix before it.

Also new: BIND/BINDABS probes, an enter-trace for blocking-candidate
syscalls, and the sampler itself (capped, silent unless sampled).

Git-Id: d5394d560ba5dcb59e6b97fb470722696e2b6254
2026-09-08 21:58:13 -03:00
waozi 5d73221e20 linuxrun: eventfd stand-ins are live bridge pipes, not EOF pipes
The eventfd/eventfd2 stand-in closed its write end right away, so
the read end sat at EOF - permanently POLLIN-ready. glib polls its
GMainContext wakeup eventfd; that fake readiness spun xfwm4's main
loop flat out forever (the fd22 poll, ready with no data, in every
sample). The stand-in is now a registered bridge socket: both pipe
ends stay live, guest writes to the eventfd reach the pipe, poll
reports readable only after a signal, and the endpoints publish in
/srv like every other bridge.

Git-Id: b85e83563b52c02c4f590f37d84e0e0354427958
2026-09-08 20:29:25 -03:00
waozi 4b416b366e linuxrun: publish accepted and socketpair bridge ends too
socknewslot (the accept/socketpair allocator) never wrote the
x.m.* /srv entries - only the connect path did - so sockets that
arrived through accept stayed unadoptable by sibling threads.

Git-Id: 4677896818b8e6a1f048745840ec8135607921fa
2026-09-08 20:18:34 -03:00
waozi 7994b89ad4 linuxrun: key bridge publication by the guest process id
Nested clones get #c/ppid of a sibling thread, not the group
leader, so a forkppid-keyed lookup missed the leader-published
endpoints. guestprocid is identical across the whole thread group
(one image, one getpid), so it keys the x.m.* files everywhere.

Git-Id: 2a5e5d1d1b78f68b1ce49787a25d44d5685fc7ca
2026-09-08 20:08:20 -03:00
waozi 6129357a92 linuxrun: publish bridge endpoints in /srv for sibling threads
The parent-only socksync missed connections a sibling thread opened
after the clone - xfwm4's fd stayed 'not a socket' in the spinning
main loop. Every new bridge socket now publishes its pipe ends as
/srv/x.m.<tgid>.<fd>.r/.w (devsrv channel sharing, same trick as
the connect tickets) plus an .f flag file kept current on SETFL;
a lookup miss in a thread adopts the connection from there. close
removes the three files.

Git-Id: 86a9a2b8c7ad84e8f8a0858df3d2b62ea9d5c0ec
2026-09-08 19:58:06 -03:00
waozi 2832714abb linuxrun: share the socket map with CLONE_FILES threads
The fork bounce wiped every child's host-side sockmap - including
CLONE_FILES threads, which share the guest fd table. A connection
opened after the clone then resolved to 'not a socket' in the
thread, and the poll layer's passthrough rule (non-socket fds are
always ready) made the fd permanently POLLIN-ready: xfwm4's main
loop iterated forever on real, unread data (RLOG showed the parent
reading fd 5 while the thread spun polling fd 22 - the same guest
connection under diverged views).

Threads now keep their inherited map, and connections the parent
opened since the clone are pulled in from its live memory via
/proc/<ppid>/mem, with the pipe ends re-opened locally through
/proc/<ppid>/fd/N (socksync, also re-tried lazily on lookup
misses). Snapshot forks keep the old wipe - they exec away.

Git-Id: 8d5c56c066b6d5eb8769090824103a2ff5b3944d
2026-09-08 19:40:13 -03:00
waozi a32dd27826 linuxrun: parse 64-bit sleep requests; block in timed epoll_wait
clock_nanosleep_time64 read the timespec64's seconds-low and
seconds-high words as (sec, nsec), collapsing every guest sleep to
about a millisecond - glib's and Xorg's timer loops then spun flat
out (xfwm4's main thread: 1h02 CPU in user mode, zero syscalls;
Xvfb: an epoll_wait+clock_gettime64 churn). The 64-bit fields are
read whole now.

epoll_wait with a real timeout also sleeps for it now (capped at
50ms) instead of returning empty 63 times out of 64; timeout-0
callers still get an immediate answer.

Git-Id: 55e2d7d51a1eab4e58dd84e57334a5aa4c35e1b7
2026-09-08 17:58:41 -03:00
waozi ef718cc203 linuxrun: point guests at the session bus /tmp/dbus-1
xfwm4 without xfconf pops a startup-failure helper dialog whose
paint stalls under the emulator (the frozen half-drawn dialog in
every screenshot so far). The run script now launches dbus-daemon
on a fixed pathname socket; every guest gets
DBUS_SESSION_BUS_ADDRESS=unix:path=/tmp/dbus-1 so xfconf (and the
rest of the xfce stack) can activate over it.

Git-Id: e5f241b17f7e9b2538b9017bd2ec8c0bdc68b6ad
2026-09-08 17:30:14 -03:00
waozi 11f8268c0f linuxrun: serve the EOF probe's byte without touching inq
The probe stored its byte through inq[i], but inq is allocated
lazily by sockdrain - a socket that never pre-drained had inq[i]
nil, and the probe's byte-store faulted at addr 0x0. That killed
Xvfb in some sessions and the xwd client in others (t358-t362 all
ended in 'fault write addr=0x0' suicides right after a probe that
found data). The byte is now served straight to the caller's
buffer.

Git-Id: 4294a0399f66b67cb35b43f65a5fd79b7ad51e96
2026-09-08 17:13:58 -03:00
waozi 8f66d19b33 linuxrun: gate the probe alarm re-arm on an in-probe flag
Re-arming on every alarm note stormed: each re-arm fired again one
millisecond later, so the first probe left a permanent 1ms note
chain that drowned the process (t360 froze solid mid-capture).
alarmnote now re-arms only while the EOF probe's read is actually
in flight.

Git-Id: 1f8ab77e8897088e94892643c1a95e93c22ae2d9
2026-09-08 16:36:32 -03:00
waozi 2b9555c77a linuxrun: re-arm the EOF probe's alarm from its note handler
If the 1ms alarm note landed between alarm(1) and the probe read
entering the kernel, the note was consumed and the read blocked
forever on a live writer - t359's xwd wedged exactly there, one
GetImage request sent and never a read after. The handler now
re-arms alarm(1) before returning, so even a late-blocked read is
interrupted by the follow-up note.

Git-Id: 5c68bb60a35662d6c5f2d31d2b90724b40199c40
2026-09-08 16:17:48 -03:00
waozi 4154f73240 linuxrun: rate-limit the EOF probe to 50ms per socket
The unconditional 1ms-alarm probe on every empty nonblocking recv
taxed the XCB poll loop into a crawl (t358: the whole desktop
stalled, no X traffic for minutes). The probe now runs at most
once per 50ms per socket: hot loops pay nothing, a dropped
connection is still reported as EOF within ~50ms.

Git-Id: 9c72ff8e5ec1e4f6153baf95a30f8914661a01bb
2026-09-08 15:56:58 -03:00
waozi d7ac287f76 linuxrun: report EOF, not EAGAIN, on closed nonblocking sockets
xfwm4's XCB connection spun on recvmsg returning EAGAIN forever:
when the server drops a client, the pipe's write end closes, but
sockread's nonblocking shortcut answered EAGAIN for any empty pipe
without ever finding out whether a writer was still attached - a
dead connection was indistinguishable from a quiet one.

The empty-nonblocking case now probes with a 1-byte read under a
1ms alarm: interrupted means the writer lives (EAGAIN), zero means
EOF (soeof set, return 0). A probe that finds a real byte serves
it immediately, and a known-EOF socket short-circuits to 0.

Git-Id: 60657635dbbaed8c1a78ec5853b2ff8fa4d9f605
2026-09-08 15:18:14 -03:00
waozi ae3dcf1b00 linuxrun: GDK_GL=disable in the guest environment
GTK3's X11 backend probes GLX for its windows; under the emulator
the probe's context teardown retries forever (glXDestroyContext in
a loop via the glvnd entry check - the pure-getpid spin). GDK_GL=
disable makes gdk skip client GL entirely, which xfwm4 does not
need for window management.

Git-Id: 1b6a2d2a17f3ff481dbe6f6f0a1e3aa4baef42a9
2026-09-08 14:32:40 -03:00
waozi 048773fc4c linuxrun: accept one connection per ticket, not one per pid
Xvfb logged _XSERVTransSocketUNIXAccept: accept() failed and at-spi
reported 'Could not open X display': sysaccept deduped pending
connections by client pid (servedpids), so a client's SECOND X
connection - glvnd/mesa opens one for GLX, at-spi/dbind another -
was never accepted and the server's accept spun on EAGAIN.

Connection tickets are now x.c.<pid>.<seq>.a/.b (connseq per
client), and accept consumes them by removing the /srv entries it
serves. The servedpids table and the readiness gate's dedup are
gone - a pending ticket now always means a waiting client.

Git-Id: 3e6e3ea6757587305b417f8688799dd644fe63f3
2026-09-08 13:50:56 -03:00
waozi bc029c62d6 linuxrun: bp-chain walk in the spin probe
The pidcache theory was wrong (0x106 hex == 262: the cache always
held the right pid). What remains true: xfwm4's main thread re-
enters glX entrypoints forever (one getpid each, pure userspace in
between) and stalls mid-paint. To name the looping caller above
glX, the probe now walks the saved-ebp chain (guarded by the guest
segment table) at every spin hit.

Git-Id: 47c73f23327a45bb21a83a4a79f6b3daa0f80da4
2026-09-08 13:33:54 -03:00
waozi fce816b937 linuxrun: set guestprocid at guest start, not lazily
The lazy first-getpid assignment still let a clone thread adopt its
own host pid: the thread was cloned before the parent had ever
issued a getpid, so it inherited guestprocid=0 and self-assigned.
t344 showed the same 262-vs-106 cache thrash as before. Both
!started blocks (int80 and ud2 entries) now set guestprocid=getpid()
before any guest code - and thus before any clone - can run.

Git-Id: 6d1a6f654288b6326a99aa7d38f3474e75b4518a
2026-09-08 12:09:42 -03:00
waozi da9836a45d linuxrun: give clone threads one stable getpid
The widened spin probe caught the xfwm4 freeze red-handed: the
glvnd libGLX entry prologue stores getpid() in a shared pid cache
and runs __glDispatchReset whenever it changes between entries;
probe samples showed getpid returning 262 while the cache held 106
forever - two different host pids. Each clone thread is its own
host process here, so threads sharing one guest image saw each
other's pids as an endless stream of forks and reset the GL
dispatch forever (a tight getpid-only syscall loop, exactly the
freeze).

getpid (nr 20) now returns guestprocid: CLONE_VM threads inherit
the parent's value through the rfork copy, real fork/vfork/clone-
without-VM children adopt their own new pid in the fork child
branch. gettid (224) keeps the host pid so tids stay unique.

Git-Id: 1c1a437a3f389469e6c31d55cc37b7010655e282f
2026-09-08 11:58:52 -03:00
waozi b2ca067872 linuxrun: implement sched_yield; widen getpid-spin probe
The freeze loop at pc=0x6801b5a0 is now fully mapped: that pc is
ld.so's raw int80 stub reached via %gs:0x10, the return address in
[sp] lands inside libc's getpid, and the real caller is glvnd
libGLX.so 0x3b50 - the fork-check prologue every glX* entrypoint
executes (getpid, entry-count++, pid-cache swap, and on mismatch
__glDispatchReset + teardown, on match a sched_yield drain-wait).
epoxy pulls libGLX into xfwm4. sched_yield (nr 158) was ENOSYS; it
now returns 0. The spin probe fires on getpid/getuid/sched_yield
from the interp stub and dumps the result, glvnd's pid-cache and
entry-count (0x42bd10dc/0x42bd10e4 this session), and 16 stack
words to name the looping caller above glX.

Git-Id: 42f8e0e91d1c58ce2a878a54c8f0351e9c2b3ec0
2026-09-08 11:46:17 -03:00
waozi 174b968aab linuxrun: log CLONE_SETTLS installs and load the child's %gs
syssetthreadarea succeeds (-> 0) for every clone child, and the child
now gets its segment register loaded the way a kernel CLONE_SETTLS
would (glibc's i386 TLS lives in %gs; the bounced child had nothing
loading it).  That said, t341 shows the getpid spin persists unchanged
- and crucially the spin runs in the MAIN thread (p277), at ld.so's
raw int80 stub, while the seven clone children install TLS cleanly.
So the TLS-descriptor theory for the spin is disproven; the loop is
ld.so-side in the main thread (lazy-PLT or version-resolution path
suspected) and identifying it needs the guest's register state or
memory at the freeze, not more syscall tracing.
2026-09-08 11:10:12 -03:00
waozi 88eec7ab0b linuxrun: the getpid spin runs at ld.so's raw int80 stub
The pc-tagged TAIL probe places the window manager's stall at
interp+0x1b5a0 - disassembly shows that is ld-linux's 'int $0x80; ret'
raw syscall stub (the same address the closed-pipe notes have carried
all along as their second pc).  A thousand getpid calls from the
dynamic linker mean the guest is looping inside ld.so - most plausibly
a TLS fixup/relocation re-entry, e.g. the FcInit worker's TLS descriptor
never installed so every thread-local access re-enters the resolver.
Next: log syssetthreadarea's success in clone children and inspect the
lazy TLS resolution path (bp values sit in the guest heap).
2026-09-08 10:46:33 -03:00
waozi 845f70ca8d linuxrun: name the WM's stall - a pure getpid spin
The widened syscall-tail probe (16 entries) settles what the window
manager does at its freeze: its entire syscall stream becomes getpid,
sixteen for sixteen at every 2000-syscall checkpoint - a userspace
spin loop (the 'cheap syscall yield' idiom), not a block in any I/O
call.  The X pipe even holds a byte for it.  The spin most plausibly
waits on a condition our emulation never satisfies (a glib/at-spi wait
on shared state); identifying the loop needs a guest backtrace - the
next session should dump the WM's pc/bp chain at the freeze rather
than its syscall stream, since syscalls no longer distinguish it.
2026-09-08 10:25:59 -03:00
waozi 9cb262fc02 linuxrun: name the WM's blocking syscall in the FLOW trace
The FLOW lines now carry the last six syscall numbers, so the window
manager's client-side block (server alive, one byte pending) is
identifiable from the next session's log directly.
2026-09-08 09:53:36 -03:00
waozi 6cd0b0cb58 q9: dump the whole server log - the freeze is client-side after all
With the full (previously truncated-at-260-lines) xvfb.log, the server
tells a different story than assumed: its xkbcomp fork chain completes
(FMEM copy done, twice), it stays alive cycling recvmsg polls, and it
wrote 70 reply batches to the window manager's socket - while the WM's
read flow froze at 1323 with ONE byte still pending in the pipe.  The
server is not the one withholding a reply; the window manager blocks in
some non-socket syscall of its own after its 1323rd read, with data
waiting.  Next probe: print the client's last syscalls (sysring tail)
alongside its FLOW lines to name the blocking call.
2026-09-08 09:50:33 -03:00
waozi 72681db4ce linuxrun: instrument the fork bounce and EAGAIN/mmap paths
Bisecting the window manager's remaining freeze: every one of xfwm4's
startup forks (the g_spawn'd helpers) completes the full handshake -
child bounces, (snapshot only for non-CLONE_VM), forkready posted,
parent resumes - seven in a row in t336.  The write-flow freeze that
follows (wr~35, pipe empty) is therefore NOT a fork handshake hang.
The probes committed here (FBOUNCE/FCHILD/FMEM lifecycle, E11 for
every -11 syscall, MAP for every mmap with mapbump, CLONE with flags)
pin the next search to the server's reply path; note for the next
session: the script's xvfb-log dump is truncated at 260 lines and the
server's SEQ trace likely lies beyond it - widen the dump first.
2026-09-08 08:54:21 -03:00
waozi 4fad61608a linuxrun: report a finite RLIMIT_STACK - the window manager stops aborting
The EAGAIN probe found the last blocker before a live window manager:
pthread_create mmaps the default thread stack derived from RLIMIT_STACK,
and our getrlimit answered infinity for every resource - so glibc asked
for a 2GB stack (mmap len=0x80001000, observed failing with ENOMEM),
reported it as 'creating thread: Resource temporarily unavailable', and
GLib aborted pango's FcInit worker, killing xfwm4 during GTK init in
every progressing session.  RLIMIT_STACK (resource 3) now reports 8MB;
t334 is the first run of the whole effort with no GLib error and no
guest abort - the window manager survives GTK startup.

The frame map still does not complete (captures show the client window
undecorated; the WM's write flow still freezes after ~35 batches with
the pipe empty) - that protocol-level question is what remains.
2026-09-08 08:18:05 -03:00
waozi b8f7604127 linuxrun: clock_getres is not epoll_ctl; implement clock_nanosleep_time64
The 'observed epoll_ctl variants' 266 and 406 were never epoll at all:
266 is __NR_clock_getres - the trace's 'garbage' ctl args were a
stack buffer pointer - and 406 is __NR_clock_nanosleep_time64, whose
ENOSYS return aborted pango's FcInit worker and took the whole window
manager down with 'creating thread: Resource temporarily unavailable'
(t329: the last guest action before the GLib abort).  clock_getres now
reports 1ns into the caller's timespec, and clock_nanosleep_time64
sleeps per its (clk, flags, request, remain) argument order - t330's
host crash read the clock id as the request pointer.

The FcInit thread still fails with EAGAIN from another source
(t331: no unimplemented syscall precedes it now); the next probe is
logging every -11-returning call in the window manager during thread
creation.
2026-09-08 06:58:46 -03:00
waozi 13953cb995 linuxrun: rebuild the fork child from the parent via /proc/mem - the X server lives
The fork snapshot now detaches the child's guest segments, reattaches
them fresh, and pulls the parent's pages through /proc/<ppid>/mem -
RAM speed instead of a ufs-backed file that trickled 200MB at ~500KB/s.
The parent stays parked only for the seconds that copy takes: the child
runs guest code (dash) on the image before exec, and a torn copy
null-derefs (t324), so the early-release experiment is reverted.

t326 is the payoff, the first fully-progressing session since the
stall appeared: the xkbcomp children compile the keymap and exit 0,
the server enters its accept loop (listener gates cycling on both
listeners), clients complete full X setup (233 traced exchanges), and
the captures render a live xeyes window again.  The window manager
still has not mapped its frames - that hunt continues - but the
non-deterministic parked-server stall that consumed the last dozen
sessions is gone.
2026-09-08 04:51:58 -03:00
waozi f310961c40 linuxrun: release the fork parent before the snapshot; Xvfb's real wait named
The parent no longer parks on forkready while the child grinds the
image snapshot - the child posts the handshake first, because the
detach/reattach touches only its own mappings and every fork in this
workload execs (which discards the copy).  t323 then showed the whole
truth in the server's own log: Xvfb registers its listeners (epoll_ctl
ADD fd 5, fd 9) and blocks reading xkbcomp's OUTPUT pipe - so the
server is gated on the child finishing a snapshot measured at 200MB
(the map segment's touched pages, not the earlier 60MB estimate)
trickling through the ufs /tmp.  No linuxrun-side trick can make that
fast: the child must run guest code between fork and exec, so the
image must be live.  The honest fix is kernel-level lazy COW for
segattached memory segments on rfork without RFMEM - a plan9 port
change, recorded here as the named next step.
2026-09-08 02:34:26 -03:00
waozi 6949739be9 linuxrun: the stall was the fork snapshot all along; never park the parent
The fork-handshake probes closed the case: the X server forks xkbcomp
twice at startup (FPARK) and parks on forkready while the child copies
its 60MB image snapshot page-by-page through the ufs-backed /tmp -
observed growing at ~500KB/min, i.e. hours - or, when the snapshot
create fails outright, the child exited WITHOUT posting forkready and
the parent parked forever.  That single mechanism produced the zero-
accept, zero-epoll 'early stall' and the parked-Pread server state.

The child now posts forkready on every snapshot-failure exit, so the
parent can never be orphaned on the handshake whatever the snapshot
costs.  Making the snapshot itself fast remains open: segattach of a
RAM scratch is refused both inside the child's note handler and (when
attached at startup) it starves the note stack's own attach; a kernel-
COW fork (private 'memory' segments + RFMEM for CLONE_VM) was built
and ran but left the server equally quiet, so it is reverted here in
favor of the stable snapshot machinery.
2026-09-08 01:39:01 -03:00
waozi 769fd102e9 linuxrun: the stalled server never registers an epoll watch
Probes on the epoll_ctl store, the epoll_wait listener gate, and
listenqueued's verdict settle the early stall's shape further: in a
stalling run Xvfb executes no epoll_ctl of any variant, the listener
gate never even runs, and no accept happens - while the clients post
their connections and wait.  The server's wait loop must be going
through select (case 142, unprobed) or it is parked before the socket
loop entirely; instrumenting select's entry and its listener handling
is the next one-run step.
2026-09-07 11:57:32 -03:00
waozi 5ad273b4c0 linuxrun: probe accept4; the early stall is a missing accept
The accept4 (syscall 364) probe settles where Xorg's accepts go - and
exposes the non-deterministic early stall's shape: in stalling runs
Xvfb executes accept() not even once (ACC4 never prints) while the
clients complete their handshake write and then wait forever for the
setup reply.  In progressing runs the same binary accepts normally.
The listener-readiness gate in epoll_wait (listenqueued: /srv scan
for unserved x.c.<pid>.a twins) is the remaining suspect for the
missing wakeup - the next step is logging the gate's verdict inside
Xvfb's epoll waits.
2026-09-07 10:59:31 -03:00
waozi 9a9b22087b linuxrun: retry bridge writes interrupted by notes; pid-tag the trace
plan9 notes delivered while a bridge write is blocked (the handled
closed-pipe note among them) interrupt the write; returning an error
there made libxtrans abandon half-written replies and the client wait
forever for the rest of a big reply.  Writes now retry on 'interrupted',
as POSIX intends.  Trace prints carry the host pid and log small reads
regardless of opcode, which exposed the stall's true shape: the window
manager spends its last activity reading a big reply body in 160-byte
chunks (first byte stepping 165,166,...) before the stream stops with
the pipe empty on both sides - the server abandons the reply some
other way than interruption, so the hunt continues server-side.
2026-09-07 08:15:37 -03:00
waozi 70c7f3dc8b linuxrun: drain-before-write on the bridge; report POLLHUP; fix the diagnosis
Guest writes through bridge sockets now first drain the process's own
readable pipes into per-socket receive buffers (served to subsequent
reads, counted as readable), so a peer blocked on a full pipe always
completes - the two-pipe write deadlock cannot form without any
nonblocking-write primitive.  Poll also reports POLLHUP|POLLIN once a
read gives EOF, so a closed connection surfaces to xcb instead of
hanging it silently.

The instrumentation added along the way (per-socket flow counters with
buffer/pipe occupancy) overturned the working theory: at the window
manager's stall the pipe is EMPTY on both sides - the server simply
stops replying with the connection open, pointing the next
investigation at the server's request processing (GrabServer is among
the last requests sent), not at transport deadlock.
2026-09-07 06:21:11 -03:00
waozi 50cb57119f linuxrun: third deadlock fix fails the same way; name the real one
Per-socket output buffering flushed at the wait loops was built and
tested: guest writes enqueue and never block, but the flush write can
still block, and with the server and the client each mid-flush on the
other's full pipe they wedge exactly as before (t304: the window
manager's read flow stops at a tenth of its previous run).  plan9
pipes simply offer no nonblocking write.  The honest fix is to change
the bridge transport itself - a shared-memory ring both endpoint
processes poll and drain without blocking - recorded here as the
fourth and remaining approach.
2026-09-07 02:29:31 -03:00
waozi ab0a6e5f49 linuxrun: document the bridge write-deadlock and the fixes that failed
Guest writes through the AF_UNIX pipe bridge can block the whole
emulator when the pipe is full; with the X server mid-reply and a
client mid-request this wedges both sides (traced live: the window
manager's extension queries stop, the server's reply stream stalls,
then all traffic).  Two remedies were built and tested to failure:
qlen-capped partial writes (a writer cannot stat the opposite end's
queue) and alarm-interrupted writes (the alarm note derails the nested
syscall-note handling).  The comment left at the write path names the
viable design: per-socket output buffering in the emulator, flushed by
readiness signaled over a control channel between the endpoint
processes.
2026-09-07 01:09:16 -03:00
waozi bb98a43bc1 linuxrun: a fork child never continues the parent's X session
Every guest fork in this workload execs immediately (xkbcomp, dash,
g_spawn helpers, xterm's shell), so the child closing its inherited
bridge descriptors on the bounce is safe - and it removes the race
where a child still holding the parent's pipe ends could steal its
replies or close the connection underneath it.  Exec keeps the
CLOEXEC-precise close; captures verified stable twice.
2026-09-06 17:56:30 -03:00
waozi b618b95684 linuxrun: honor FD_CLOEXEC across exec; restore captures
The blanket close of bridge descriptors on execve broke captures
outright; the precise rule is what Linux does - fcntl F_SETFD marks
are now remembered per descriptor, and exec closes only the bridge
fds the guest actually marked.  Captures land again with all session
processes surviving, and the dbus/at-spi helper inheritance fix
stands ready for helpers that use the flag.
2026-09-06 17:01:21 -03:00
waozi 4a46b51b33 linuxrun: track X sequence numbers; close bridge fds on exec
The sequence trace settled the stream-corruption mystery: every reply
read and every request written by xfwm4 appeared exactly TWICE - its
forked helpers (the dbus-launch/at-spi children GTK spawns at startup)
inherit the X socket placeholder and the bridge pipe ends.  Both
processes then race on the same pipes: the helper steals replies the
window manager is waiting for, both read the same data across the two
readers, and the helper's exit closes the pipes under the parent (the
closed-pipe notes).  Linux marks X sockets CLOEXEC for exactly this
reason: execve now closes every bridge descriptor and clears the
socket table in the exec'd image.

The trace also shows the capture slowness: each GTK-side fork copies
its ~70MB of touched pages through the u9fs-backed /tmp (lrsnap.*
files), which stalls the session under load - the snapshot needs a
fast scratch (a pre-reserved segment or a ramfs path) next.
2026-09-06 13:15:49 -03:00
waozi c339494957 linuxrun: X-protocol lifecycle tracing over the bridge sockets
Trace the frame-management ops a window manager issues: the first
byte of every request written (MapWindow, MapSubwindows,
ReparentWindow) and every event read back (Expose, MapNotify,
ReparentNotify, ConfigureNotify), plus periodic per-socket byte-flow
counters, all landing in each process's stderr for post-mortem.

What the trace shows so far: events do flow back to xfwm4 (it receives
the full Map/Reparent/Configure sequence), but its outgoing request
flow freezes after ~35 requests while reads continue - it blocks
waiting for a reply that never arrives - and intermittently the pango
FcInit worker-thread creation still fails with EAGAIN and aborts GTK
at startup.  Both are now precisely observable for the next round.
2026-09-06 10:24:01 -03:00
waozi 8475112bd0 linuxrun: give GTK its half-gigabyte back; prove the closed-pipe handler
The 128MB map region exhausted under a full GTK stack: the pango
FcInit worker's pthread_create failed with EAGAIN and GLib aborted the
program ('GLib-ERROR: creating thread', surfaced as the mysterious
late-session death of every XFCE component).  Restore the 512MB map
with ld-linux at 0x68000000 - the combination that previously held a
full desktop session for fifty minutes.

With that, xfwm4 runs stably through whole sessions: it takes over
the root, reparents the existing client windows (the captures turn
empty as the client is unmapped into its frame), and both xwd
captures complete cleanly.  The frame re-map after reparenting is the
remaining gap before decorations appear in screenshots.

The closed-pipe note handler now prints when it matches, so survival
across dead-client writes is observable.
2026-09-06 05:53:05 -03:00
waozi d9bdcf6adb linuxrun: report execute bits in stat; survive writes to dead sockets
stat64/fstat64 claimed every regular file is r--r--r--, so xterm's
shell validation (a regular file with an executable bit) rejected
/bin/sh itself and exited at startup, and any helper search that
checks executability saw a rootfs with no programs at all.  The mode
now carries the x bits of the underlying file.

The kernel's "write on closed pipe" note took its default disposition
and killed whichever process touched a dead client's socket - on
Linux every toolkit ignores SIGPIPE and expects EPIPE, so the note is
now handled.  (One delivery path still escapes the handler and kills
GTK clients late in a session; the trigger and a remaining X-reply
parse corruption are under investigation.)

Also ship an /etc/shells and fix the rc test-negation in the capture
script: plan9 rc lexes '!test' as one word, which silently skipped
every guarded xwd retry.
2026-09-06 03:25:12 -03:00
waozi d48c97308e linuxrun: zero recvmsg's ancillary fields; xterm's set[eu]gid
The kernel reports "no ancillary data, no flags" by clearing
msg_controllen and msg_flags on recvmsg return; leaving the caller's
values in place let CMSG_FIRSTHDR walk uninitialized stack as a
cmsghdr - when the stale bytes looked like SCM_RIGHTS, xcb copied a
garbage fd-count into its fd array and died of the wild pointers that
followed.  With both fields zeroed, xwd captures the root window while
a GTK client (xfwm4) is connected, which never survived before.

xterm exits at spawn when seteuid/setegid fail; the setresuid32 and
setresgid32 calls now succeed like the rest of the identity group.
2026-09-06 01:02:43 -03:00
waozi 9d78cd98c1 linuxrun: honest socket readiness, ptys, and the syscall surface a GTK desktop needs
The X bridge used to report every polled fd ready; xcb then read
before writing its setup request and both ends of the connection
blocked forever.  Readiness for a bridge socket now comes from the
pipe's stat length (pipestat reports qlen), poll(2) blocks until
something is actually ready, select(2) was rewritten with the same
honesty instead of clearing caller bits, and epoll_wait no longer
replays registration flags like EPOLLET back as events (Xorg read
them as socket errors and dropped every client).  Socket reads honor
the guest's O_NONBLOCK and return EAGAIN instead of blocking.

The listen/setsockopt socket calls no longer fall through into
getsockopt's optval write, which used to dereference stale stack
beyond the two-word listen argument array and zero the first word of
whatever pointer lived there - on Xvfb that was the listener's
transptr, crashing TRANS(Accept) with a NULL+0x20 fault.  getsockname
and getpeername answer with the bridge path, sendmsg/recvmsg work
through the direct syscalls as well as socketcall, and dup/dup2 keep
the socket table mapped.

To make a full desktop session viable: the guest map segment grows to
128MB, ld.so loads clear of it, clone children install their CLONE_SETTLS
descriptor (without one the first stack-canary access trips the
protector), the fork snapshot copies only touched pages through a
scratch file (a 500MB+ guest can no longer malloc or segattach a
spare copy in the note handler), and statfs64 fills exactly the
84-byte i386 buffer - the previous 120-byte fill smashed the caller's
stack and aborted every GTK program at startup.  Fake ptys (two pipe
pairs through the socket table), termios ioctls, inotify, eventfd and
friends let xterm spawn a shell and GLib start its worker threads.

Verified in QEMU boots: Xvfb serves clients through the bridge, xwd
captures a 1024x768 root screenshot with xterm's window visible at
+120+120, and xfwm4, xfdesktop and xfce4-panel all initialize and stay
alive for the length of a session.  A remaining bug garbles the reply
stream when a client sends while a large GetImage reply is still in
flight, which kills xwd in the full-session screenshot; the
capture-by-single-client path is the reliable workaround.
2026-09-05 06:02:45 -03:00
waozi d595f5c530 Scan /srv by length and decode writev/readv socket fds
The marshaled /srv directory stream carries NUL bytes in its
qid/type fields, so the listener-readiness strstr stopped at the
first one and never saw the client's x.c.<pid> queue entries -
the observed 'LSRV n=522 hit=0' while ls /srv showed the entries
present.  Both the readiness check and the accept scan now use a
length-delimited memfind over the bytes actually read.

readv/writev bypassed the socket-descriptor table and wrote X
requests into the placeholder file descriptor instead of the
bridge pipe, so a connected client never actually sent anything;
they now run through sockreadfd/sockwritefd like read/write.

Also bounds the epoll idle yield to after 64 consecutive empty
polls.  linuxrun-smoke stays green.
2026-09-04 07:59:13 -03:00
waozi 936d819764 Keep socket placeholders off stdio; yield in zero-timeout epoll_wait
The exit-status trace showed the silent exits were Xvfb aborting at
transport open: parking socket placeholders at 200+ via dup failed
inside the guest, so every socket() call died.  Placeholders are
again the first real fd, bumped past 0-2 so a placeholder never
lands on stdio (fd 0 routed every stdin read through the socket
map).  With that, Xvfb again reaches its server loop with a
compiled keymap, the xkbcomp children exit 0, and server and
client both stay alive across long runs.

epoll_wait with a zero timeout now sleeps a millisecond when it
has no events: the X server's scheduler polls epoll_wait(0) in a
tight loop and starved every other guest process, wedging the
boot before the test script could finish.  linuxrun-smoke stays
green.
2026-09-04 04:39:34 -03:00
waozi a4404cdaff Fix the /srv queue name mismatch and descriptor collisions
The client posts its pipe ends as /srv/x.c.<pid>.a and .b, but both
the epoll listener-readiness check and the accept scan searched for
the string 'x.a.' from an earlier design - the listener was never
reported ready and the accept never found the queued connection, so
the X server sat in an empty epoll loop while the client waited.
Both now scan for x.c.<pid>.a with its x.c.<pid>.b twin.

Socket placeholders are parked at descriptor numbers 200+ (via dup)
instead of the first free fd: a placeholder landing on fd 0 put
every stdin read through the socket map (observed as 'RD 0 to 0'
reading a zero packed pair).  linuxrun-smoke stays green.
2026-09-04 02:22:49 -03:00
waozi 447e43edff Map guest sockets to real descriptors; honor poll timeouts
Guest socket descriptors are real plan9 fd numbers backed by a
translation table to the bridge's pipe pairs: synthetic high ids
leaked into guest pointer slots and crashed libc writes through
them.  socket/accept allocate the slot (a #c/pid placeholder),
connect fills in the packed pair, close releases it, and the
read/write decoders consult the table.

poll now honors its timeout - a negative timeout means block, and
returning instantly from such polls made X clients spin at 100%
cpu and starve the server.  sendmsg/recvmsg follow msg_iov at
msghdr offset 8 instead of treating the msghdr itself as the
vector array, and getsockopt writes its optval only through sane
pointers (SO_ERROR checks after a nonblocking connect).

With this, Xvfb accepts a client, survives, and both server and
client sit properly blocked in their event loops.  linuxrun-smoke
stays green.
2026-09-03 23:55:57 -03:00
waozi 62fde5e720 Complete the AF_UNIX bridge: direct socket calls, srv-scanning accept
Modern i386 glibc also issues the direct socket syscalls (359-371),
so socket/bind/connect/listen/accept4/sendto/recvfrom now route to
the same handlers as the socketcall multiplexor - without this the
X server's accept() went to an unimplemented syscall and failed on
every call.

accept no longer blocks or leans on the host filesystem: the client
connect posts both of its pipe ends to /srv (x.c.<pid>.a/.b), and
the accept scans the /srv directory - kernel-global and never
blocking - for a pending client, returning EAGAIN when none is
queued, exactly what the X server expects of its listener.  The
epoll listener entry is reported readable only while such an entry
exists, and with a directory buffer large enough to see past the
stock /srv entries (they sort before x.*).  Client descriptors now
pack the client's own pipe ends: read from s2c[0], write to
c2s[1]; the opposite ends are the server's.

With this an X client connects, the server accepts, and the X
exchange begins (xwd spins up 8+ minutes of CPU processing the
session).  linuxrun-smoke stays green.
2026-09-03 20:50:57 -03:00
waozi d63e344910 Give epoll descriptors synthetic numbers
epoll_create handed back a real plan9 fd whose number could collide
with the guest's own descriptors, so the epoll_ctl registrations and
the epoll_wait calls ended up keyed to inconsistent epoll ids and the
X server's wait never reported its listener.  Synthetic high ids keep
them stable, and with that an xterm connects to Xvfb through the
AF_UNIX bridge.
2026-09-03 16:42:22 -03:00
waozi e50b02a454 Deliver gated int 0x80 notes immediately; AF_UNIX via /srv
The int 0x80 gate posted its 'linux sys' note and returned without
delivering it, so the guest re-executed the int 0x80 and queued note
after note; once NNOTE filled, postnote failed and the kernel killed
the process with 'suicide'.  Shells died this way right after their
signal setup.  Both gates now call notify() right after posting, and
syscalls no longer wait for a timer tick to be delivered.

The socket bridge no longer reaches through /proc/<pid>/fd (devproc
exposes fd as a file, not a directory).  The listener posts its pipe
end to /srv via devsrv (write the decimal fd), the request file
carries the srv name, and the client posts both of its pipe ends the
same way; connect and accept exchange names only.

epoll_create/epoll_ctl/epoll_wait (254/255/256) work: ctl now stores
the target fd from the third argument (it stored the op code), and
create hands back a placeholder descriptor.  vfork (190) maps onto
the fork implementation (dash vforks for every external command and
reported 'Cannot fork').  Abstract-socket connects return
ECONNREFUSED so Xlib falls back to the pathname transport, and the
guest environment carries DISPLAY.

With this, Xvfb reaches its server loop with a compiled keymap
(Xorg forks, dash runs 'sh -c xkbcomp', xkbcomp exits 0), clients
connect through the bridge, and an exec'd dynamic binary runs end
to end.  linuxrun-smoke stays green.
2026-09-03 16:31:54 -03:00
waozi c8341a9f2b Correct linux syscall numbers that gated shell startup
getppid is 64 (case 61 was ustat), and 199-202 are the *32 id
variants: getuid32/getgid32/geteuid32/getegid32.  Returning ENOSYS
for those made shells' privilege-drop checks read garbage; _llseek
is 140 and returns ESPIPE on pipes; plus wait4 (reaps via the plan9
wait with the exit status shifted into WEXITSTATUS form), getcwd,
and PATH/HOME in the guest environment.

With these, an exec'd dynamic binary runs end to end: /bin/echo
loads through ld.so, pulls in libc.so.6 from the arena, and writes
its output.  linuxrun-smoke stays green.
2026-09-03 12:42:32 -03:00
waozi 945ee85d34 Make fork and exec work under the linuxrun note machinery
Forking from inside a note handler needed several coordinated fixes:

- Kernel: notify() now stacks nested notes below the interrupted sp
  when it already runs inside the note stack, instead of overwriting
  the live outer frame.  Fork no longer replays the parent's queued
  notes into the child (a delivery before re-registration would set
  its notified state and kill it on the next trap note), and the
  child inherits the LDT page (foreign TLS entries are per-process
  state), fixing 'bad segment selector in noted' in forked children.

- linuxrun: the note-stack segment is attached 'memory', never
  'shared' - a forked child resumes at the parent's exact sp and
  would otherwise push frames over its live handler pages.  Children
  inherit the segment COW and only re-register it with the kernel
  (segment slots are exhausted by guest memory, which made fresh
  attaches fail).  The fork child resumes by bouncing off the ud2
  starter (noted() without a note kills it), the parent parks on a
  pipe until the child is on its own stack, and fd tables are copied
  (RFFDG), not emptied.

- execve: argv/path are deep-copied before the image reload detaches
  the old stack they live on, the interp is loaded once (a duplicate
  load collided with itself and left a corrupted image), the arena
  segment is re-attached after the reload, the entry no longer
  resumes at entry+2 (the handler's pc+=2 landed mid-instruction,
  which pushed a NULL stack pointer into ld.so's bootstrap), and
  countargs returns the true argc.

- AF_UNIX bridge: bind/connect read sun_path at its real offset
  (sockaddr+2, the family bytes were being used as the path), stat64
  reports directories as directories (xtrans' lstat check), abstract
  sockets fail cleanly, and packed bridge fds decode their pipe ends
  for read/write/send/recv/close.

- Syscall table: setuid32/setgid32 (Popen children _exit(127)
  without them), getuid32/getgid32/geteuid32/getegid32 (shells'
  privilege-drop logic), _llseek with ESPIPE on pipes, fcntl64,
  wait4, getppid, getcwd, umask, PATH in the guest environment.

Verified: Xvfb now forks twice, runs 'sh -c xkbcomp' children with
fully working ld.so+libc loading, and a directly-exec'd dynamic
/bin/echo produces output.  linuxrun-smoke stays green.
2026-09-03 11:59:35 -03:00
waozi b431abeb41 Read socketcall arguments from the right register
The i386 socketcall ABI passes the operation number in ebx and the
argument-array pointer in ecx; dosocketcall took a single pointer and
read a[0] from ebx - i.e. from address 1 (SOCKOP_socket) - faulting
the emulation handler as a nested note and killing the process
silently.  Split the interface: the operation selects the case, the
arguments come from the ecx array, and every subop now indexes that
array with the correct socketcall layout.  (This was the crash we
chased for two turns as a "wild jump into the loader's text" - the
death pc was always inside the handler's own dispatch, misread because
the nested-note path dies before user-space dumps can run.)
2026-09-03 04:55:34 -03:00
waozi 376ed235e0 Run the note machinery on a private stack
Plan 9 delivers notes by building the ureg/message/handler frames below
the interrupted sp - for foreign binaries that is the GUEST stack, and
glibc's lazy PLT resolver keeps live working data below its sp across
the syscalls it makes, so the note frames overwrite resolver state and
leave host pointers in guest-readable scratch (the X stack resolved one
such pointer as a call target - the deterministic jump into the
loader's own text).  A process marked via /dev/mark can now also write
the top of a user-attached segment to /dev/notestack; notify() then
builds every note frame on that private stack instead.  linuxrun
attaches 32KB at 0x5f000000 and re-attaches a pid-slotted stack in
fork children; nothing below the guest sp is ever touched by the kernel
or the emulation again.

(Attaching the stack from inside the devldt write corrupted the
writing process - the attach must happen in user space; the kernel only
records the address.)
2026-09-03 03:19:49 -03:00
waozi bd00dcab8a Point the guest fs at TLS once it exists
The guest inherits plan9's flat %fs (base 0), so an fs-relative access
would land in low linear memory - this loader's own text - which is
how the Xvfb crash signature reads (a jump to loader+0x2c20 executing
garbage, reading address 1, dying as a nested note).  After
set_thread_area installs the descriptor, syscall resumes also load
%fs with the TLS selector like %gs; the starter no longer touches fs
(selector 0x33 before the entry exists makes noted() reject the
frame and kills the process - hello.elf caught that).

Kernel debug scaffolding from the Xvfb chase (fault/register/TCB/
stack-scan dumps, gate trace) removed; the diagnostic facts it
captured: at the crash the TCB is healthy, sysinfo points at ld.so's
int80 shim, gs/fs selectors are valid, and the death is a nested note
on the syscall after uname - the next session should single-step it
under the QEMU gdbstub.
2026-09-03 00:05:05 -03:00
waozi 5b9d9e1cf4 Gate guest int $0x80 through the kernel
Plan 9's syscall vector is 0x40, so a foreign int $0x80 lands as a
general-protection trap - previously it killed the process unless the
exact site had been rewritten to ud2, which cannot reach the int $0x80
sites inside ld.so's bootstrap or inside libraries ld.so maps itself
(our mmap cannot tell text from data).  Processes marked via
/dev/mark (devldt) now have their int-$0x80 GP delivered to the note
handler as "linux sys", which emulates and advances; ld.so loads the
whole Xvfb closure and runs 366 syscalls through this gate.  The ud2
rewriting stays for the images linuxrun loads itself - the trap frame
is cleaner and the raw-syscall tests depend on it.  execve carries an
LD_BIND_NOW environment; fork children snapshot their guest memory
privately so libc's post-fork state writes do not corrupt the parent
(clone threads keep sharing).

Xvfb's remaining crash is deterministic and narrow: right after
LockServer/uname, one call goes to an unrelocated Xvfb+0x2b47 (a PIE
IFUNC/GOT edge during its own init) - the next milestone, with the
register/stack dump tooling already catching it.
2026-09-02 21:43:41 -03:00
waozi bbdc0b6a07 Teach mremap to move allocations
mremap answers MREMAP_MAYMOVE callers by copying into a fresh range
from the arena instead of failing; growing malloc arenas in the X
stack needed it.  The Xvfb bring-up frontier is now a single call
during ld.so relocation that jumps to an unrebased offset (crash at
ld.so+0x2b47 after uname) - one linker detail from the server loop.
2026-09-02 18:30:25 -03:00
waozi ea6a619898 Add the dup family and access to the syscall set
dup, dup2 and dup3 map onto plan9 dup (with a close of the target for
dup2), and access answers existence.  Part of the X11 bring-up
surface; Xvfb's glibc now walks past sigprocmask storms, lock files
and socket setup, and dies at one unresolved call (fault at an
unrebased address) after its uname - the remaining item before the
server loop.
2026-09-02 18:09:35 -03:00
waozi c7b89e4afa Carry the syscall surface the X11 stack needs
The desktop binaries need a much wider kernel interface than applets
did: AF_UNIX sockets (bridged over plan9 pipes through /proc/fd, with
bind publishing a listener and connect handing over a data pipe pair),
clone/fork (guest segments now attach as shared so children and threads
keep the image whole, and the kernel gives each fork child its own LDT
page), execve (the image is reloaded in place and registers reinstalled
so X's fork+exec of helpers works), getdents64, the epoll family
(registered fds report ready; the single-threaded server blocks in the
read that matters), poll/select, pipe, link (exclusive-create copies
for lock files), stat64 by path, mkdir, nanosleep, fcntl, a polling
futex, ioctl TIOCGWINSZ, and the uid/sid no-op set.

With this surface, ld.so resolves the ENTIRE Xvfb dependency closure
from the Debian archive (thirty-plus libraries: libGL, pixman, Xfont2,
freetype, systemd, gcrypt...) inside the Debian namespace; Xvfb starts
its glibc, passes epoll setup and lock-file creation, and dies at one
unrebased call during startup - the next fix.  scripts/fetch-xfce.sh
materializes the staged root (gitignored as fetched payload).
2026-09-02 17:53:57 -03:00
waozi 9b255a8ee7 Execute dynamically linked Debian binaries
linuxrun now loads PT_INTERP images: the interpreter lands at a fixed
base with its segments, the PIE main lands at its own, and the auxv
carries AT_BASE, a corrected AT_ENTRY describing the main program (the
entry point itself is ld.so's), plus the phdr set.  mmap honours
MAP_FIXED with a zeroing allocator, fstat64/fstatat64 report real
sizes and unique st_ino (ld.so dedups libraries by dev:ino - a zero
inode made libc.so.6 alias the main program and "load" it without ever
mapping), and pread64 joins the syscall set.

The proof runs in the Debian namespace, where the interpreter and
libc.so.6 sit exactly where Debian installs them: a stock coreutils
/bin/echo (PIE, dynamically linked against libc.so.6) prints through
ld.so, symbol binding, relocation and libc startup, and exits zero -
invoked both the kernel way (PT_INTERP) and explicitly through
ld-linux.so.2 with --library-path.  The smoke asserts the interpreter
path end to end alongside the static tiers.
2026-09-02 16:39:18 -03:00
waozi 55fc7c9dba Run Debian-archive binaries: busybox executes on Plan 9
The auxv carried AT_PLATFORM under type 33, which is AT_SYSINFO_EHDR:
glibc parsed the "i686" platform string as a vDSO ELF header and
walked phdrs through the resulting garbage pointer.  AT_PLATFORM is 15;
with that fixed, the real Debian busybox-static package (glibc, TLS,
vsyscall sysinfo trampoline) runs its applets: echo writes, uname
reports "Linux taiji ... i686 GNU/Linux", and cat copies files - the
last one needing openat, which is implemented for the AT_FDCWD form
alongside fstatat64.

The smoke now proves the whole ladder in the guest: build linuxrun,
run raw-syscall static binaries (write/exit, file I/O), exercise real
thread-local storage, then execute the Debian-archive busybox echo and
cat end to end.  Debian binaries that need dynamic linking against
ld.so are the remaining tier.
2026-09-02 01:13:14 -03:00
waozi 9984f5c020 Serve glibc syscalls through AT_SYSINFO
glibc's i386 syscall stub reaches the kernel by calling through the
TCB sysinfo pointer (AT_SYSINFO) rather than int $0x80 for part of its
startup, which our int-80 patching never sees; with no AT_SYSINFO the
pointer is null and the first such call (set_tid_address) jumps to
zero.  linuxrun now hands out an AT_SYSINFO trampoline in the mmap
arena holding ud2;ret, so those calls funnel into the same syscall
emulator as the patched sites.  Static glibc gets correspondingly
further: past TLS setup, set_robust_list/rseq probes, ugetrlimit and
into brk-driven allocation.

Debugging support for the remaining frontier: guest faults now dump
registers and stack words so the caller of a bad call is visible, and
-p/-P try AT_PHDR as the ehdr base or omitted.  The Debian busybox
still faults in static-glibc init reading a phdr through a garbage
pointer (0xc5762d24, first loop iteration, e_phnum picked up as
0x666c) whose source is independent of the auxv - the next milestone,
likely wanting QEMU gdbstub single-stepping through _dl_aux_init.
2026-09-02 00:54:56 -03:00
waozi 59356b0c5b Give foreign programs real thread-local storage
Linux binaries reach their TLS through %gs, which needs a real segment
descriptor.  The kernel grows /dev/ldt: writing 8-byte descriptors
installs per-process entries that are re-staged on every switch back
into the process.  Under QEMU the LDT path loads descriptors with a
zero base (LLDT itself works, entries verify, selectors read back, but
segment loads through it come out flat), so the same entries are also
mirrored into the unused APM GDT slots - which is how Linux itself
numbers i386 TLS (entry 6, selector 0x33) - and those work everywhere.
noted() accepts the TLS selectors for fs/gs, and the entries are forced
to user privilege with gates refused.

linuxrun answers set_thread_area by installing the descriptor (the
i386 TCB at positive offsets needs a plain 4GB expand-up segment, not
the wraparound trick), hands back entry 6, and passes a full Linux
auxv: PHDR/PHENT/PHNUM, PAGESZ, ENTRY, uid/gid set, RANDOM, EXECFN,
PLATFORM.  Guest argv is passed through.  The smoke proves the whole
TLS path with a raw-syscall test binary that installs a canary TCB,
loads %gs and reads it back through %gs:0.

Static glibc gets past TLS allocation and set_thread_area with this
(the Debian busybox-static binary from the archive is staged as a test
asset); its later startup still jumps through a null pointer, which is
the next milestone before Debian-archive binaries run.
2026-09-02 00:13:36 -03:00
waozi 2adb0fef63 Execute static Linux binaries on the Plan 9 kernel
linuxrun now runs real static i386 Linux ELF programs instead of only
inspecting them.  The loader maps the PT_LOAD segments with
segattach("memory") at their addresses (coalescing adjacent ones, since
the kernel allows only a handful of attachable segments per process),
rewrites every int $0x80 site in the executable bytes to ud2, builds
the Linux initial stack with argv and auxv, and starts the program by
bouncing off a ud2 trap whose note handler installs the entry
registers.  Each later ud2 fault is a syscall, emulated from the Ureg
registers: exit, read/write and the iovec variants, open/close with
Linux flag mapping, brk and anonymous mmap carved from one arena,
uname, pid/uid family, llseek, ioctl.  The 386 kernel has no NX, so
the mapped pages execute as-is.

The pc kernel config gains the segment driver the loader depends on,
and linuxrun-smoke now proves execution end to end: it builds linuxrun
in the guest and runs two real static Linux binaries from the tree -
one printing through write(2), one doing open/read/write/close on a
file - asserting their output.  Dynamic ELF programs (glibc, TLS,
futex) are the next milestone toward Debian-archive binaries.
2026-09-01 19:51:36 -03:00
waozi b91ea4492d Pick the namespace and then the window manager
The selector now works in two stages driven by two registries:
lib/namespaces lists the bootable TaijiOS namespaces (Plan 9, Debian)
and lib/wms lists the window managers each namespace supports (Rill and
Rio for Plan 9, Rill for the Debian root), so the matrix lives in data
instead of session commands. Enter moves from the namespace cards to
the window manager cards (headed by the chosen namespace), Esc goes
back, and the same confirming-click rule as before keeps stray clicks
from starting anything.

The old flat session catalogs are gone: web and local boots now share
the one matrix, and the profile no longer special-cases q9web. Wine
joins the registries when its namespace lands.
2026-09-01 18:35:57 -03:00
waozi 43709bdc31 Install real packages in the Debian namespace
The Debian root now bootstraps itself with the TaijiOS toolchain:
/386/bin is unioned behind the rootfs own /bin and /usr/bin, so
commands like tar and gunzip work before any package is installed and
packages extracted later shadow the TaijiOS fallbacks, not the other
way round. deb/install also accepts the data.tgz member name (plan9
gzip compresses data.tar to data.tgz, and the member scan skipped it).

debian-smoke now proves the full lifecycle with a compiled payload: it
builds a C program with 8c/8l in the guest, packs it as a gzip .deb by
the book (debian-binary, control.tar, data.tgz through ar), installs it
with dpkg --root inside the namespace, runs the installed binary and
matches its output. The Debian archive itself still needs xz/zstd
members and Linux ELF execution before its packages install.
2026-09-01 18:22:12 -03:00
waozi 1ee29938ca Add the Debian namespace as a Plan 9 workspace
debian-session builds an FHS-shaped root and binds it over /, chroot
style, entirely with Plan 9 namespaces: TaijiOS binaries and rc are
grafted at /taiji/bin, the kernel devices (cons, env, proc, srv, disks,
draw, mouse, net) appear under the new /dev and /net, and /lib is
unioned in behind the rootfs so Rill and the Kryon apps find their
config, theme and fonts while Debian payloads still write into the
rootfs. Entering the session sets root@debian identity, the Debian path
and namespace=debian.

Package installs work through the Debian pipeline: a dpkg front end in
the rootfs drives deb/install, an ar+tar .deb unpacker that extracts
data payloads into the root and records control stanzas in
/var/lib/dpkg/status (xz/zstd data members are rejected until the
decompressors exist). debian-smoke builds a real .deb in the guest,
installs it with dpkg, runs the payload and checks the status db.

The namespace selector offers Debian with Rill as its window manager
(debian-session rill), in local boots and in the web image; Rio stays
Plan 9 only. Fixes along the way: a mangled device bind was dropped,
draw/mouse devices are bound so window managers work inside, and the
session command now execs its arguments instead of feeding them to rc
as a script file.
2026-09-01 17:53:38 -03:00
waozi b716811805 Require a confirming click in the namespace selector
A single click on a session card launched it, so the click that only
focuses the emulator in the browser could start the Plan 9 session by
itself and the desktop booted into rio instead of waiting for a choice.
Clicking a card now just selects it; clicking the highlighted card
again starts it. Enter still starts the highlighted session.
2026-08-31 23:17:47 -03:00
waozi 1a86549330 Ship the control panel tools in the web image
The web image offers the Plan 9 session and carries its desktop menu,
but the binaries the menu launches were not in the root, so Themes,
Control Panel and friends were dead entries in the browser. Add
q9display, q9taskmgr and q9themes next to explorer and rio9, and have
driver-smoke assert the whole desktop binary set.
2026-08-31 22:43:11 -03:00
waozi 45bacc766c Draw the control panel tools on Kryon
Explorer, q9taskmgr, q9display and q9themes were libdraw programs that
imitated the Kryon look by scraping the th_ palette images rio publishes.
Run them on the Kryon runtime instead: the system theme drives their
colors, input goes through the runtime's mouse and key queries, and the
th_ scraping goes away. q9themes now reads the palette catalog straight
from the library, so it lists the themes the desktop actually ships
(15) instead of a stale local copy of 12.

Behavior is preserved: explorer keeps the tree, history, list and icon
views, the recycle bin with restore bookkeeping, and wctl window
launches; its menus, prompts and properties dialogs are now states of
the single frame loop instead of nested event pumps. q9taskmgr keeps
the /proc and /dev/wsys actions with one-second refresh, q9display
keeps the wallpaper and saver wctl messages, q9themes keeps the
theme kryon:... wctl message.

The four commands move into their own directories with mkfiles linking
libkryon like the rest of the desktop; the stray binary copies that sat
next to the old flat sources are gone (the installed /386/bin copies
are the real ones).
2026-08-31 20:58:53 -03:00
waozi 1c6edda116 Draw the namespace selector with Kryon
Replace the hand-rolled libdraw picker with a Kryon runtime app so the
boot selector carries the system theme and the TaijiOS look instead of
its own fixed colors: theme background, surface and button cards, hover
highlight, and Kryon's default font. Input moves to the runtime's mouse
and key queries (arrows, Tab, Enter, Esc; click a card to launch), and
the session launcher keeps the same rfork + rc semantics, including the
web catalog flag. The command moves to sys/src/cmd/nsselect with a
proper mkfile linking libkryon like the other desktop commands.
2026-08-31 19:34:31 -03:00
waozi b0a7417ee5 Fetch raylib's externals for the kryon smoke
The kryon plan9 backend now compiles kry_image_decode.c and
libdraw_audio.c against files bundled in the raylib vendor submodule, so
the smoke needs that nested checkout; the other vendor trees stay
unfetched.
2026-08-31 19:07:40 -03:00
waozi 128a85b3c0 Boot the web image into the namespace selector
The web boot set q9web=1 and glenda's profile answered by exec'ing rill
directly, so the namespace selector never ran there; nsselect and its
catalog were not even shipped in the web image. Ship nsselect, rio9 and a
web session catalog (Rill first as the default, plus the Plan 9 namespace;
Debian needs a rootfs the image does not carry), and let q9web only pick
that catalog instead of skipping the selector.

The boot menu now defaults to the desktop after 3 seconds, so the page no
longer injects keys to pass it; that stray Enter used to dismiss the
selector right after it appeared. An explicit ?boot=N still picks a menu
item.

Drop the hero copy card that overlay the running emulator: the VM
autostarts, so the card only covered the desktop.
2026-08-31 19:06:45 -03:00
waozi 93b9e2e5ad Move the apps onto the shared plan9 rules and the Kryon data root
Both app mkfiles now include kryon's mk/plan9-app.mk, the Kryon
library carries KryAppDataRoot for the per-user data policy, and both
binaries are rebuilt against them.
2026-08-31 18:42:17 -03:00
waozi b04f6d65cc Build Inner Breeze and Pass from k2c --plan9 output
Both apps now generate their Plan 9 C directly from the Kryon
compiler's plan9-safe mode - the per-app rewriter scripts are gone and
the binaries are rebuilt from that output.
2026-08-31 17:44:52 -03:00
waozi 2b80c5182d Allow optional TaijiOS web payload files 2026-08-31 16:52:50 -03:00
waozi 81816a0ad4 Move site deployment to Cloudflare Pages 2026-08-31 16:48:31 -03:00
waozi 4a50aff198 Add a native Plan 9 smoke for the Kryon library
Boot the tree under QEMU, rebuild libkryon.a with 8c, compile, link,
and run a probe covering SHA-256, JSON, and the theme catalog, and
link Rill to exercise the app-facing library surface end to end. Runs
as make kryon-smoke and in CI: on pushes that touch the desktop stack,
daily against kryon master regardless of the taiji pin, and on demand
for any kryon ref. This is the check that would have caught the kryon
master Plan 9 build breakage immediately.
2026-08-31 15:14:39 -03:00
waozi b790958a14 Complete the web image whitelist directories
The web-boot root extractor needs an explicit record for every parent
directory of appended files: carry the Rill registry files and the app
icons with their directory chains, plus the ape library, header, and
script parents whose records were silently failing to extract.
2026-08-31 14:42:13 -03:00
waozi afabcf823d Preinstall Inner Breeze and Pass
Inner Breeze and Pass join Shelf, Rill, and ktrem as preinstalled
Kryon applications: each builds from its source under /sys/src with a
plan9 mkfile, installs to /386/bin, and appears in the Rill launcher
and the q9 desktop menus. Rill now reads its launcher list from
/lib/rill/applications with icons through /lib/rill/icon.map instead of
a hardcoded list.

The web boot image grows to carry the new applications: the image
builder rewrites the gzfilesystem header and partition map wholesale
and extends the raw image when the preinstalled set outgrows the base
partition, and the whitelist carries the app binaries, the Rill
registry, and the app icons.

Also refresh libkryon.a from kryon master (Plan 9 fixes for the newer
UI toolkit surfaces, cursor calls, rename, SIZE_MAX, ksync crypto) and
teach the Rill build about ktrem's app chrome and the shelf host
symbols.
2026-08-31 14:17:38 -03:00
waozi 3554e28b5d Bump kryon and rebuild libkryon.a
Picks up the Plan 9 fixes on kryon master (fmaxf/fminf shim, 8c-safe
form rows and scaffold code, rename and SIZE_MAX shims) and the
app_storage object Pass needs.
2026-08-31 12:09:24 -03:00
waozi 71175bb04d Make web boot launch TaijiOS full page 2026-08-30 10:48:23 -03:00
waozi da76bd842c Add TaijiOS banner and fix site CI 2026-08-30 04:36:49 -03:00
waozi 041501d00d Position TaijiOS as Kryon Labs flagship OS 2026-08-30 04:24:14 -03:00
waozi 2f8c3ef591 Fix namespace handoff into Rill 2026-08-27 22:45:31 -03:00
waozi d50139f5d0 Improve Rill menu startup support 2026-08-27 19:00:59 -03:00
waozi 3f3e8d3238 Add namespace session selector 2026-08-27 15:26:47 -03:00
waozi bcb566e8d7 Expand linuxrun ELF analysis
Teach linuxrun to decode ELF program headers, report load segments and unsupported dynamic/TLS cases, and provide analyze-only and built-in smoke modes.

Add linuxrun smoke helper targets and ignore generated pcvirt/linuxrun build byproducts.
2026-08-27 14:03:18 -03:00
waozi 36e956a37b Improve TaijiOS Linux compatibility support
Add APE source compatibility helpers for common Linux/POSIX APIs, introduce linuxrun as the Linux ELF inspection entrypoint, and add a lean pcvirt kernel profile for virtio-backed VM runs.

Add scripts/taiji-support.sh plus Makefile targets to verify the support stack through q9.
2026-08-27 13:51:32 -03:00
waozi 22fd9aca24 Update Rill application menu 2026-08-26 06:06:18 -03:00
waozi 2ca8bfeb7c Update Rill XLibre task backend 2026-08-26 05:36:02 -03:00
waozi 4799c65a05 Refresh web boot cache headers 2026-08-26 05:12:18 -03:00
waozi 718e1038e3 Add q9 hardware diagnostics 2026-08-26 05:03:39 -03:00
waozi 2b2d4a0006 Make q9 NIC model configurable 2026-08-26 04:50:25 -03:00
waozi f9f4d8f3ea Add q9 driver smoke test 2026-08-26 04:26:43 -03:00
waozi b039c21400 Rename terminal submodule to ktrem 2026-08-26 04:12:43 -03:00
waozi b0654cc773 Add TaijiOS POSIX compatibility layer 2026-08-26 03:45:41 -03:00
waozi 3951eff73d Fix web asset cache headers 2026-08-26 02:29:04 -03:00
waozi 7ee6206a50 Prevent stale web boot assets 2026-08-26 02:24:47 -03:00
waozi eeb8c69d07 Launch TaijiOS desktop in web boot 2026-08-25 23:51:43 -03:00
waozi 55cf776409 Block Netlify badge overlay 2026-08-25 22:00:41 -03:00
waozi e4aabb6966 Fix Netlify site ID env 2026-08-25 20:48:07 -03:00
waozi e5af580206 Fix TaijiOS web boot path 2026-08-25 20:45:17 -03:00
waozi f1a39e4db0 Commit remaining Taiji changes 2026-08-25 19:30:20 -03:00
waozi b3ec9039a3 Rename terminal launcher to ktrem 2026-08-25 19:09:21 -03:00
waozi 7e9450c17c Move Rill to Kryon Labs submodule 2026-08-25 18:57:57 -03:00
waozi 9db3cf62ff Speed up Shelf opens in Rill 2026-08-25 18:46:27 -03:00
waozi 38b71861ba Use Rill desktop for q9 2026-08-25 18:38:37 -03:00
waozi 3511b1842b Route kterm commands through Rill 2026-08-25 16:33:50 -03:00
waozi ce2572fb2d Use host-safe embedded Kterm in Rill 2026-08-25 16:15:15 -03:00
waozi 2f1fc2e4dc Embed native Rill app hosts 2026-08-25 15:59:49 -03:00
waozi ce0f58f37c Integrate Rill desktop apps 2026-08-25 15:47:40 -03:00
waozi 63936c38c2 Bump Kryon for system theme ownership 2026-08-23 22:19:15 -03:00
waozi 50228b560a Bump kryon: drop the unused Clay dependency 2026-08-23 13:42:49 -03:00
waozi 05fd405192 Bump kryon: pushed native plan9 build and install target 2026-08-23 09:44:10 -03:00
waozi cecc073818 Bump kryon: plan9 build fixes and header regeneration 2026-08-23 01:42:06 -03:00
waozi e2220b028c rio: Kryon-native desktop theming with the system Kryon library 2026-08-23 01:38:56 -03:00
waozi 2f2918390d q9: interactive harness for the win2k desktop
- verify.sh boots the VM and pixel-checks the welcome balloon,
  live window drag, task manager chord, icon drag with persisted
  positions, icon menus and the My Computer launch
- monclick.sh gains hover, right click, double click and drag
  helpers plus monkey() for monitor-injected keys, which are far
  more reliable than VNC key events
- the smoke suite closes the run dialog and drives the task
  manager chord through the monitor channel
- vncsend.py primes the VNC connection before sending keys
2026-08-17 23:58:11 -03:00
waozi ea3894d1c8 explorer: menu bar and My Computer view
- File/Edit/View/Help menu bar with dropdowns: New Window, New
  Folder, Close; Cut/Copy/Paste/Select All; Large Icons/List and
  Refresh; About
- My Computer special view: Local Disk (C:), Floppy (A:), CD-ROM
  (D:), Control Panel, Recycle Bin, My Documents with drive icons;
  unreachable drives report 'not accessible' like win2k
- the My Computer desktop icon opens the new view
2026-08-17 23:58:11 -03:00
waozi 0662c8fb76 rio: full win2k desktop - live drag, balloons, complete icon support
- desktop icons can be dragged anywhere; positions persist in
  $home/lib/deskicons, Arrange Icons re-grids and forgets them
- right click on an icon opens its own menu (Open, Delete Icon,
  with deletions remembered in $home/lib/deskdel)
- the Recycle Bin icon shows crumpled paper when the bin holds
  anything; Empty Recycle Bin refreshes it
- window moves are live: originwindow blits the window with its
  pixels during the drag and a single wresize restores invariants
  on release (rubber band is gone)
- tray balloon tips: a welcome balloon after logon and feedback
  when the theme or wallpaper changes via wctl
- double click tolerance widened to 900ms for remote/VNC pointers
- fix Ctrl+Shift+Esc: plain Ctrl+Esc no longer swallows the chord
- hourglass cursor while a launch is in progress
- splashdone wakeups cover every waiting thread
2026-08-17 23:58:01 -03:00
waozi 47e2e04e3d q9: smoke tests for the win2k shell features
Boot 1 of the suite now also checks the desktop icons, the
populated Programs submenu, the Run dialog, the Ctrl+Shift+Esc
task manager and the desktop context menu. monclick.sh gains
hover and right click helpers, vncsend.py can hold modifier keys
for chorded shortcuts.
2026-08-17 17:53:12 -03:00
waozi d80b14f5d1 q9: start menu programs, desktop icon registry, control panel fixes
- /lib/q9/programs feeds Start > Programs (acme, terms, games...)
- /lib/q9/desktop lays out the default desktop icons: My Computer,
  My Documents, Recycle Bin, Control Panel, Acme
- Control Panel System no longer says lola; Display launches
  q9display
2026-08-17 17:53:12 -03:00
waozi c401ae3a52 q9display, q9taskmgr: control panel applets
- q9display: win2k Display Properties with Background, Screen
  Saver, Appearance and Settings tabs; applies through the new
  wctl wallpaper/theme/saver commands
- q9taskmgr: win2k Task Manager with Applications (End Task via
  wsys), Processes (End Process via notes) and Performance tabs
  graphing /dev/cputime and /dev/swap
2026-08-17 17:53:05 -03:00
waozi 9a0fdece08 explorer: file management and the recycle bin
- Back/Forward toolbar buttons with a directory history
- right click menus for items and the background
- New Folder and Rename through a win2k style prompt dialog
- delete moves files to $home/.trash with an origin record; the
  Recycle Bin tree entry lists them with Restore and Empty
- copy/cut/paste, properties dialog, selection in list and icon
  views, Enter opens and Del deletes the selection
- files open in jot instead of acme
2026-08-17 17:53:05 -03:00
waozi 2d11e7c430 rio: win2k desktop and shell integration
- desktop icons from /lib/q9/desktop and $home/lib/desktop, single
  click select, double click launch; button 3 on the desktop opens
  the win2k context menu (classic rio menu moves to the 1-2 chord)
- generic win2k widgets: popup menus, modal text entry
- Start > Run dialog with command history, replacing the q9run
  terminal prompt; clock double click opens a calendar
- taskbar: right click on a task button opens the window system
  menu, Show Desktop quick launch, ticking clock, hover tooltips
- Alt+Tab task switcher, Alt+F4 close, Alt+Space window menu,
  Ctrl+Alt+Del security dialog with lock/logoff/shutdown/task
  manager, Ctrl+Shift+Esc task manager
- shut down dialog Log off now really logs off
- window system menu on the title bar icon and title right click,
  minimize animates to the taskbar button, launch hourglass
- wctl gains theme, wallpaper and saver commands; win2k titles get
  the gradient fill; screen saver bounces the flag after an idle
  timeout
2026-08-17 17:52:58 -03:00
waozi 8a8c65d131 rio: log out for real, in place, to the logon screen
Log Out no longer reboots the VM. rio ends the session itself:
killprocs() terminates every window's command, the logon screen is
shown again (same dialog as at boot, owning mouse and keyboard while
the mouse and keyboard threads are parked on a logonchan gate), and
logging in returns to a fresh desktop. The logon backdrop repaints on
each blink tick so late window-cleanup restores are covered.

Verified with two consecutive logout/login cycles in one boot (single
init start, no reboot). The old q9logout reboot script is gone; the
menu item routes to the in-rio logout directly.
2026-08-17 01:40:09 -03:00
waozi a9ea2bc436 rio: use the rio arrow cursor from the boot splash onward
Before this the splash and logon screens showed the kernel's default
black arrow; the cursor rio uses after login (whitearrow) is now set
at the start of the splash thread, so the machine uses one cursor
style throughout boot, logon and desktop.
2026-08-17 01:28:14 -03:00
waozi 09150ab704 rio: win2k shut down dialog, Ctrl+Esc start menu, fast reboots
Shut Down now opens a proper Windows-2000 style modal dialog inside
rio (title bar, What do you want the computer to do?, radio choices
for Shut down / Restart / Log off, OK and Cancel) instead of spawning
a console. All choices end the session and come back through the boot
splash and logon screen.

The reboot write needed the kernel argument: writing plain "reboot"
to #c/reboot makes rebootcmd exit the writing process instead of
rebooting, so rio, the logon screen and the rc scripts now write
"reboot /386/9pc". Verified: dialog OK reboots the VM through a full
fresh session.

The start menu also opens with Ctrl+Esc (the classic shortcut); the
host window manager usually swallows the bare win key before QEMU
ever sees it. Console-path input has no release events, so ctrl state
is tracked from the rune stream.

q9 no longer forces a full rio rebuild on every boot (mk does the
right thing incrementally; boots after a code change rebuild only the
changed files, other boots are instant). The test suite now waits on
gui ready instead of the copy step that no longer happens.
2026-08-17 01:24:06 -03:00
waozi 568875cf7a gitignore: kernel build artifacts from guest builds 2026-08-17 00:43:41 -03:00
waozi c09165f05c q9: move VNC to 5901, Q9_TEST splash slowdown, suite timing fixes
VNC now binds 127.0.0.1:1 (port 5901, Q9_VNC_DISPLAY to override) so it
no longer collides with a libvirt SPICE server on 5900. Q9_TEST=1
exports q9splashslow in the guest to stretch the splash phases for the
test harness.

test.sh: the menu check now requires the white highlight bar (the raw
kernel boot console is also black with white text and was matching),
and wait_bar polls long enough to cover the slowed menu phase. The
suite passes 6/6.
2026-08-17 00:42:24 -03:00
waozi b4a7e3d1c5 rio: win-key start menu and start-menu launch fixes
Map the left/right Windows keys to a Win rune in the pc kernel kbd
tables; rio's keyboard tap consumes the key (both /dev/kbd k-lines and
console c<C> strings, tracking hold/release so chords don't retrigger)
and toggles the start menu.

Fix the start menu launch bug: menuactivate called menuhide() before
evaluating mitems[menusel].cmd, but menuhide resets menusel to -1, so
the argument read mitems[-1]; Shut Down and Log Out silently launched
nil. The command is now captured first. Same fix in the submenu branch.

q9shut logs reboot-write errors; q9logout ends the session via a clean
reboot back to the logon screen (init's console respawn does not
replay the login profile, so a plain kill of the session process would
strand the terminal at a shell prompt).

The splash accepts q9splashslow=1 (set by the q9 launcher under
Q9_TEST=1) to stretch the boot-menu and progress-bar phases so the
headless test harness can observe them.
2026-08-17 00:42:12 -03:00
waozi 6118252cf5 boot/q9: headless GUI smoke-test harness
test.sh boots the VM headless twice and pixel-verifies the whole
boot flow via QEMU monitor screendumps: boot manager menu, progress
bar, logon dialog, taskbar, start menu and safe mode (6 checks).
monclick.sh injects monitor mouse clicks (homing to 0,0 first and
stepping deltas at <=127, larger PS/2 deltas get mangled),
ppmcheck.py asserts pixel properties, vncsend.py/vncclick.py are
minimal RFB clients (handshake incl. pixel format, encodings and an
update request), dbgsafe.sh is an interactive splash-click debugger.
Screendump artifacts are gitignored.
2026-08-16 22:05:17 -03:00
waozi da8049e0c5 q9: headless mode, raw-mode rio rebuild and linear mouse
Add --headless: no GTK window, VNC on 127.0.0.1:5900 and a unix
monitor socket for screendumps, so sessions can run and be tested
without a display. Fix --raw to write the prerio rebuild script like
the clean console does; without it raw boots silently ran a stale
rio, since every boot uses -snapshot.

Glenda's profile now sets the mouse to linear under q9: the VNC
absolute pointer maps through QEMU with 1:1 deltas, and the old
accelerated setting made the guest cursor drift away from the
client, landing clicks in the wrong place.
2026-08-16 22:05:05 -03:00
waozi 607e643763 rio: add win2k boot splash, logon screen and start menu commands
Boot now plays a Windows-2000-style sequence before the desktop:
an ntldr-like boot manager menu (Plan 9 / safe mode without the
panel, click or dwell to choose, 6s default countdown), the classic
animated segmented progress bar, and a logon dialog with user name,
password field (dots, blinking caret, backspace/Delete work), OK
and Shut Down buttons. The splash runs as a real thread on the mouse
and timer channels; mthread, keyboardtap and desktop startup are
gated on a splashdone channel, and the desktop background is
repainted after the splash. q9nosplash=1 skips it.

Start menu: restore panelinit/panelmouse/panelcontextmenu dropped in
the menu rework, rename Log Off to Log Out and wire it to q9logout
(kills rio; init restarts the session through the logon screen),
and implement Shut Down (q9shut: prints the win2k shutdown message
and reboots the VM) and Run... (q9run: opens a command in a new
window via wctl).
2026-08-16 22:04:55 -03:00
waozi ea2450793a Add rio panel workspace switcher 2026-07-21 22:03:49 -03:00
waozi 2da8005e66 Stop showing desktop grid on rio startup 2026-07-21 21:46:02 -03:00
waozi a21d8fdba1 Rename lola window manager to rio 2026-07-21 21:40:13 -03:00
waozi e55abe2d8a Remove rio from q9 desktop 2026-07-21 21:30:10 -03:00
waozi 99c62f8e0d Remove legacy hold-menu code 2026-07-21 21:25:20 -03:00
waozi ce24f87f8d Use click-style lola popup menus 2026-07-21 21:20:37 -03:00
waozi 333cf207bb Rebuild lola before q9 desktop launch 2026-07-21 21:16:59 -03:00
waozi 3688ab6163 Separate panel context menu from Start 2026-07-21 21:10:44 -03:00
waozi 97f0015658 Use pre-lola q9 boot checkpoints 2026-07-21 21:04:43 -03:00
waozi 898588db44 Centralize lola title controls and snap preview 2026-07-21 20:58:27 -03:00
waozi c2224ade3c Improve desktop snapping and q9 resume 2026-07-21 20:43:38 -03:00
waozi f8f3a9dbcb Improve q9 desktop controls 2026-07-21 19:56:47 -03:00
waozi 1bbe95c7ef Polish q9 desktop startup 2026-07-21 19:46:33 -03:00
waozi eb5c881ea5 Autosave q9 GUI sessions 2026-07-21 19:42:46 -03:00
waozi 1df06c4d3d Add Lola Windows-style shell features 2026-07-21 16:13:35 -03:00
waozi 949e1f46f7 Remove duplicate lola panel 2026-07-20 00:16:10 -03:00
waozi e44935ad33 update panel 2026-07-20 00:04:02 -03:00
waozi 1aa09a2fcf Add q9 launcher and Lola panel 2026-07-19 10:48:16 -03:00
waozi e391764555 update lola theme 2026-07-18 17:37:08 -03:00
waozi 4276199920 integrate lola and jot 2026-07-12 22:02:11 -03:00
321 changed files with 24926 additions and 1268 deletions

No files matched your search

+86
View File
@@ -0,0 +1,86 @@
name: Kryon Smoke
# Native Plan 9 build check for the Kryon library: boots the tree under
# QEMU, rebuilds libkryon.a with 8c, compiles+links+runs the probe from
# scripts/kryon-probe.c, and links Rill (which embeds Terminal and Shelf).
# This is what catches kryon master regressions that only appear on the
# native compiler.
on:
push:
branches:
- master
paths:
- sys/src/kryon
- sys/src/t9
- sys/src/shelf
- sys/src/cmd/rill
- scripts/kryon-smoke.sh
- scripts/kryon-probe.c
- .github/workflows/kryon-smoke.yml
schedule:
# Daily check of kryon master, regardless of the taiji pin.
- cron: "0 5 * * *"
workflow_dispatch:
inputs:
kryon_ref:
description: Kryon ref to test (defaults to the taiji submodule pin)
required: false
default: ""
permissions:
contents: read
concurrency:
group: kryon-smoke-${{ github.ref }}
cancel-in-progress: true
jobs:
smoke:
name: Native Plan 9 Smoke
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout Repository
uses: actions/checkout@v7
with:
submodules: false
- name: Initialize Desktop Submodules
run: |
set -euo pipefail
git submodule update --init \
sys/src/kryon sys/src/t9 sys/src/shelf sys/src/cmd/rill
- name: Select Kryon Ref
if: github.event_name == 'schedule' || inputs.kryon_ref != ''
run: |
set -euo pipefail
ref="${{ inputs.kryon_ref }}"
if [ -z "$ref" ] || [ "$ref" = "null" ]; then
ref="master"
fi
echo "Testing kryon ref: $ref"
git -C sys/src/kryon fetch origin "$ref"
git -C sys/src/kryon checkout --detach FETCH_HEAD
git -C sys/src/kryon log -1 --oneline
- name: Install QEMU
run: |
set -euo pipefail
sudo apt-get update
sudo apt-get install -y --no-install-recommends qemu-system-x86
- name: Run Kryon Smoke
run: |
set -euo pipefail
sh scripts/kryon-smoke.sh
- name: Upload Smoke Log
if: always()
uses: actions/upload-artifact@v7
with:
name: kryon-smoke-log
path: boot/q9/kryon-smoke.log
if-no-files-found: warn
+89
View File
@@ -0,0 +1,89 @@
name: Cloudflare Pages
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: pages-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build Site
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v7
with:
submodules: false
- name: Build Site
run: |
set -euo pipefail
make site
test -f build/site/index.html
test -f build/site/favicon.ico
test -f build/site/css/style.css
test -f build/site/js/taijios-web.js
test -f build/site/assets/taijios-banner.png
test -f build/site/assets/taijios-desktop.png
test -f build/site/assets/taijios-web.raw
test -f build/site/assets/v86/libv86.js
test -f build/site/assets/v86/v86.wasm
test -f build/site/assets/v86/seabios.bin
test -f build/site/assets/v86/vgabios.bin
- name: Upload Site Artifact
uses: actions/upload-artifact@v7
with:
name: taijios-site
path: build/site
if-no-files-found: error
deploy-preview:
name: Deploy Preview
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'pull_request'
steps:
- name: Download Site Artifact
uses: actions/download-artifact@v8
with:
name: taijios-site
path: build/site
- name: Deploy Preview To Cloudflare Pages
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy build/site --project-name=taiji --branch=${{ github.head_ref || github.ref_name }}
deploy-production:
name: Deploy Production
runs-on: ubuntu-latest
needs: build
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
steps:
- name: Download Site Artifact
uses: actions/download-artifact@v8
with:
name: taijios-site
path: build/site
- name: Deploy Production To Cloudflare Pages
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy build/site --project-name=taiji --branch=master
+65
View File
@@ -2,6 +2,71 @@
[68].*
*.a[68]
*.o
build/
sys/src/cmd/rio/*.8
sys/src/cmd/rio/8.out
usr/glenda/tmp
usr/glenda/acme.dump
usr/glenda/lib/go.rc
usr/glenda/lib/kbmap
usr/glenda/.local/
usr/glenda/profiles.tsv
usr/glenda/.kryon_*
sys/log
sys/src/cmd/unix/u9fs/u9fs
boot/q9/build.log
boot/q9/driver-smoke.log
boot/q9/monitor
boot/q9/monitor.log
boot/q9/monitor.sock
boot/q9/qemu.log
boot/q9/qemu.pid
boot/q9/socat.log
boot/q9/serial.log
boot/q9/serial.sock
boot/q9/session.vmstate
boot/q9/session.vmstate.tmp
boot/q9/session.lock
boot/q9/session.kind
boot/q9/session.kind.bad
boot/q9/run.lock
cfg/q9/run.rc
cfg/q9/run.rc.*
cfg/q9/prerio.rc
cfg/q9/prerio.rc.*
cfg/q9/predesktop.rc
cfg/q9/predesktop.rc.*
boot/q9/*.ppm
boot/q9/*.png
boot/q9/*.err
boot/q9/test.log
boot/q9/nsselector-build.log
boot/q9/rill-loading-build.log
boot/q9/rill-handoff-verify.log
boot/q9/tty.log
boot/q9/visible-namespace-selector.log
boot/q9/visible-rill-loading.log
boot/q9/probe.ppm
sys/src/9/pc/9pc
sys/src/9/pc/9pcvirt
sys/src/9/pc/*.out
sys/src/9/pc/bootpc.c
sys/src/9/pc/bootpcvirt.c
sys/src/9/pc/apbootstrap.h
sys/src/9/pc/errstr.h
sys/src/9/pc/init.h
sys/src/9/pc/pc.c
sys/src/9/pc/pcvirt.c
sys/src/9/pc/pc.root.s
sys/src/9/pc/pc.rootc.c
sys/src/9/pc/pcvirt.root.s
sys/src/9/pc/pcvirt.rootc.c
sys/src/9/pc/reboot.h
sys/src/ape/lib/ap/syscall/gencall
# the staged Debian XFCE root is fetched by scripts and never tracked
/debian/rootfs/
# generated Plan 9 user data archive
/usr/glenda/data.tgz
/386/lib/libkryon.a
+21
View File
@@ -0,0 +1,21 @@
[submodule "sys/src/kryon"]
path = sys/src/kryon
url = https://github.com/kryonlabs/kryon.git
branch = master
[submodule "sys/src/inbe"]
path = sys/src/inbe
url = https://github.com/waozixyz/inbe.git
[submodule "sys/src/t9"]
path = sys/src/t9
url = https://github.com/kryonlabs/terminal.git
[submodule "sys/src/shelf"]
path = sys/src/shelf
url = https://github.com/kryonlabs/shelf.git
[submodule "sys/src/cmd/rill"]
path = sys/src/cmd/rill
url = https://github.com/taijiosnet/rill.git
branch = master
[submodule "sys/src/pass"]
path = sys/src/pass
url = https://github.com/waozixyz/pass.git
branch = master
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Executable
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Executable
BIN
View File
Binary file not shown.
Executable
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Executable
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Executable
BIN
View File
Binary file not shown.
Executable
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Executable
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Executable
BIN
View File
Binary file not shown.
Executable
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
+67
View File
@@ -0,0 +1,67 @@
SITE_BUILD_DIR ?= build/site
SITE_BOOT_IMAGE ?= boot/mini.raw
SITE_WEB_IMAGE ?= $(SITE_BUILD_DIR)/assets/taijios-web.raw
.PHONY: site clean-site serve-site driver-smoke kryon-native-plan9-smoke debian-smoke linux-support-smoke linuxrun-smoke unified-smoke window-smoke desktop-boot-smoke pcvirt
site:
rm -rf "$(SITE_BUILD_DIR)"
mkdir -p "$(SITE_BUILD_DIR)"
cp -R site/. "$(SITE_BUILD_DIR)/"
mkdir -p "$(SITE_BUILD_DIR)/assets"
python3 scripts/make-web-image.py "$(SITE_BOOT_IMAGE)" site/assets/taijios-web-plan9.ini "$(SITE_WEB_IMAGE)"
test -f "$(SITE_BUILD_DIR)/index.html"
test -f "$(SITE_BUILD_DIR)/favicon.ico"
test -f "$(SITE_BUILD_DIR)/css/style.css"
test -f "$(SITE_BUILD_DIR)/js/taijios-web.js"
test -f "$(SITE_BUILD_DIR)/assets/taijios-banner.png"
test -f "$(SITE_BUILD_DIR)/assets/taijios-desktop.png"
test -f "$(SITE_WEB_IMAGE)"
test -f "$(SITE_BUILD_DIR)/assets/v86/libv86.js"
test -f "$(SITE_BUILD_DIR)/assets/v86/v86.wasm"
test -f "$(SITE_BUILD_DIR)/assets/v86/seabios.bin"
test -f "$(SITE_BUILD_DIR)/assets/v86/vgabios.bin"
clean-site:
rm -rf "$(SITE_BUILD_DIR)"
serve-site: site
cd "$(SITE_BUILD_DIR)" && python3 -m http.server 8000
driver-smoke:
sh scripts/driver-smoke.sh
debian-smoke:
sh scripts/taiji-support.sh debian-smoke
linux-support-smoke:
sh scripts/taiji-support.sh linux-support-suite
linuxrun-smoke:
sh scripts/taiji-support.sh linuxrun-smoke
unified-smoke:
sh scripts/taiji-support.sh unified-smoke
window-smoke:
sh scripts/taiji-support.sh window-smoke
desktop-boot-smoke:
sh scripts/desktop-boot-smoke.sh
pcvirt:
sh scripts/taiji-support.sh build-pcvirt
kryon-native-plan9-smoke:
sh scripts/kryon-native-plan9-smoke.sh
kryon-smoke:
sh scripts/kryon-smoke.sh
.PHONY: rill-ziran-plan9-smoke
rill-ziran-plan9-smoke:
sh scripts/rill-ziran-plan9-smoke.sh
.PHONY: rio-ziran-plan9
rio-ziran-plan9:
env -u DISPLAY -u WAYLAND_DISPLAY ../../ziranlang/ziran/build/bin/ziran build --target=plan9-c --root sys/src/cmd/rio9 --module-path ../../ziranlang/ziran/std -o sys/src/cmd/rio9/build/ziran/plan9 sys/src/cmd/rio9/window_snapshot.zi
+200 -11
View File
@@ -1,25 +1,81 @@
# Plan 9 from Bell Labs (9legacy, bootable)
# TaijiOS
This is a bootable copy of the 9legacy branch of Plan 9 from Bell Labs.
See [README](README) for the main README file.
## Current direction: all-Ziran TaijiOS
To boot this Plan 9, install qemu, so that you have `qemu-system-x86_64` in your path.
The authoritative new plan is a capability-based microkernel OS written entirely
in Ziran, using Kryon for its interface. Start with the [foundation index](doc/foundation.md)
for architecture, cited research, feasibility gaps and the staged roadmap.
These are planning documents, not a completed OS implementation.
## Historical Plan 9 integration
The material below is preserved reference for the previous TaijiOS tree and
migration. It does not define the new kernel or relax the all-Ziran target.
[![Cloudflare Pages](https://github.com/taijiosnet/taiji/actions/workflows/pages.yml/badge.svg)](https://github.com/taijiosnet/taiji/actions/workflows/pages.yml)
![TaijiOS desktop banner](site/assets/taijios-banner.png)
TaijiOS is Kryon Labs' flagship operating system: a bootable desktop OS
tree based on the 9legacy branch of Plan 9 from Bell Labs, with Kryon
applications preinstalled as the default working environment.
The tree includes Shelf, Rill, Terminal, Inner Breeze, Pass, and the
supporting Kryon runtime work needed to boot them together inside
TaijiOS. See [README](README) for the historical upstream README file.
## Bundled Kryon Desktop
TaijiOS is the integration target for the Kryon application stack:
- Shelf provides the file manager and desktop file surfaces.
- Rill provides the graphical shell and application launcher.
- Terminal provides the terminal app (stable command and submodule ID `t9`).
- Inner Breeze provides breathing, meditation, and habit tracking.
- Pass provides stateless password generation.
- Kryon provides the shared UI/runtime layer used by the applications.
The default QEMU profile opens one Rill desktop immediately. Applications
choose their runtime through their launcher; there is no startup flavor or
namespace selection. The text profile stays available for low-level OS work.
An experimental Linux application path puts Debian X11 applications in native
windows alongside the desktop. The application menu includes Text Editor
(`xedit`) and Eyes (`xeyes`). Native applications and these launchers share
Documents and the desktop's text clipboard. This currently supports a small
set of i386 X11 applications; Windows/Wine execution is not implemented.
Native and supported Debian apps appear together in the taskbar, and Ctrl+Tab
switches between them. Terminal, Files, and Settings use native windows; the
panel and menus stay above apps. Debian application displays follow their
native window size, `rill-open` opens documents through the application
registry, and About opens as an ordinary window.
See [the unified desktop notes](doc/unified-desktop.md) for setup, commands,
tests, and current limits.
The [current status and remaining plan](doc/unified-desktop-status.md) distinguish
implemented features from verified behavior, including
the [application matrix](doc/application-matrix.md) and the work still needed
for Windows support.
## Boot Locally
To boot TaijiOS, install qemu, so that you have `qemu-system-x86_64` in your path.
Then:
git clone https://github.com/rsc/plan9
./plan9/boot/qemu
git clone https://github.com/taijiosnet/taiji.git
./taiji/boot/qemu
The qemu script builds u9fs in plan9/sys/src/cmd/unix/u9fs and then runs
qemu with the right options to boot diskless, using the git clone as the root file system.
The qemu script builds u9fs in taiji/sys/src/cmd/unix/u9fs and then runs
qemu with the right options to boot diskless, using the git clone as the
root file system.
Because the VM shares the files with your host machine, you can edit files in one place
and see the changes instantly in the other place. For example, you can edit files in your
local editor even if you are running tests in the Plan 9 VM.
You can run builds of Go binaries targeting Plan 9 on your host machine
local editor even if you are running tests in the TaijiOS VM.
You can run builds of Go binaries targeting TaijiOS on your host machine
and then test the binaries in the VM.
And you can run more than one VM, all sharing the same file system.
At boot time, the startup disk boot/pxeboot.raw loads a minimal Plan 9 kernel
At boot time, the startup disk boot/pxeboot.raw loads a minimal TaijiOS kernel
into memory, which then PXE loads a plan9.ini and new kernel over TFTP (provided by qemu).
So if you make changes to the kernel, you can boot from `ether0!/sys/src/9/pc/9pc`
to test an as-yet-uninstalled kernel.
@@ -27,3 +83,136 @@ to test an as-yet-uninstalled kernel.
The plan9.ini is loaded from [/cfg/pxe/525400123456](cfg/pxe/525400123456).
(That number is the VM's MAC address.)
Changes made to that file will be visible on the next VM boot.
## Ziran migration
TaijiOS is being rewritten in current Ziran, with `plan9-c` as the native
transpilation path. Rill must be restored as the main desktop environment,
entirely in Ziran and using current Kryon. Compiler or runtime gaps belong in
Ziran; reusable UI capabilities belong in upstream Kryon; desktop policy
belongs in upstream Rill. App submodules contain committed upstream source.
This migration is not complete. The OS still contains thousands of C files
across commands, kernel and drivers, boot code, compatibility libraries, libc,
graphics, cryptography, networking, and other libraries. Assembly, the native
build/bootstrap path, and the remaining application implementations also
require an explicit migration and verification path. Passing a library or
shell probe does not establish that the OS or desktop has been rewritten.
The Rill shell, panel layouts, settings persistence, stub adapter, Plan 9
platform services, panel clock, Run dialog, Applications menu, Calendar,
Settings, and About now use Ziran implementations. A new `rill-desktop` entrypoint adds the
current Kryon panel, live task/launcher snapshots, in-place menus, all four
panel edges, autohide, scrolling, item moves and persistence, and available
volume/clipboard/session controls. Native desktop overlays use only the
client's own window namespace. The converted screens and desktop share a
native libdraw application host. Settings uses current Kryon controls for
desktop preferences, system control panels, all eight panel configurations,
Xfce panel import, display preview rollback, and all nineteen window shortcuts.
Saved desktop preferences and panel layouts reload without restarting the
new desktop. Desktop file selection, icon layout persistence, group dragging,
folder drops, context menus, rename/New Folder dialogs, and file transfer
controls now use Ziran and Kryon. Native directory listing, private folder
creation, renaming without overwriting, and file/folder clipboard transfers
are implemented. Native PNG icons now load through Kryon's `Image` surface.
Native Move to Trash, restore, and empty services now use Ziran, and the
desktop Trash browser uses current Kryon. The hosted transfer backend remains
C. Native display/input and other missing services still need implementations;
their controls remain unavailable. Rio's
window snapshot and PID ownership check also use Ziran. Run `make rio-ziran-plan9` to generate
rio's native sources, then `make rill-ziran-plan9-smoke` to generate the
behavior tests from source and saved IR through `plan9-c`, compile and link
with native `8c`/`8l`, and run them in the private TaijiOS guest. The gate also
checks native file and process operations, application and icon registry
overrides, and window controls restricted to processes launched by Rill. It
builds rio, compiles Rill's generated service objects through its native
`mkfile`, and runs the persistence checks through `mk test`.
It also checks Run history, application matching, categories and recent
launchers, Unicode editing, scrolling, session confirmation, clock formatting,
Gregorian calendars, month navigation, timestamps after 2038, panel editing,
window action failures, clipboard overflow, autohide, wheel ownership, panel
JSON validation, shortcut collision detection, concurrent preference merging,
exclusive native file leases, stable file selection after refresh, group
positions, folder drops, file operation failures, transfer conflicts, wallpaper
rotation, held pointer clicks, and display rollback. It renders
the converted Kryon screens with native libdraw from source and saved IR and
compares their captures. It builds, installs into private guest directories,
and renders the actual native Run, Applications, Calendar, Settings, About,
and desktop executables through their `app/*.mk` recipes.
PNG checks cover 33 independent reference images across standard color types,
depths, filters, transparency, and Adam7 interlace, plus malformed streams,
cache eviction, alpha composition, real desktop icons, and native Plan 9 image
compatibility. The decoder and native image provider are current Ziran;
bounded decompression uses Ziran's native `libflate` adapter. PNG files are
limited to 64 MiB and 4096 pixels per axis; gamma and color profiles are ignored,
and 16-bit samples use their high byte. Ziran's compiler regressions also cover wide
comparisons, array initialization without adjacent stack writes, aggregate
evaluation order, and file size queries that preserve the read cursor.
`TAIJI_RILL_ZIRAN_SUITES` and `TAIJI_RILL_ZIRAN_APPLICATIONS` can select
focused checks; the default runs every suite and all six applications.
`TAIJI_RILL_ZIRAN_SUITES_ONLY=1` runs native source/saved-IR suites against an
upstream `RILL_DIR` before integrating its commit. This mode omits downstream
service builds and application captures; the default gate verifies those too.
The native `rill-open` command and desktop share the Ziran document resolver.
It chooses each file's extension independently, preserves literal filenames,
retains system applications when the user overrides only part of the registry,
and limits Linux document translation to the normalized home directory.
The gate also builds this command and checks its actual argv and exit status.
Native file and folder Copy/Paste, Duplicate, Move, and Cut/Paste now use
Ziran services with staged publication, cancellation, Skip, Keep Both, Replace, and
preserved permissions and modification times. Folder copies include hidden
entries and empty directories and reject recursive bindings and destinations
inside the source. Moves publish the complete copy before removing source
entries; changed or protected entries stop removal with an explicit error.
Cut/Paste clears its unchanged clipboard selection only after every item
moves successfully. Foreign staging entries and newer clipboard contents are
preserved. Native Move to Trash saves a checksummed recovery record and the
complete payload before removing source entries. The current Kryon Trash
browser shows original paths and deletion times, supports restore with
collision-safe names, and confirms permanent emptying. Storage defaults to
`$home/lib/rill/trash` with an absolute `RILL_TRASH_DIR` override. Each private
entry records every copied node's identity; damaged metadata, replacement
nodes, redirected payloads, and unknown contents are preserved and reported.
Saved identities reanchor to the current store after a legitimate filesystem
remount. Native source/saved-IR checks cover recovery after releasing the
transfer, header and inventory corruption, bound payloads, cancellation before and
after publication, and the desktop controls. The browser displays up to 64
entries at a time; restore and empty currently run synchronously. Replace
stages the incoming entry completely and preserves the old destination in
Trash before publishing without overwriting a newly created entry. It handles
files, folders, differing types, batch choices, and Cut/Paste. Changed
destinations and overlap with selected sources refuse replacement; cancellation
or later publication failure leaves any completed backup recoverable in Trash.
Retry now retains completed and skipped items, restarts unpublished copies
with a fresh snapshot, and verifies a published destination before resuming
removal of unchanged source entries. Recreated source entries and changed
copies are preserved. Folder permissions can be repaired before retrying;
failed staging cleanup must succeed before another attempt starts. A
replacement reuses its published Trash archive after partial removal of the
old destination. Cut/Paste retains its original clipboard snapshot across
retry and clears it only after complete success. Undo now retains one completed
Copy, Duplicate, or Move batch in memory and verifies every result and
replacement backup before changing the batch. Copied results go to Trash;
moved results return to their original directory, recreating missing parents
and keeping both entries when a name is occupied. Replaced destinations return
from their verified Trash backups. Undo advances with the transfer polls and
can be cancelled and retried after partial progress. Changed trees, redirected
paths, and changed backups are preserved and reported. Closing the desktop
releases the journal; another completed Copy, Duplicate, or Move batch replaces
it. Undo does not provide Redo. Native desktop startup now recovers verified
staging copies after their owner exits, preserving partial contents under a
visible `(partial copy 1)` name and keeping both entries when occupied.
Fresh homes receive an owner-only Desktop folder before recovery; existing
folders, files, and explicitly configured desktop paths are preserved.
Recovery uses private receipts tied to the parent, receipt, and staging root
identities and the last checkpoint's root metadata. It skips live owners and
preserves damaged, unrecognized, or redirected entries with an error.
Leftover receipts after publication can be
removed without changing the completed destination. It scans the requested
directory, does not resume interrupted moves or search nested Trash entries,
and does not persist the Undo journal. Recovered copies may be incomplete.
The new desktop entrypoint is not yet the boot default: remaining file services,
full tray rendering and menus, plugin Properties, notifications,
and remaining services still need conversion and parity checks. The full
graphical desktop, Rill's other services, Terminal's remaining
legacy modules, and the wider OS migration remain unfinished.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+101
View File
@@ -0,0 +1,101 @@
q9
==
`./q9` starts this tree under QEMU and boots Glenda's normal graphical
TaijiOS profile.
Examples:
./q9
./q9 --text
./q9 tty
./q9 --smp 2
./q9 --gpu vmware
./q9 --kernel pc
./q9 --kernel /sys/src/9/pc/9pc
./q9 --rebuild-desktop
./q9 acme
./q9 rill
./q9 run 'rill'
./q9 tty-run 'pwd; ls /sys/src/cmd'
./q9 run 'cd /sys/src/cmd/rill && mk install'
make driver-smoke
./q9 --raw
Use `./q9 tty`, `./q9 shell`, or `./q9 --text` when you want the q9
shell-first profile. That profile leaves you at `term%` on the serial
stdio console instead of starting the window system at boot.
From the TaijiOS prompt in tty mode, run `startwm`, `rill`,
`acme`, or any other command normally. Use
`./q9 rill` or `./q9 acme` when you want a graphical QEMU
display from startup. The `startwm` helper starts `rill` by default:
startwm
startwm rill
startwm acme
The start helpers do not replace the shell, so exiting the graphical
program returns to the same tty session.
The q9 PXE profile also sets `nousbboot=1` and `q9fast=1`, which skip
boot and terminal startup work that is slow and not useful for this VM,
such as USB probing, disk probing, DNS, timesync, and APM.
Graphical q9 boots use the installed desktop binaries by default to keep
startup fast. Use `./q9 --rebuild-desktop` or set `Q9_BUILD_DESKTOP=1`
when you want q9 to run `mk install` for Kryon, t9, Shelf, and Rill
before launching the desktop.
`make driver-smoke` boots the PXE q9 profile, checks the expected virtual
network, source mount, and installed desktop binaries, then reports elapsed
time and key device lines in `boot/q9/driver-smoke.log`.
Run `q9hw` inside TaijiOS to print the detected drivers, network, storage,
display/input devices, desktop binaries, and q9 boot flags. The driver smoke
test runs the same command, so new driver work has a stable guest-side report
to compare against.
The default and verified q9 NIC is `virtio-net-pci`. Use
`--net-device model` or `Q9_NET_DEVICE=model` to probe another QEMU NIC
without editing the launcher. q9 also exports `TMPDIR`, defaulting to `/tmp`,
so QEMU snapshot scratch files do not depend on a writable `/var/tmp`.
If your QEMU build still writes snapshot scratch files under `/var/tmp`, set
`Q9_COPY_IMAGE=1`; q9 will copy the boot image into `$TMPDIR` and run that
temporary copy without QEMU's snapshot mode.
The default graphical adapter is QEMU's standard VGA path using TaijiOS'
VESA framebuffer setup. Use `--gpu vmware` or `Q9_GPU=vmware` to boot
with QEMU's VMware SVGA adapter and the matching q9 PXE profile. This
uses TaijiOS' existing VMware SVGA framebuffer driver; it is not a
virtio-gpu or 3D acceleration path.
Use `--kernel name` or `Q9_KERNEL=name` to boot a different installed 386
kernel. For example, `--kernel pc` resolves to `ether0!/386/9pc`, and
`--kernel pcdisk` resolves to `ether0!/386/9pcdisk`. Explicit boot paths
are accepted too, such as `--kernel /sys/src/9/pc/9pc`. q9 implements this
with a temporary generated PXE profile, so the normal tracked text and GUI
profiles stay unchanged.
The q9 profiles set `q9unix=1`, which enables small shell conveniences in
Glenda's profile: `ll`, `la`, `l`, `cdup`, `clear`, `cls`, `path`, and
`which`. It also appends APE tools to `/bin`, exposes `git/compat` as
`git`, and adds helpers for web downloads.
Run `q9setup` inside TaijiOS to see the bundled development tools. APE,
git, SSH, hget/webfs, archive tools, Ghostscript/page, VNC, and common
text tools are already present in this tree.
Run `q9deps` inside TaijiOS for optional internet-backed installs. For
example, `q9deps go-bootstrap` downloads the official plan9/386 Go
bootstrap archive, unpacks it under `/tmp`, binds its `bin` directory into
`/bin`, and writes `$home/lib/go.rc` so future sessions can find it. Use
`q9deps clone url [dir]` to clone external git repositories with the
bundled git wrapper.
Use `--smp n` or `Q9_SMP=n` to expose multiple CPUs to QEMU. q9 keeps
TaijiOS MP disabled with `*nomp=1` for now because this PC kernel can panic
under QEMU during LAPIC clock calibration. This keeps normal boot stable.
Use `--raw` when you want to see the BIOS/kernel boot log or when running
without a real terminal.
Binary file not shown.
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env python3
import sys
f=open(sys.argv[1],'rb').read(); t=[];o=0
while len(t)<4:
while f[o:o+1].isspace(): o+=1
if f[o:o+1]==b'#':
while f[o:o+1]!=b'\n': o+=1
continue
s=o
while not f[o:o+1].isspace(): o+=1
t.append(f[s:o])
o+=1; w,h=int(t[1]),int(t[2]); px=f[o:o+w*h*3]
n=0
for y in range(680,738,2):
for x in range(700,920,2):
i=(y*w+x)*3
r,g,b=px[i],px[i+1],px[i+2]
if r>240 and g>240 and b>200 and b<240: n+=1
sys.exit(0 if n>80 else 1)
+43
View File
@@ -0,0 +1,43 @@
#!/bin/sh
set -u
root=$(CDPATH= cd -- "$(dirname "$0")/../.." && pwd)
cd "$root"
T=boot/q9
. $root/boot/q9/monclick.sh
pkill -f '^qemu-system-x86_64' 2>/dev/null || true
sleep 0.5
rm -f $T/monitor.sock $T/m1.ppm $T/m2.ppm $T/m3.ppm $T/dbg.err
setsid ./q9 --raw --headless gui >$T/qemu.log 2>&1 &
shot() {
printf 'screendump /home/wao/Projects/taiji/boot/q9/%s.ppm\n' "$1" \
| socat - UNIX-CONNECT:$T/monitor.sock >>$T/dbg.err 2>&1
}
# wait for boot menu
i=0
while [ $i -lt 90 ]; do
shot m1
if [ -s $T/m1.ppm ] && python3 $T/ppmcheck.py $T/m1.ppm mostly_black \
&& python3 $T/ppmcheck.py $T/m1.ppm has_white; then
break
fi
sleep 1
i=$((i+1))
done
python3 - <<EOF
import socket,time
for _ in range(30):
try:
socket.create_connection(("127.0.0.1",5900),timeout=1).close(); break
except OSError: time.sleep(1)
EOF
echo "menu waited $i s"
monclick 200 126
sleep 0.5
shot m2
sleep 0.5
ffmpeg -y -loglevel error -i $T/m2.ppm $T/m2.png
sleep 5
shot m3
sleep 0.5
ffmpeg -y -loglevel error -i $T/m3.ppm $T/m3.png
echo done
+15
View File
@@ -0,0 +1,15 @@
#!/usr/bin/env python3
import sys
f=open(sys.argv[1],'rb').read(); t=[];o=0
while len(t)<4:
while f[o:o+1].isspace(): o+=1
if f[o:o+1]==b'#':
while f[o:o+1]!=b'\n': o+=1
continue
s=o
while not f[o:o+1].isspace(): o+=1
t.append(f[s:o])
o+=1; w,h=int(t[1]),int(t[2]); px=f[o:o+w*h*3]
i=(340*w+760)*3
r,g,b=px[i],px[i+1],px[i+2]
sys.exit(0 if not (r<40 and 100<g<150 and 100<b<150) else 1)
+29
View File
@@ -0,0 +1,29 @@
#!/usr/bin/env python3
"""Click at (x,y) on the TaijiOS VM via VNC using gvnc (real client stack).
usage: gvncclick.py x y"""
import sys, time
import gi
gi.require_version('GtkVnc', '2.0')
gi.require_version('GLib', '2.0')
from gi.repository import GtkVnc, GLib
x, y = int(sys.argv[1]), int(sys.argv[2])
conn = GtkVnc.Connection()
loop = GLib.MainLoop()
state = {"clicks": 0}
def on_connected(src, cname):
conn.pointer_event(0, x, y)
time.sleep(0.15)
conn.pointer_event(1, x, y)
time.sleep(0.15)
conn.pointer_event(0, x, y)
time.sleep(0.3)
loop.quit()
conn.connect("vnc-connected", on_connected)
conn.open_host("127.0.0.1", "5900")
GLib.timeout_add_seconds(8, loop.quit)
loop.run()
conn.close()
print("clicked", x, y)
+22
View File
@@ -0,0 +1,22 @@
#!/usr/bin/env python3
# menuchk.py FILE X1 Y1 X2 Y2: a kryon-themed menu (surface face + dark text)
import sys
f=open(sys.argv[1],'rb').read(); t=[];o=0
while len(t)<4:
while f[o:o+1].isspace(): o+=1
if f[o:o+1]==b'#':
while f[o:o+1]!=b'\n': o+=1
continue
s=o
while not f[o:o+1].isspace(): o+=1
t.append(f[s:o])
o+=1; w,h=int(t[1]),int(t[2]); px=f[o:o+w*h*3]
x1,y1,x2,y2=map(int,sys.argv[2:6])
gray=0
for y in range(y1,y2,2):
for x in range(x1,x2,2):
i=(y*w+x)*3
r,g,b=px[i],px[i+1],px[i+2]
if abs(r-239)<20 and abs(g-239)<20 and abs(b-210)<25:
gray+=1
sys.exit(0 if gray>150 else 1)
+161
View File
@@ -0,0 +1,161 @@
#!/bin/sh
# Click at absolute screen position using QEMU monitor mouse injection.
# Homes the guest cursor to the top-left corner first (deltas clamp at
# 0,0), then moves in steps of at most 127 (larger PS/2 deltas get
# mangled). Source, don't run.
# usage: monclick x y (after: . boot/q9/monclick.sh)
T=${T:-boot/q9}
monclick() {
_x=$1 _y=$2
{
for _i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16; do
printf 'mouse_move -127 -127\n'
sleep 0.05
done
while [ $_x -gt 127 ]; do
printf 'mouse_move 127 0\n'; _x=$((_x-127)); sleep 0.05
done
while [ $_y -gt 127 ]; do
printf 'mouse_move 0 127\n'; _y=$((_y-127)); sleep 0.05
done
printf 'mouse_move %d %d\n' "$_x" "$_y"
sleep 0.3
printf 'mouse_button 1\n'
sleep 0.6
printf 'mouse_button 0\n'
} | socat - UNIX-CONNECT:$T/monitor.sock >/dev/null 2>&1
sleep 0.4
}
# move without clicking (hover), same homing strategy
monmove() {
_x=$1 _y=$2
{
for _i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16; do
printf 'mouse_move -127 -127\n'
sleep 0.05
done
while [ $_x -gt 127 ]; do
printf 'mouse_move 127 0\n'; _x=$((_x-127)); sleep 0.05
done
while [ $_y -gt 127 ]; do
printf 'mouse_move 0 127\n'; _y=$((_y-127)); sleep 0.05
done
printf 'mouse_move %d %d\n' "$_x" "$_y"
} | socat - UNIX-CONNECT:$T/monitor.sock >/dev/null 2>&1
sleep 0.4
}
# left click relative to the current cursor position; useful for menus that
# would close if the cursor were homed before the click.
monrelclick() {
_x=$1 _y=$2
{
while [ $_x -gt 127 ]; do
printf 'mouse_move 127 0\n'; _x=$((_x-127)); sleep 0.05
done
while [ $_x -lt -127 ]; do
printf 'mouse_move -127 0\n'; _x=$((_x+127)); sleep 0.05
done
while [ $_y -gt 127 ]; do
printf 'mouse_move 0 127\n'; _y=$((_y-127)); sleep 0.05
done
while [ $_y -lt -127 ]; do
printf 'mouse_move 0 -127\n'; _y=$((_y+127)); sleep 0.05
done
printf 'mouse_move %d %d\n' "$_x" "$_y"
sleep 0.3
printf 'mouse_button 1\n'
sleep 0.6
printf 'mouse_button 0\n'
} | socat - UNIX-CONNECT:$T/monitor.sock >/dev/null 2>&1
sleep 0.4
}
# right click at position
monrclick() {
_x=$1 _y=$2
{
for _i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16; do
printf 'mouse_move -127 -127\n'
sleep 0.05
done
while [ $_x -gt 127 ]; do
printf 'mouse_move 127 0\n'; _x=$((_x-127)); sleep 0.05
done
while [ $_y -gt 127 ]; do
printf 'mouse_move 0 127\n'; _y=$((_y-127)); sleep 0.05
done
printf 'mouse_move %d %d\n' "$_x" "$_y"
sleep 0.3
printf 'mouse_button 4\n'
sleep 0.6
printf 'mouse_button 0\n'
} | socat - UNIX-CONNECT:$T/monitor.sock >/dev/null 2>&1
sleep 0.4
}
# double click at position (fast, single homing)
mondblclick() {
_x=$1 _y=$2
{
for _i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16; do
printf 'mouse_move -127 -127\n'
sleep 0.05
done
while [ $_x -gt 127 ]; do
printf 'mouse_move 127 0\n'; _x=$((_x-127)); sleep 0.05
done
while [ $_y -gt 127 ]; do
printf 'mouse_move 0 127\n'; _y=$((_y-127)); sleep 0.05
done
printf 'mouse_move %d %d\n' "$_x" "$_y"
sleep 0.3
printf 'mouse_button 1\n'
sleep 0.05
printf 'mouse_button 0\n'
sleep 0.05
printf 'mouse_button 1\n'
sleep 0.2
printf 'mouse_button 0\n'
} | socat - UNIX-CONNECT:$T/monitor.sock >/dev/null 2>&1
sleep 0.4
}
# press at x1 y1, drag to x2 y2, release
mondrag() {
_x1=$1 _y1=$2 _x2=$3 _y2=$4
{
for _i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16; do
printf 'mouse_move -127 -127\n'
sleep 0.05
done
while [ $_x1 -gt 127 ]; do
printf 'mouse_move 127 0\n'; _x1=$((_x1-127)); sleep 0.05
done
while [ $_y1 -gt 127 ]; do
printf 'mouse_move 0 127\n'; _y1=$((_y1-127)); sleep 0.05
done
printf 'mouse_move %d %d\n' "$_x1" "$_y1"
sleep 0.3
printf 'mouse_button 1\n'
sleep 0.2
_tx=$_x2 _ty=$_y2
while [ $_tx -gt 127 ]; do
printf 'mouse_move 127 0\n'; _tx=$((_tx-127)); sleep 0.03
done
while [ $_ty -gt 127 ]; do
printf 'mouse_move 0 127\n'; _ty=$((_ty-127)); sleep 0.03
done
printf 'mouse_move %d %d\n' "$_tx" "$_ty"
sleep 0.4
printf 'mouse_button 0\n'
} | socat - UNIX-CONNECT:$T/monitor.sock >/dev/null 2>&1
sleep 0.5
}
# send a key combo through the QEMU monitor (e.g. "ctrl-esc", "z", "ret")
monkey() {
printf 'sendkey %s\n' "$1" | socat - UNIX-CONNECT:$T/monitor.sock >/dev/null 2>&1
sleep 0.3
}
+238
View File
@@ -0,0 +1,238 @@
#!/usr/bin/env python3
"""Pixel checks on QEMU screendumps (P6 PPM).
usage: ppmcheck.py <file.ppm> <check> [args]
checks:
mostly_black - >=90% of pixels near black
has_white - >=0.1% near-white pixels (text)
row_uniform y - given row is a single color (no panel edge there)
region_white x1 y1 x2 y2 - region contains near-white pixels
seg_face x1 y1 x2 y2 - region contains Taiji theme surface pixels
ocean_background_at x y - pixel is Ocean light desktop background
q9themes_no_plan9 - Plan9 row is absent from the themes list
cursor_win2000 x y - Windows 2000 style pointer is near x,y
window_title_at x1 y1 x2 y2 - region contains a blue window titlebar
"""
import sys
def load(path):
with open(path, "rb") as f:
data = f.read()
toks, off = [], 0
while len(toks) < 4:
while data[off:1+off].isspace():
off += 1
if data[off:1+off] == b"#":
while data[off:1+off] != b"\n":
off += 1
continue
start = off
while not data[off:1+off].isspace():
off += 1
toks.append(data[start:off])
off += 1
w, h = int(toks[1]), int(toks[2])
return w, h, data[off:off + w*h*3]
def main():
path, check = sys.argv[1], sys.argv[2]
w, h, px = load(path)
def pix(x, y):
i = (y*w + x)*3
return px[i], px[i+1], px[i+2]
def near(c, target, tol):
return all(abs(c[i]-target[i]) < tol[i] for i in range(3))
def anynear(c, targets, tol):
return any(near(c, target, tol) for target in targets)
light_backgrounds = [
(226, 238, 252), (208, 232, 248), (224, 240, 224),
(248, 232, 216), (240, 232, 248), (248, 216, 224),
(245, 233, 223), (232, 236, 223), (243, 228, 200),
(192, 192, 192), (228, 244, 238), (231, 234, 244),
(255, 255, 234),
]
dark_backgrounds = [
(24, 40, 56), (16, 37, 64), (21, 48, 32),
(48, 24, 16), (32, 21, 48), (48, 21, 32),
(39, 34, 44), (31, 42, 34), (37, 26, 18),
(32, 32, 32), (18, 45, 40), (18, 24, 51),
(27, 27, 22),
]
surfaces = [
(212, 228, 245), (192, 221, 238), (209, 229, 209),
(236, 216, 198), (226, 215, 238), (236, 201, 210),
(231, 217, 208), (217, 224, 208), (228, 207, 170),
(212, 208, 200), (210, 231, 223), (215, 221, 236),
(239, 239, 210), (34, 54, 72), (28, 52, 80),
(32, 60, 42), (62, 36, 24), (46, 32, 66),
(64, 32, 42), (53, 45, 56), (45, 58, 48),
(51, 36, 24), (48, 48, 48), (27, 59, 52),
(27, 36, 69), (43, 43, 35),
]
def surface(c):
return anynear(c, surfaces, (25, 25, 25))
def backgroundish(c):
return anynear(c, light_backgrounds + dark_backgrounds, (35, 35, 35))
if check == "mostly_black":
n = dark = 0
for y in range(0, h, 4):
for x in range(0, w, 4):
r, g, b = pix(x, y)
n += 1
if r < 40 and g < 40 and b < 40:
dark += 1
sys.exit(0 if dark*10 >= n*9 else 1)
if check == "has_white":
n = 0
for y in range(0, h, 2):
for x in range(0, w, 2):
r, g, b = pix(x, y)
if r > 200 and g > 200 and b > 200:
n += 1
sys.exit(0 if n > w*h//4//1000 else 1)
if check == "row_uniform":
y = int(sys.argv[3])
c = pix(0, y)
for x in range(1, w, 3):
if pix(x, y) != c:
sys.exit(1)
sys.exit(0)
if check == "menu_at":
# boot manager menu: solid white highlight bar on the first entry
# (kernel boot text is black+white too, but has no solid runs)
n = sum(1 for x in range(45, 360) if pix(x, 100) == (255, 255, 255))
sys.exit(0 if n > 200 else 1)
if check == "logon_at":
# backdrop: Taiji Default light desktop, dialog face = theme surface
bg = pix(100, 60)
dlg = pix(512, 350)
sys.exit(0 if backgroundish(bg) and surface(dlg) else 1)
if check == "grey_at" or check == "not_grey_at":
# theme surface (Taiji Default light, with legacy Plan9 accepted)
x, y = int(sys.argv[3]), int(sys.argv[4])
grey = surface(pix(x, y))
sys.exit(0 if (grey == (check == "grey_at")) else 1)
if check == "deskicon_at":
# desktop icons top-left: many pixels differ from the wallpaper
n = 0
for y in range(6, 110, 2):
for x in range(10, 100, 2):
if not backgroundish(pix(x, y)):
n += 1
sys.exit(0 if n > 120 else 1)
if check == "submenu_at":
# start menu programs submenu: black item text on the theme surface
x1, y1, x2, y2 = map(int, sys.argv[3:7])
nw = ng = 0
for y in range(y1, y2, 2):
for x in range(x1, x2, 2):
r, g, b = pix(x, y)
if r < 60 and g < 60 and b < 60:
nw += 1
if surface((r, g, b)):
ng += 1
sys.exit(0 if nw > 15 and ng > 200 else 1)
if check == "rundlg_at":
# Run dialog: kryon accent title strip, theme surface face,
# near-background entry field
r1, g1, b1 = pix(500, 310)
r3, g3, b3 = pix(400, 400)
navy = r1 < 40 and g1 < 60 and 90 <= b1 <= 200
grey = surface(pix(450, 345))
entry = r3 > 175 and g3 > 175 and b3 > 175
sys.exit(0 if navy and grey and entry else 1)
if check == "white_at":
x, y = int(sys.argv[3]), int(sys.argv[4])
r, g, b = pix(x, y)
sys.exit(0 if r > 220 and g > 220 and b > 220 else 1)
if check == "navy_at":
x, y = int(sys.argv[3]), int(sys.argv[4])
r, g, b = pix(x, y)
sys.exit(0 if r < 40 and g < 40 and 100 <= b <= 180 else 1)
if check == "ocean_background_at":
x, y = int(sys.argv[3]), int(sys.argv[4])
sys.exit(0 if near(pix(x, y), (208, 232, 248), (8, 8, 8)) else 1)
if check == "q9themes_no_plan9":
# The hidden Plan9 row would occupy this empty strip beneath Cobalt.
# Count non-face pixels there; swatches/text from a real row exceed it.
n = 0
for y in range(415, 435, 2):
for x in range(82, 266, 2):
if not surface(pix(x, y)):
n += 1
sys.exit(0 if n < 60 else 1)
if check == "cursor_win2000":
x, y = int(sys.argv[3]), int(sys.argv[4])
rows = [
"B...............",
"BW..............",
"BWW.............",
"BWWW............",
"BWWWW...........",
"BWWWWW..........",
"BWWWWWW.........",
"BWWWWWWW........",
"BWWWWWWWW.......",
"BWWWWWBBBB......",
"BWWWBB..........",
"BWWBWB..........",
"BWB.WB..........",
"BB..WB..........",
"B....WB.........",
".....BB.........",
]
def score_at(x0, y0):
black = white = 0
for yy, row in enumerate(rows):
for xx, want in enumerate(row):
if x0 + xx < 0 or x0 + xx >= w or y0 + yy < 0 or y0 + yy >= h:
continue
r, g, b = pix(x0 + xx, y0 + yy)
if want == "B" and r < 45 and g < 45 and b < 45:
black += 1
elif want == "W" and r > 220 and g > 220 and b > 220:
white += 1
return black, white
for oy in range(-2, 3):
for ox in range(-2, 3):
black, white = score_at(x + ox, y + oy)
if black >= 22 and white >= 42:
sys.exit(0)
sys.exit(1)
if check == "window_title_at":
x1, y1, x2, y2 = map(int, sys.argv[3:7])
n = 0
for y in range(y1, y2, 2):
for x in range(x1, x2, 2):
r, g, b = pix(x, y)
if r < 80 and g < 180 and b > 90:
n += 1
sys.exit(0 if n > 40 else 1)
if check == "region_white":
x1, y1, x2, y2 = map(int, sys.argv[3:7])
for y in range(y1, y2, 2):
for x in range(x1, x2, 2):
r, g, b = pix(x, y)
if r > 200 and g > 200 and b > 200:
sys.exit(0)
sys.exit(1)
if check == "seg_face":
# theme surface pixels - the Kryon taskbar/panel face
x1, y1, x2, y2 = map(int, sys.argv[3:7])
for y in range(y1, y2):
for x in range(x1, x2):
if surface(pix(x, y)):
sys.exit(0)
sys.exit(1)
if check == "seg_blue":
# legacy alias: the Kryon taskbar/panel surface
x1, y1, x2, y2 = map(int, sys.argv[3:7])
for y in range(y1, y2):
for x in range(x1, x2):
if surface(pix(x, y)):
sys.exit(0)
sys.exit(1)
sys.exit(2)
if __name__ == "__main__":
main()
+11
View File
@@ -0,0 +1,11 @@
struct S { int a, b, c; };
struct S g;
int
main(void)
{
struct S x = {0};
struct S y;
y = x;
g = y;
return g.a;
}
+8
View File
@@ -0,0 +1,8 @@
struct S { int a, b, c; };
struct S g;
int
main(void)
{
g = (struct S){0};
return g.a;
}
+301
View File
@@ -0,0 +1,301 @@
#!/bin/sh
# Headless GUI smoke test for the Rill desktop + boot splash.
# Boots the TaijiOS VM, drives it with VNC clicks, pixel-checks screendumps.
set -eu
root=$(CDPATH= cd -- "$(dirname "$0")/../.." && pwd)
cd "$root"
T=boot/q9
. $root/boot/q9/monclick.sh
pass=0; fail=0
ok() { echo "PASS: $1"; pass=$((pass+1)); }
bad() { echo "FAIL: $1"; fail=$((fail+1)); }
check() { if python3 $T/ppmcheck.py "$@"; then return 0; else return 1; fi; }
reset_theme() {
mkdir -p usr/glenda/lib/kryon lib/kryon
printf 'name=Default\nmode=light\nstyle=material\n' >usr/glenda/lib/kryon/theme
printf 'name=Default\nmode=light\nstyle=material\n' >lib/kryon/system-theme
printf 'tiles\n' >usr/glenda/lib/wallpaper
}
log_clean() {
! grep -E 'panic|suicide|sys: trap|double-free|write error|allocb' $T/qemu.log >/dev/null 2>&1
}
fastshot() {
printf 'screendump %s/boot/q9/%s.ppm\n' "$root" "$1" \
| socat - UNIX-CONNECT:$T/monitor.sock >>$T/screendump.err 2>&1
}
boot_vm() {
pkill -f '^qemu-system-x86_64' 2>/dev/null || true
sleep 1
rm -f $T/monitor.sock $T/screendump.err
mon_curx=0
mon_cury=0
Q9_TEST=1 setsid ./q9 --raw --headless gui >$T/qemu.log 2>&1 &
for i in $(seq 1 120); do
grep -q "q9: gui ready" $T/qemu.log 2>/dev/null && break
sleep 1
done
for i in $(seq 1 10); do
[ -S $T/monitor.sock ] && return 0
sleep 1
done
echo "FAIL: monitor socket missing" >&2
return 1
}
# poll fast (0.4s) until the boot menu is on screen; leaves it in menu.ppm
wait_menu() {
i=0
while [ $i -lt 150 ]; do
fastshot menu
if [ -s $T/menu.ppm ] && check $T/menu.ppm menu_at; then
return 0
fi
sleep 0.4
i=$((i+1))
done
return 1
}
# poll fast until the progress bar's blue segments are visible
wait_bar() {
i=0
while [ $i -lt 100 ]; do
fastshot bar
if [ -s $T/bar.ppm ] && check $T/bar.ppm seg_face 380 370 640 400; then
return 0
fi
sleep 0.1
i=$((i+1))
done
return 1
}
# poll fast until the logon dialog is up (blue backdrop, grey dialog)
wait_login() {
i=0
while [ $i -lt 100 ]; do
fastshot login
if [ -s $T/login.ppm ] && check $T/login.ppm logon_at; then
return 0
fi
sleep 0.4
i=$((i+1))
done
return 1
}
echo "== boot 1: splash menu + progress bar =="
reset_theme
boot_vm
if wait_menu; then
ok "boot manager menu renders (black, white text)"
else
bad "boot manager menu renders"
fi
if wait_bar; then
ok "progress bar animation renders"
else
bad "progress bar animation renders"
fi
echo "== boot 1: logon screen =="
if wait_login; then
ok "logon dialog renders (blue backdrop, dialog)"
else
bad "logon dialog renders"
fi
# Press Enter instead of clicking a resolution-dependent OK button.
monkey ret
sleep 2
echo "== boot 1: Rill desktop + start menu =="
sleep 8
fastshot desk
sleep 1
if check $T/desk.ppm grey_at 500 754; then
ok "desktop panel present"
else
bad "desktop panel present"
fi
monmove 400 300
sleep 1
fastshot cursor
sleep 1
if check $T/cursor.ppm cursor_win2000 400 300; then
ok "Windows 2000 style cursor renders"
else
bad "Windows 2000 style cursor renders"
fi
monclick 40 754
sleep 1
fastshot start
sleep 1
if check $T/start.ppm region_white 100 480 300 640; then
ok "start menu opens with items"
else
bad "start menu opens with items"
fi
echo "== boot 1: desktop icons =="
fastshot dicons
sleep 1
if check $T/dicons.ppm deskicon_at; then
ok "desktop icons render"
else
bad "desktop icons render"
fi
if [ -x 386/bin/inbe ] && sed -n '1p' lib/q9/desktop | grep -q '^Inner Breeze inbe inbe$'; then
ok "Inner Breeze is preinstalled on desktop"
else
bad "Inner Breeze is preinstalled on desktop"
fi
echo "== boot 1: programs submenu populated =="
monmove 100 585
sleep 1
fastshot subm
sleep 1
if check $T/subm.ppm submenu_at 210 520 385 760; then
ok "programs submenu lists programs"
else
bad "programs submenu lists programs"
fi
echo "== boot 1: run dialog =="
monclick 100 666
sleep 1
fastshot rund
sleep 1
if check $T/rund.ppm rundlg_at; then
ok "run dialog opens with entry field"
else
bad "run dialog opens with entry field"
fi
monclick 585 427
sleep 1
echo "== boot 1: start menu task manager =="
monclick 40 754
sleep 1
monmove 100 640
sleep 1
monrelclick 170 25
sleep 4
fastshot tmg
sleep 1
if check $T/tmg.ppm white_at 100 150; then
ok "task manager window appears"
else
bad "task manager window appears"
fi
monclick 622 42
sleep 2
echo "== boot 1: desktop context menu =="
monrclick 700 300
sleep 1
fastshot dmenu
sleep 1
if check $T/dmenu.ppm grey_at 720 330; then
ok "desktop context menu opens"
else
bad "desktop context menu opens"
fi
monclick 900 200
sleep 1
echo "== boot 1: Inner Breeze desktop launch =="
mondblclick 52 28
sleep 8
fastshot inbe
sleep 1
if check $T/inbe.ppm window_title_at 40 60 760 120; then
ok "Inner Breeze launches from desktop icon"
else
bad "Inner Breeze launches from desktop icon"
fi
if log_clean; then
ok "boot 1 log has no panic or trap"
else
bad "boot 1 log has no panic or trap"
fi
echo "== boot 2: themes app live apply =="
reset_theme
boot_vm
if wait_login; then
ok "themes boot logon dialog renders"
else
bad "themes boot logon dialog renders"
fi
monkey ret
sleep 10
monclick 40 754
sleep 1
monmove 100 585
sleep 1
monrelclick 170 168
sleep 3
fastshot themes
sleep 1
if check $T/themes.ppm q9themes_no_plan9 &&
! grep -q 'Plan9' sys/src/cmd/q9themes/q9themes.c; then
ok "themes app hides Plan9 palette"
else
bad "themes app hides Plan9 palette"
fi
monclick 148 168
sleep 1
monclick 515 446
sleep 3
fastshot themeo
sleep 1
if check $T/themeo.ppm ocean_background_at 900 600; then
ok "themes app Apply repaints running desktop"
else
bad "themes app Apply repaints running desktop"
fi
if grep -q '^name=Ocean$' usr/glenda/lib/kryon/theme &&
grep -q '^name=Ocean$' lib/kryon/system-theme; then
ok "themes app persists Ocean as system theme"
else
bad "themes app persists Ocean as system theme"
fi
if log_clean; then
ok "boot 2 log has no panic or trap"
else
bad "boot 2 log has no panic or trap"
fi
echo "== boot 3: safe mode disables panel =="
reset_theme
boot_vm
if wait_menu; then
monclick 200 126 || true
sleep 14
fastshot safe
sleep 1
if check $T/safe.ppm not_grey_at 500 754; then
ok "safe mode: no panel at bottom"
else
bad "safe mode: no panel at bottom"
fi
if log_clean; then
ok "boot 3 log has no panic or trap"
else
bad "boot 3 log has no panic or trap"
fi
else
bad "safe mode: boot menu never appeared"
fi
pkill -f '^qemu-system-x86_64' 2>/dev/null || true
reset_theme
rm -f $T/menu.ppm $T/bar.ppm $T/desk.ppm $T/start.ppm $T/safe.ppm $T/login.ppm $T/bar.ok $T/dicons.ppm $T/inbe.ppm $T/subm.ppm $T/rund.ppm $T/tmg.ppm $T/dmenu.ppm $T/themes.ppm $T/themeo.ppm
echo "== results: $pass passed, $fail failed =="
[ "$fail" -eq 0 ]
+119
View File
@@ -0,0 +1,119 @@
#!/bin/sh
# Self-contained verification: boots the VM, drives it via monitor
# injection, pixel-checks the new shell features, kills the VM.
set -u
cd /home/wao/Projects/taiji
T=boot/q9
. $T/monclick.sh
pass=0; fail=0
ok() { echo "PASS: $1"; pass=$((pass+1)); }
bad() { echo "FAIL: $1"; fail=$((fail+1)); }
check() { python3 $T/ppmcheck.py "$@"; }
shot() {
printf 'screendump /home/wao/Projects/taiji/boot/q9/%s.ppm\n' "$1" \
| socat - UNIX-CONNECT:$T/monitor.sock >/dev/null 2>&1
sleep 1
}
strip() {
python3 - "$1" "$2" <<'P2'
import sys
def stripimg(p):
f=open(p,'rb').read(); t=[];o=0
while len(t)<4:
while f[o:o+1].isspace(): o+=1
if f[o:o+1]==b'#':
while f[o:o+1]!=b'\n': o+=1
continue
s=o
while not f[o:o+1].isspace(): o+=1
t.append(f[s:o])
o+=1; w,h=int(t[1]),int(t[2]); return f[o:o+w*h*3]
a=stripimg(sys.argv[1]); b=stripimg(sys.argv[2])
w=1024
sa=a[(740*w)*3:(768*w)*3]
sb=b[(740*w)*3:(768*w)*3]
exit(0 if sa != sb else 1)
P2
}
pkill -f 'qemu-system-x86_64.*pxeboot' 2>/dev/null || true
sleep 2
rm -f $T/monitor.sock
setsid ./q9 --raw --headless gui >$T/verify-vm.log 2>&1 &
for i in $(seq 1 120); do
grep -q "q9: gui ready" $T/verify-vm.log 2>/dev/null && break
sleep 1
done
for i in $(seq 1 15); do [ -S $T/monitor.sock ] && break; sleep 1; done
i=0
while [ $i -lt 90 ]; do
shot vlogon
check $T/vlogon.ppm logon_at && break
sleep 2
i=$((i+1))
done
monclick 512 443
sleep 4
shot vdesk
if python3 $T/balloonchk.py $T/vdesk.ppm; then
ok "welcome balloon appears"
else
bad "welcome balloon appears"
fi
sleep 4
mondrag 400 80 700 300
shot vdrag
if python3 $T/dragchk.py $T/vdrag.ppm; then
ok "live drag moves the window"
else
bad "live drag moves the window"
fi
monkey ctrl-alt-shift-esc
sleep 4
shot vtaskmgr
if check $T/vtaskmgr.ppm white_at 100 150; then
ok "task manager appears"
else
bad "task manager appears"
fi
monclick 150 200
sleep 1
monkey q
sleep 2
shot mc0
mondblclick 46 26
sleep 4
shot mc1
if strip $T/mc0.ppm $T/mc1.ppm; then
ok "My Computer window opens from the desktop icon"
else
bad "My Computer window opens from the desktop icon"
fi
# icon drag: move My Computer away and back, position must persist
rm -f usr/glenda/lib/deskicons
mondrag 46 26 300 260
sleep 1
shot idrag
if [ -s usr/glenda/lib/deskicons ]; then
ok "icon drag saves its position"
else
bad "icon drag saves its position"
fi
if python3 $T/dragchk.py $T/idrag.ppm 2>/dev/null; then
:
fi
mondrag 300 260 46 26
sleep 1
monrclick 46 26
sleep 1
shot imenu
if check $T/imenu.ppm grey_at 60 40; then
ok "icon right click menu"
else
bad "icon right click menu"
fi
monclick 900 100
sleep 1
pkill -f 'qemu-system-x86_64.*pxeboot' 2>/dev/null || true
echo "== verify: $pass passed, $fail failed =="
[ "$fail" -eq 0 ]
+34
View File
@@ -0,0 +1,34 @@
#!/usr/bin/env python3
import socket, sys, time
def recvn(s, n):
b = b""
while len(b) < n:
c = s.recv(n - len(b))
if not c:
raise EOFError
b += c
return b
x, y = int(sys.argv[1]), int(sys.argv[2])
s = socket.create_connection(("127.0.0.1", int(__import__("os").environ.get("Q9_VNC_PORT", "5901"))), timeout=5)
s.settimeout(5)
recvn(s, 12) # server version
s.sendall(b"RFB 003.008\n")
n = recvn(s, 1)[0] # number of security types
recvn(s, n) # types
s.sendall(bytes([1])) # None
recvn(s, 4) # security result
s.sendall(bytes([1])) # ClientInit (shared)
hdr = recvn(s, 24) # ServerInit: w,h pixelformat, namelen
namelen = int.from_bytes(hdr[20:24], "big")
recvn(s, namelen)
def ptr(mask, x, y):
s.sendall(bytes([5, mask, x >> 8, x & 0xFF, y >> 8, y & 0xFF]))
time.sleep(0.3)
ptr(0, x, y); time.sleep(0.4)
ptr(1, x+1, y); time.sleep(0.8)
ptr(0, x, y); time.sleep(0.5)
s.close()
+71
View File
@@ -0,0 +1,71 @@
#!/usr/bin/env python3
"""Send keys to the TaijiOS VM via VNC. usage: vncsend.py KEY [KEY...]
KEY is a character (a, b, ...) or a name: ret, spc, bks, tab, esc."""
import socket, sys, time
def recvn(s, n):
b = b""
while len(b) < n:
c = s.recv(n - len(b))
if not c:
raise EOFError
b += c
return b
names = {
"ret": 0xff0d, "spc": 0x20, "bks": 0xff08, "tab": 0xff09,
"esc": 0xff1b, "del": 0xffff, "enter": 0xff0d, "bs": 0xff08,
"ctrl": 0xffe3, "shift": 0xffe1, "alt": 0xffe9, "win": 0xffeb,
}
s = socket.create_connection(("127.0.0.1", int(__import__("os").environ.get("Q9_VNC_PORT", "5901"))), timeout=5)
s.settimeout(5)
recvn(s, 12)
s.sendall(b"RFB 003.008\n")
n = recvn(s, 1)[0]
recvn(s, n)
s.sendall(bytes([1]))
recvn(s, 4)
s.sendall(bytes([1]))
hdr = recvn(s, 24)
recvn(s, int.from_bytes(hdr[20:24], "big"))
# QEMU ignores input until the client sets pixel format/encodings and
# sends at least one framebuffer update request
s.sendall(bytes([0, 0, 0, 0]) + bytes(16)) # SetPixelFormat
s.sendall(bytes([2, 0, 1, 0, 0, 0, 0])) # SetEncodings: 1 = RAW
s.sendall(bytes([3, 0, 0, 0, 0, 0, 4, 0, 4])) # FBUpdateRequest
time.sleep(0.3)
s.sendall(bytes([3, 1, 0, 0, 0, 0, 4, 0, 4])) # incremental update request
def key(kc, down):
s.sendall(bytes([4, down, kc >> 24, kc >> 16 & 0xFF, kc >> 8 & 0xFF, kc & 0xFF]))
# prime the connection: a harmless shift cycle settles QEMU's VNC
# input handling before the real keys go out
key(0xffe1, 1)
time.sleep(0.1)
key(0xffe1, 0)
time.sleep(0.2)
for arg in sys.argv[1:]:
down, up = 1, 1
if arg.startswith("+"):
arg, down = arg[1:], 1
up = 0
elif arg.startswith("-"):
arg, down = arg[1:], 0
up = 1
if arg in names:
kc = names[arg]
elif len(arg) == 1:
kc = ord(arg)
else:
continue
if down:
key(kc, 1)
time.sleep(0.15)
if up:
key(kc, 0)
time.sleep(0.1)
time.sleep(0.15)
s.close()
+52 -11
View File
@@ -5,32 +5,73 @@ cd $(dirname $0)
pxe=pxeboot.raw
vmdisk=false
case "$1" in
-pxenew)
pxe=pxeboot.raw.new
shift
;;
-mini)
pxe=mini.raw
shift
esac
gpu=${Q9_GPU:-vesa}
qemuvga=
while [ $# -gt 0 ]; do
case "$1" in
-pxenew)
pxe=pxeboot.raw.new
shift
;;
-mini)
pxe=mini.raw
shift
;;
--gpu|-gpu)
[ $# -ge 2 ] || {
echo 'usage: boot/qemu [-pxenew] [-mini] [--gpu vesa|vmware]' >&2
exit 1
}
gpu=$2
shift 2
;;
*)
break
;;
esac
done
case "$#" in
0)
;;
*)
echo 'usage: boot/qemu [-pxenew]' >&2
echo 'usage: boot/qemu [-pxenew] [-mini] [--gpu vesa|vmware]' >&2
exit 1
esac
case "$gpu" in
''|vesa|std|standard)
gpu=vesa
macaddr=52:54:00:12:34:56
;;
vmware|vmware-svga)
gpu=vmware
macaddr=52:54:00:12:34:5a
qemuvga=vmware
;;
*)
echo "boot/qemu: unknown GPU model: $gpu" >&2
echo 'boot/qemu: supported GPU models: vesa, vmware' >&2
exit 1
;;
esac
echo '# building u9fs' >&2
make -C ../sys/src/cmd/unix/u9fs
u9fs="guestfwd=tcp:10.0.2.1:564-cmd:../sys/src/cmd/unix/u9fs/u9fs -a none -u $USER .."
tftp='tftp=..'
mac=mac=52:54:00:12:34:56
mac=mac=$macaddr
if [ "$qemuvga" ]; then
set -- -vga "$qemuvga"
else
set --
fi
qemu-system-x86_64 -m 1G -smp 1 -serial stdio \
"$@" \
-drive file=$pxe,format=raw -snapshot \
-device virtio-net-pci,netdev=net0,$mac \
-netdev "user,id=net0,$u9fs,$tftp"
+7 -7
View File
@@ -1,8 +1,8 @@
[menu]
menuitem=1920x1080, Plan 9 1920x1080
menuitem=1440x900, Plan 9 1440x900
menuitem=1280x768, Plan 9 1280x768
menuitem=text, Plan 9 Text Mode
menuitem=1920x1080, TaijiOS 1920x1080
menuitem=1440x900, TaijiOS 1440x900
menuitem=1280x768, TaijiOS 1280x768
menuitem=text, TaijiOS Text Mode
[1920x1080]
vgasize=1920x1080x32
@@ -14,16 +14,14 @@ vgasize=1440x900x32
vgasize=1280x768x32
[text]
bootfile=ether0!/sys/src/9k/k10/9k10
vgasize=none
debugboot=1
[common]
bootfile=ether0!/386/9pc
bootfile=ether0!/amd64/9k10
fs=10.0.2.1
auth=10.0.2.1
sysname=gnot
sysname=taiji
*nobiosload=1
partition=new
factotumopts=-n
@@ -33,3 +31,5 @@ mouseport=ps2intellimouse
monitor=vesa
*nomp=1
nobootprompt=tcp
*noconscreen=1
+18
View File
@@ -0,0 +1,18 @@
bootfile=ether0!/386/9pc
fs=10.0.2.1
auth=10.0.2.1
sysname=taiji
*nobiosload=1
partition=new
factotumopts=-n
user=glenda
q9mode=text
q9unix=1
q9fast=1
nousbboot=1
console=0
mouseport=ps2intellimouse
monitor=vesa
vgasize=1024x768x32
*nomp=1
nobootprompt=tcp
+18
View File
@@ -0,0 +1,18 @@
bootfile=ether0!/386/9pc
fs=10.0.2.1
auth=10.0.2.1
sysname=taiji
*nobiosload=1
partition=new
factotumopts=-n
user=glenda
q9unix=1
q9fast=1
nousbboot=1
console=0
mouseport=ps2intellimouse
monitor=vesa
vgasize=1024x768x32
*nomp=1
nobootprompt=tcp
*noconscreen=1
+19
View File
@@ -0,0 +1,19 @@
bootfile=ether0!/386/9pc
fs=10.0.2.1
auth=10.0.2.1
sysname=taiji
*nobiosload=1
partition=new
factotumopts=-n
user=glenda
q9unix=1
q9fast=1
nousbboot=1
console=0
mouseport=ps2intellimouse
monitor=xga
vgasize=1024x768x32
*nomp=1
nobootprompt=tcp
*noconscreen=1
+7
View File
@@ -0,0 +1,7 @@
This directory is used by the host-side `./q9` launcher.
`./q9 run 'command'` writes a temporary `run.rc` here. Glenda's profile
sources that file when the guest boots with `q9mode=text`.
`./q9 --kernel name` writes a temporary generated PXE profile under
`cfg/pxe` while QEMU is starting, then removes it when the launcher exits.
+6
View File
@@ -0,0 +1,6 @@
#!/bin/rc
cd /sys/src/cmd/linuxrun
mk install || echo linuxrun-build-failed
mk clean
cd /
echo lr-build-done
+24
View File
@@ -0,0 +1,24 @@
#!/bin/rc
# Rebuild the components changed by the desktop work: window server,
# X bridge, rill, and the kernel's Ctrl+Tab rune table entry.
cd /sys/src/cmd/rio9
if(! mk install){
echo taiji-build-rio9-failed
exit failed
}
cd /sys/src/cmd/xbridge
if(! mk install){
echo taiji-build-xbridge-failed
exit failed
}
cd /sys/src/cmd/rill
if(! mk install){
echo taiji-build-rill-failed
exit failed
}
cd /sys/src/9/pc
if(! mk install){
echo taiji-build-kernel-failed
exit failed
}
echo taiji-build-all-ok
+13
View File
@@ -0,0 +1,13 @@
#!/bin/rc
# Rebuild the window server and X bridge after source changes.
cd /sys/src/cmd/rio9
if(! mk install){
echo taiji-build-rio9-failed
exit failed
}
cd /sys/src/cmd/xbridge
if(! mk install){
echo taiji-build-xbridge-failed
exit failed
}
echo taiji-build-desktop-ok
+7
View File
@@ -0,0 +1,7 @@
#!/bin/rc
cd /sys/src/9/pc
if(! mk install){
echo taiji-fp-kernel-failed
exit failed
}
echo taiji-fp-kernel-built
+4
View File
@@ -0,0 +1,4 @@
#!/bin/rc
cd /sys/src/cmd/rill
rm -f src/*.8 8.out /386/bin/rill
mk install
+10
View File
@@ -0,0 +1,10 @@
#!/bin/rc
# Minimal cross-process dbus bridge reproducer: daemon + dbus-send.
rm -f /debian/rootfs/tmp/dbus-1 /debian/rootfs/tmp/dbus-1.req
rm -f /debian/rootfs/tmp/*.t.*
debian-session -c 'linuxrun /usr/bin/dbus-daemon --config-file /usr/share/dbus-1/dbus-run.conf --nofork --nopidfile' &
sleep 20
echo dbus-up
debian-session -c 'linuxrun /bin/sh /tmp/dsend.sh' &
sleep 420
echo dbus-probe-done
+23
View File
@@ -0,0 +1,23 @@
#!/bin/rc
{
echo '<busconfig>'
echo ' <type>session</type>'
echo ' <listen>unix:path=/tmp/dbus-1</listen>'
echo ' <auth>EXTERNAL</auth>'
echo ' <policy context="default">'
echo ' <allow send_destination="*"/>'
echo ' <allow receive_sender="*"/>'
echo ' <allow own="*"/>'
echo ' </policy>'
echo '</busconfig>'
} > /debian/rootfs/tmp/dbus.conf
echo dbus-version-test
debian-session -c 'linuxrun /usr/bin/dbus-daemon --version' &
sleep 30
echo dbus-version-done
echo dbus-fork-test
debian-session -c 'linuxrun /usr/bin/dbus-daemon --config-file /usr/share/dbus-1/dbus-run.conf --nofork --nopidfile' &
sleep 45
echo dbus-fork-done
ps
echo dbus-test-done
+19
View File
@@ -0,0 +1,19 @@
#!/bin/rc
# Rebuild rill and diagnose the desktop boot with its output captured.
cd /sys/src/cmd/rill
if(! mk install){
echo taiji-rill-rebuild-failed
exit failed
}
echo '--- rill text symbols near the fault ---'
nm /386/bin/rill | awk '$1 ~ /^[0-9a-f]+$/ { print $1, $2, $3 }' |
sort -x | awk '$1 <= "22c064"' | tail -3
rio9 -d 'rill >/usr/glenda/tmp/rill-boot.log >[2=1]' &
wm=$apid
sleep 30
echo '--- rill boot log ---'
cat /usr/glenda/tmp/rill-boot.log
echo '--- processes ---'
ps | grep -v grep | grep -E 'rill|rio9'
echo taiji-desktop-diag-done
+4
View File
@@ -0,0 +1,4 @@
#!/bin/rc
debian-session -c 'linuxrun /bin/sh -c set' >[2] /debian/rootfs/tmp/env-test.log &
sleep 60
echo env-test-done
+39
View File
@@ -0,0 +1,39 @@
#include <u.h>
#include <libc.h>
static void
fpnote(void*, char *note)
{
if(strncmp(note, "sys: fp:", 8) == 0)
exits(nil);
noted(NDFLT);
}
void
main(void)
{
int pid;
Waitmsg *w;
volatile double zero, result;
pid = fork();
if(pid < 0)
sysfatal("fork: %r");
if(pid == 0){
notify(fpnote);
zero = 0.0;
result = zero / zero;
print("unexpected floating point result: %g\n", result);
exits("exception not delivered");
}
w = wait();
if(w == nil || w->pid != pid || w->msg[0] != 0)
sysfatal("floating point exception did not reach child note handler");
free(w);
zero = 3.5;
result = zero * 2.0;
if(result != 7.0)
sysfatal("parent floating point state changed");
print("taiji-fp-exception-ok\n");
exits(nil);
}
+13
View File
@@ -0,0 +1,13 @@
#!/bin/rc
# Minimal GDBus sync harness against the session bus, under the emulator.
rc /cfg/q9/build-all.rc
echo build-phase-done
sleep 20
rm -f /debian/rootfs/tmp/dbus-1 /debian/rootfs/tmp/dbus-1.req
rm -f /debian/rootfs/tmp/*.t.*
debian-session -c 'linuxrun /usr/bin/dbus-daemon --config-file /usr/share/dbus-1/dbus-run.conf --nofork --nopidfile' &
sleep 20
echo dbus-up
debian-session -c 'linuxrun /tmp/gbus_harness' &
sleep 1200
echo harness-done
+13
View File
@@ -0,0 +1,13 @@
#!/bin/rc
# Minimal glib-main-loop dbus reproducer: daemon + gdbus call.
# dbus-send (libdbus, no main loop) round-trips fine; gdbus uses the
# same GDBus worker machinery as xfwm4 - if it wedges, this is the
# reproducer for the dispatch bug.
rm -f /debian/rootfs/tmp/dbus-1 /debian/rootfs/tmp/dbus-1.req
rm -f /debian/rootfs/tmp/*.t.*
debian-session -c 'linuxrun /usr/bin/dbus-daemon --config-file /usr/share/dbus-1/dbus-run.conf --nofork --nopidfile' &
sleep 20
echo dbus-up
debian-session -c 'linuxrun /bin/sh /tmp/gdbuscall.sh' &
sleep 420
echo gdbus-probe-done
+20
View File
@@ -0,0 +1,20 @@
#!/bin/rc
# GTK discriminator: xfce4-panel is a plain GTK3 client (not a WM).
# sees a live MapRequest — testing event-driven adoption end to end.
mkdir -p /debian/rootfs/tmp/.X11-unix
rm -f /debian/rootfs/tmp/.X0-lock /debian/rootfs/tmp/.X11-unix/X0.req /debian/rootfs/tmp/.X11-unix/X0.q
debian-session -c 'linuxrun /usr/bin/Xvfb :0 -screen 0 1024x768x24' >[2] /debian/rootfs/tmp/n11-xvfb.log &
sleep 75
echo xvfb-up
debian-session -c 'linuxrun /usr/bin/xfce4-panel --display :0' >[2=1] /debian/rootfs/tmp/n11-panel.log &
sleep 240
echo wm-up
debian-session -c 'linuxrun /usr/bin/xeyes -display :0 -geometry +400+300' >[2=1] /debian/rootfs/tmp/n11-xeyes.log &
sleep 300
echo xeyes-phase
debian-session -c 'linuxrun /usr/bin/xwd -root -out /tmp/shot11.xwd' >[2] /debian/rootfs/tmp/n11-xwd.log &
sleep 900
echo shot-try1
ls -l /debian/rootfs/tmp/shot11.xwd
cp /debian/rootfs/tmp/shot11.xwd /debian/rootfs/shot1.xwd
echo xfce-shot-done
+17
View File
@@ -0,0 +1,17 @@
#!/bin/rc
rm -f /debian/rootfs/tmp/shot1.xwd
mkdir -p /debian/rootfs/tmp/.X11-unix
rm -f /debian/rootfs/tmp/.X0-lock /debian/rootfs/tmp/.X11-unix/X0.req /debian/rootfs/tmp/.X11-unix/X0.q
debian-session -c 'linuxrun /usr/bin/Xvfb :0 -screen 0 1024x768x24' >[2] /tmp/xvfb.log &
sleep 75
echo xvfb-up
#debian-session -c 'SHELL=/bin/sh linuxrun /usr/bin/xfwm4 --display :0' >[2] /tmp/probe.log &
sleep 420
echo probe-done
echo xvfb-log
cat /tmp/xvfb.log
echo probe-log
cat /tmp/probe.log
echo probe-ps
ps
echo gtk-probe-rc-done
+80
View File
@@ -0,0 +1,80 @@
/* Minimal GDBus sync harness - links against the rootfs's own i386
* glib. Reproduces the exact call path that wedges in xfwm4:
* g_bus_get_sync on the session bus, then one sync method call. */
typedef unsigned long ulong_t;
typedef int bool_t;
extern void *g_bus_get_sync(int bus_type, void *cancellable, void **error);
extern void g_object_unref(void *obj);
extern void g_error_free(void *err);
extern void g_print(const char *fmt, ...);
extern void *g_dbus_connection_call_sync(void *conn, const char *name,
const char *path, const char *iface, const char *method,
void *params, void **reply_type, int flags, int timeout,
void *cancellable, void **error);
static int
streq_n(void)
{
return 0;
}
static const char hexdig[] = "0123456789abcdef";
static void
putptr(const char *tag, void *p)
{
char b[32];
int i;
ulong_t v;
for (i = 0; i < 31; i++)
b[i] = ' ';
b[31] = 0;
/* copy tag */
for (i = 0; tag[i] && i < 12; i++)
b[i] = tag[i];
b[i++] = '=';
v = (ulong_t)p;
b[i++] = '0';
b[i++] = 'x';
if (v == 0) {
b[i++] = '0';
} else {
char t[20];
int n = 0;
while (v && n < 16) {
t[n++] = hexdig[v & 0xf];
v >>= 4;
}
while (n)
b[i++] = t[--n];
}
b[i++] = '\n';
__asm__ __volatile__(
"movl $4, %%eax\n"
"movl $1, %%ebx\n"
"movl %0, %%ecx\n"
"movl %1, %%edx\n"
"int $0x80\n"
: : "r"(b), "r"(i) : "eax", "ebx", "ecx", "edx");
streq_n();
}
int
main(void)
{
void *err = 0;
void *conn;
putptr("harness-start", (void*)0x1234);
conn = g_bus_get_sync(2, 0, &err);
putptr("conn", conn);
putptr("err", err);
if (conn == 0)
return 2;
g_object_unref(conn);
putptr("done", (void*)0x77);
return 0;
}
+178
View File
@@ -0,0 +1,178 @@
/* interpose glib's context machinery: the exe's definitions win over
* libglib for libgio's calls; forward to the real ones via dlsym */
typedef unsigned long usize;
extern void *dlsym(void *handle, const char *name);
#define RTLD_NEXT ((void *)-1l)
extern void tr3(const char *tag, long a, long b, long c);
/* putnum/tr3 copies from interpose.c are static there; re-declare a
* tiny local printer via the one in interpose.c (non-static there) */
int g_main_context_prepare(void *context, int *priority);
int
g_main_context_prepare(void *context, int *priority)
{
static int (*real)(void *, int *);
int r;
if (!real)
real = (int (*)(void *, int *))dlsym(RTLD_NEXT, "g_main_context_prepare");
tr3("TRprep", (long)context, 0, 0);
r = real ? real(context, priority) : 0;
tr3("TRprep=", r, priority ? *priority : 0, 0);
return r;
}
int g_main_context_check(void *context, int maxp, void *fds, int nfds);
int
g_main_context_check(void *context, int maxp, void *fds, int nfds)
{
static int (*real)(void *, int, void *, int);
int r;
if (!real)
real = (int (*)(void *, int, void *, int))dlsym(RTLD_NEXT, "g_main_context_check");
r = real ? real(context, maxp, fds, nfds) : 0;
tr3("TRchk", (long)context, nfds, r);
return r;
}
int g_main_context_dispatch(void *context);
int
g_main_context_dispatch(void *context)
{
static int (*real)(void *);
int r;
if (!real)
real = (int (*)(void *))dlsym(RTLD_NEXT, "g_main_context_dispatch");
tr3("TRdisp", (long)context, 0, 0);
r = real ? real(context) : 0;
return r;
}
void *g_main_context_invoke_full(void *context, int prio, void *func, void *data, void *notify);
void *
g_main_context_invoke_full(void *context, int prio, void *func, void *data, void *notify)
{
static void *(*real)(void *, int, void *, void *, void *);
if (!real)
real = (void *(*)(void *, int, void *, void *, void *))dlsym(RTLD_NEXT, "g_main_context_invoke_full");
tr3("TRinvk", (long)context, (long)func, prio);
return real ? real(context, prio, func, data, notify) : 0;
}
void *g_source_attach(void *source, void *context);
void *
g_source_attach(void *source, void *context)
{
static void *(*real)(void *, void *);
if (!real)
real = (void *(*)(void *, void *))dlsym(RTLD_NEXT, "g_source_attach");
tr3("TRatch", (long)source, (long)context, 0);
return real ? real(source, context) : 0;
}
int g_socket_condition_check(void *socket, int condition);
int
g_socket_condition_check(void *socket, int condition)
{
static int (*real)(void *, int);
int r;
if (!real)
real = (int (*)(void *, int))dlsym(RTLD_NEXT, "g_socket_condition_check");
r = real ? real(socket, condition) : 0;
tr3("TRsockchk", (long)condition, r, 0);
return r;
}
void *g_main_context_invoke(void *context, void *func, void *data);
void *
g_main_context_invoke(void *context, void *func, void *data)
{
static void *(*real)(void *, void *, void *);
if (!real)
real = (void *(*)(void *, void *, void *))dlsym(RTLD_NEXT, "g_main_context_invoke");
tr3("TRinv0", (long)context, (long)func, 0);
return real ? real(context, func, data) : 0;
}
int g_main_context_acquire(void *context);
int
g_main_context_acquire(void *context)
{
static int (*real)(void *);
int r;
if (!real)
real = (int (*)(void *))dlsym(RTLD_NEXT, "g_main_context_acquire");
r = real ? real(context) : 0;
tr3("TRacq", (long)context, r, 0);
return r;
}
int g_main_context_is_owner(void *context);
int
g_main_context_is_owner(void *context)
{
static int (*real)(void *);
int r;
if (!real)
real = (int (*)(void *))dlsym(RTLD_NEXT, "g_main_context_is_owner");
r = real ? real(context) : 0;
tr3("TRowner", (long)context, r, 0);
return r;
}
void *g_task_attach_source(void *task, void *source, void *func);
void *
g_task_attach_source(void *task, void *source, void *func)
{
tr3("TRtasksrc", (long)task, (long)source, 0);
return task; /* unreachable: g_task_attach_source is private */
}
void g_main_context_push_thread_default(void *context);
void
g_main_context_push_thread_default(void *context)
{
static void (*real)(void *);
if (!real)
real = (void (*)(void *))dlsym(RTLD_NEXT, "g_main_context_push_thread_default");
tr3("TRpush", (long)context, 0, 0);
if (real)
real(context);
}
void g_main_context_pop_thread_default(void *context);
void
g_main_context_pop_thread_default(void *context)
{
static void (*real)(void *);
if (!real)
real = (void (*)(void *))dlsym(RTLD_NEXT, "g_main_context_pop_thread_default");
tr3("TRpop", (long)context, 0, 0);
if (real)
real(context);
}
void *g_main_loop_new(void *context, int is_running);
void *
g_main_loop_new(void *context, int is_running)
{
static void *(*real)(void *, int);
if (!real)
real = (void *(*)(void *, int))dlsym(RTLD_NEXT, "g_main_loop_new");
tr3("TRloopnew", (long)context, (long)is_running, 0);
return real ? real(context, is_running) : 0;
}
+159
View File
@@ -0,0 +1,159 @@
/* interpose the libc I/O surface: definitions in the executable win
* the global symbol lookup, so libgio's write/writev/poll/read calls
* come here - a userspace-level trace of glib's decisions, forwarded
* via raw int80 (no libc recursion) */
typedef unsigned long usize;
static void
putnum(char *out, int *n, usize v)
{
char t[20];
int k = 0;
const char *hex = "0123456789abcdef";
if (v == 0)
t[k++] = '0';
while (v && k < 16) {
t[k++] = hex[v & 0xf];
v >>= 4;
}
out[(*n)++] = '0';
out[(*n)++] = 'x';
while (k)
out[(*n)++] = t[--k];
}
void
tr3(const char *tag, long a, long b, long c)
{
char buf[96];
int n = 0;
while (tag[n] && n < 12) { buf[n] = tag[n]; n++; }
buf[n++] = ' ';
putnum(buf, &n, (usize)a);
buf[n++] = '/';
putnum(buf, &n, (usize)b);
buf[n++] = '/';
putnum(buf, &n, (usize)c);
buf[n++] = '\n';
__asm__ __volatile__(
"movl $4, %%eax\n movl $1, %%ebx\n movl %0, %%ecx\n movl %1, %%edx\n int $0x80\n"
: : "r"(buf), "r"((long)n) : "eax", "ebx", "ecx", "edx");
}
static long
raw3(long nr, long a, long b, long c)
{
long ret;
__asm__ __volatile__(
"int $0x80\n"
: "=a"(ret)
: "a"(nr), "b"(a), "c"(b), "d"(c)
: "memory");
return ret;
}
long write(int fd, const void *buf, usize n);
long
write(int fd, const void *buf, usize n)
{
long r;
tr3("TRwr", fd, (long)n, 0);
r = raw3(4, fd, (long)buf, (long)n);
tr3("TRwr=", r, 0, 0);
return r;
}
struct iov { void *base; usize len; };
long writev(int fd, const struct iov *v, int cnt);
long
writev(int fd, const struct iov *v, int cnt)
{
long total = 0;
int i;
tr3("TRwrv", fd, cnt, cnt > 0 ? (long)v[0].len : 0);
for (i = 0; i < cnt; i++) {
long r = raw3(4, fd, (long)v[i].base, (long)v[i].len);
if (r < 0)
return r;
total += r;
}
tr3("TRwrv=", total, 0, 0);
return total;
}
long poll(void *ufds, unsigned long nfds, int timeout);
long
poll(void *ufds, unsigned long nfds, int timeout)
{
tr3("TRpoll", nfds, timeout, ((int*)ufds)[0]);
return raw3(168, (long)ufds, (long)nfds, timeout);
}
long read(int fd, void *buf, usize n);
long
read(int fd, void *buf, usize n)
{
long r;
tr3("TRrd", fd, (long)n, 0);
r = raw3(3, fd, (long)buf, (long)n);
tr3("TRrd=", r, 0, 0);
return r;
}
long sendmsg(int fd, void *msg, int flags);
long
sendmsg(int fd, void *msg, int flags)
{
/* msg: msghdr with iov at +8, iovlen at +12 */
struct iov *v = *(struct iov **)((char *)msg + 8);
int cnt = *(int *)((char *)msg + 12);
tr3("TRsendmsg", fd, cnt, cnt > 0 ? (long)v[0].len : 0);
{
long total = 0;
int i;
for (i = 0; i < cnt; i++) {
long r = raw3(4, fd, (long)v[i].base, (long)v[i].len);
if (r < 0)
return r;
total += r;
}
tr3("TRsmsg=", total, 0, 0);
return total;
}
}
long recvmsg(int fd, void *msg, int flags);
long
recvmsg(int fd, void *msg, int flags)
{
struct iov *v = *(struct iov **)((char *)msg + 8);
int cnt = *(int *)((char *)msg + 12);
long r;
tr3("TRrecvmsg", fd, cnt, flags);
if (cnt < 1)
return raw3(102 * 256 + 17, 0, 0, 0);
r = raw3(3, fd, (long)v[0].base, (long)v[0].len);
tr3("TRrmsg=", r, 0, 0);
return r;
}
long send(int fd, const void *buf, usize n, int flags);
long
send(int fd, const void *buf, usize n, int flags)
{
long r;
tr3("TRsend", fd, (long)n, flags);
r = raw3(4, fd, (long)buf, (long)n);
tr3("TRsend=", r, 0, 0);
return r;
}
+7
View File
@@ -0,0 +1,7 @@
.global _start
_start:
call main
movl %eax, %ebx
movl $252, %eax
int $0x80
hlt
+8
View File
@@ -0,0 +1,8 @@
#!/bin/rc
echo kbuild-start
cd /sys/src/9/pc
CONF=9pc mk install
cd /sys/src/cmd/linuxrun
mk install
mk clean
rc /cfg/q9/xfce-test.rc
+67
View File
@@ -0,0 +1,67 @@
#!/bin/rc
fn fail {
cat /tmp/unified-xvfb.log /tmp/unified-xeyes.log >[2]/dev/null
if(! ~ $#doc 0)
rm -f $doc
echo taiji-unified-failed: $*
exit failed
}
cd /sys/src/cmd/linuxrun
mk install || fail linuxrun-build
cd /sys/src/cmd/xbridge
mk install || fail xbridge-build
cd /sys/src/cmd/rio9
mk install || fail window-server-build
rfork n
ramfs
bind -c /tmp /debian/rootfs/tmp || fail temporary-files
mkdir -p /debian/rootfs/tmp/unified-test
cp /sys/src/cmd/linuxrun/test/busybox.elf /debian/rootfs/tmp/unified-test/busybox
debian-session /taiji/bin/linuxrun -e 'DISPLAY=:77' /tmp/unified-test/busybox sh -c 'echo "$DISPLAY"; DISPLAY=:88; export DISPLAY; exec /tmp/unified-test/busybox sh -c ''echo "$DISPLAY"''' >/tmp/unified-env
environment=`{cat /tmp/unified-env}
if(! ~ $"environment ':77 :88')
fail environment
echo taiji-unified-environment-ok
mkdir -p /usr/glenda/Documents
doc=/usr/glenda/Documents/unified-test-$pid.txt
echo native-document >$doc
debian-session /taiji/bin/linuxrun /tmp/unified-test/busybox cat /home/user/Documents/unified-test-$pid.txt >/tmp/unified-doc
if(! ~ `{cat /tmp/unified-doc} native-document)
fail documents
debian-session /taiji/bin/linuxrun /tmp/unified-test/busybox realpath /home/user/Documents/unified-test-$pid.txt >/tmp/unified-realpath
if(! ~ `{cat /tmp/unified-realpath} /home/user/Documents/unified-test-$pid.txt)
fail document-path
debian-session /taiji/bin/linuxrun /tmp/unified-test/busybox sh -c 'echo linux-document > "$1"' sh /home/user/Documents/unified-test-$pid.txt
if(! ~ `{cat $doc} linux-document)
fail document-save
rm -f $doc
doc=()
echo taiji-unified-documents-ok
debian-session /taiji/bin/linuxrun /usr/bin/Xvfb :77 -screen 0 640x480x24 -nolisten tcp -extension GLX >/tmp/unified-xvfb.log >[2=1] &
server=$apid
sleep 8
debian-session /taiji/bin/linuxrun -e 'DISPLAY=:77' /usr/bin/xeyes -geometry 240x160+40+40 >/tmp/unified-xeyes.log >[2=1] &
app=$apid
sleep 8
xbridge -s /usr/glenda/tmp/unified-screen.ppm /debian/rootfs/tmp/.X11-unix/X77 || fail bridge
# The trixie Xvfb intermittently leaves the wire-level selection dance
# without a reply; the selftest fails fast on its alarm instead of
# hanging, so one immediate retry separates the flake from real damage.
xbridge -T /debian/rootfs/tmp/.X11-unix/X77 || xbridge -T /debian/rootfs/tmp/.X11-unix/X77 || fail input-clipboard
echo taiji-unified-display-ok
if(test -e /proc/$app/ctl)
echo kill >/proc/$app/ctl
echo kill >/proc/$server/ctl
# Closing applications must not leak processes; give the kills a moment.
sleep 3
if(grep -s linuxrun /proc/[0-9]*/status)
fail linuxrun-left-behind
if(grep -s xbridge /proc/[0-9]*/status)
fail xbridge-left-behind
if(grep -s Xvfb /proc/[0-9]*/status)
fail Xvfb-left-behind
echo taiji-unified-cleanup-ok
echo taiji-unified-smoke-ok
+14
View File
@@ -0,0 +1,14 @@
#!/bin/rc
# Watchdog: periodically dump ps, and poke every linuxrun process with
# a 'sample' note - the emulator prints the guest's current PC (the
# sampling profiler). Three pokes per cycle for a small distribution.
for(i in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40){
sleep 240
echo WD $i
ps
for(f in /proc/[0-9]*/note){
echo -n sample > $f >[2]/dev/null
echo -n sample > $f >[2]/dev/null
echo -n sample > $f >[2]/dev/null
}
}
+153
View File
@@ -0,0 +1,153 @@
#include <u.h>
#include <libc.h>
#include <draw.h>
#include "rill_platform.h"
static const RillPlatformServices *platform;
static RillTask tasks[8];
static int ids[2];
static void
check(int ok, char *message)
{
if(!ok){
fprint(2, "taiji-window-failed: %s: %r\n", message);
exits("failed");
}
}
static int
windowfile(int id, char *name, int mode)
{
char path[128];
snprint(path, sizeof path, "/dev/wsys/%d/%s", id, name);
return open(path, mode);
}
static void
control(int id, char *command)
{
int fd;
fd = windowfile(id, "wctl", OWRITE);
check(fd >= 0, "open control");
check(write(fd, command, strlen(command)) == strlen(command), command);
close(fd);
}
static int
state(int id, char *wanted)
{
char buf[128];
int attempt, fd, n;
for(attempt=0; attempt<50; attempt++){
fd = windowfile(id, "winfo", OREAD);
if(fd >= 0){
n = read(fd, buf, sizeof(buf)-1);
close(fd);
if(n > 0){
buf[n] = 0;
if(strstr(buf, wanted) != nil)
return 1;
}
}
sleep(20);
}
return 0;
}
void
main(void)
{
int fd, held, mousefd, i, n, pixels;
char buf[128];
uchar black[4], covered[4], sample[4];
check(initdraw(nil, nil, "Desktop test") >= 0, "open desktop image");
mousefd = open("/dev/mouse", OREAD);
check(mousefd >= 0, "mark desktop as a graphical client");
draw(screen, screen->r, display->black, nil, ZP);
flushimage(display, 1);
platform = RillPlatformCurrent();
check(platform->list_tasks(tasks, 8) == 0, "exclude desktop");
fd = open("/dev/wctl", OWRITE);
check(fd >= 0, "desktop control");
check(fprint(fd, "new -r 40 60 440 360 sleep 120") > 0, "first window");
check(fprint(fd, "new -r 200 100 600 400 sleep 120") > 0, "second window");
close(fd);
for(i=0; i<50 && platform->list_tasks(tasks, 8)!=2; i++)
sleep(20);
check(platform->list_tasks(tasks, 8) == 2, "list both windows");
ids[0] = tasks[0].id;
ids[1] = tasks[1].id;
/* Refnone clients repaint after other windows change visibility. */
draw(screen, screen->r, display->black, nil, ZP);
flushimage(display, 1);
pixels = unloadimage(display->image, Rect(5, 5, 6, 6), black, sizeof black);
check(pixels > 0, "sample desktop");
check(unloadimage(display->image, Rect(50, 100, 51, 101), covered, sizeof covered) == pixels,
"sample application");
check(memcmp(black, covered, pixels) != 0, "application covers desktop");
fd = open("/dev/wctl", OWRITE);
check(fd >= 0, "overlay control");
check(fprint(fd, "overlay 0 0 100 150") > 0, "publish desktop popup");
check(unloadimage(display->image, Rect(50, 100, 51, 101), sample, sizeof sample) == pixels &&
memcmp(black, sample, pixels) == 0, "popup renders over application");
check(fprint(fd, "overlay 0 bad 100 150") < 0, "reject malformed popup");
check(platform->focus_task(ids[0]), "activate below popup");
check(unloadimage(display->image, Rect(50, 100, 51, 101), sample, sizeof sample) == pixels &&
memcmp(black, sample, pixels) == 0, "popup stays above focused application");
check(fprint(fd, "overlay") > 0, "dismiss popup");
check(unloadimage(display->image, Rect(50, 100, 51, 101), sample, sizeof sample) == pixels &&
memcmp(covered, sample, pixels) == 0, "dismissal reveals application");
close(fd);
fd = windowfile(ids[0], "wctl", OWRITE);
check(fd >= 0 && fprint(fd, "overlay 0 0 100 100") < 0, "reject application overlay");
close(fd);
fd = windowfile(ids[0], "label", OWRITE);
check(fd >= 0, "open label");
check(write(fd, "Shared editor", 13) == 13, "set title");
close(fd);
/* An application owns its wctl reader throughout taskbar polling. */
held = windowfile(ids[0], "wctl", OREAD);
check(held >= 0 && read(held, buf, sizeof buf) > 0, "own resize stream");
check(platform->focus_task(ids[0]), "activate visible window");
check(state(ids[0], " current visible window"), "visible window focused");
n = platform->list_tasks(tasks, 8);
check(n == 2, "poll while resize reader held");
for(i=0; i<n && tasks[i].id!=ids[0]; i++)
;
check(i<n && tasks[i].focused && strcmp(tasks[i].title, "Shared editor")==0,
"title and focus snapshot");
fd = windowfile(ids[0], "wctl", OREAD);
check(fd < 0, "original resize reader still owns stream");
close(held);
control(ids[0], "hide");
check(state(ids[0], " hidden window"), "hide window");
check(platform->list_tasks(tasks, 8) == 2, "hidden task retained");
check(platform->focus_task(ids[0]), "activate hidden window");
check(state(ids[0], " current visible window"), "restore hidden window");
check(platform->focus_task(ids[1]), "switch windows");
check(state(ids[1], " current visible window"), "second window focused");
check(state(ids[0], " notcurrent visible window"), "first window unfocused");
/* Ctrl+Tab cycles application windows through the same activation
* path as taskbar clicks; the chord is injected as synthesized
* keyboard input (Kctab = KF|0x19 in UTF-8). */
fd = open("/dev/kbdin", OWRITE);
check(fd >= 0, "open keyboard input");
check(write(fd, "\xEF\x80\x99", 3) == 3, "inject Ctrl+Tab");
close(fd);
check(state(ids[0], " current visible window"), "Ctrl+Tab focuses next window");
check(state(ids[1], " notcurrent visible window"), "Ctrl+Tab unfocuses previous");
check(!platform->focus_task(999999), "reject missing window");
for(i=0; i<2; i++)
control(ids[i], "delete");
for(i=0; i<50 && platform->list_tasks(tasks, 8)!=0; i++)
sleep(20);
check(platform->list_tasks(tasks, 8) == 0, "remove closed tasks");
close(mousefd);
print("taiji-window-smoke-ok\n");
exits(nil);
}
+30
View File
@@ -0,0 +1,30 @@
#!/bin/rc
fn fail {
echo taiji-window-failed: $*
exit failed
}
cd /cfg/q9
8c -o /tmp/fp-exception.8 fp-exception.c || fail floating-point-compile
8l -o /tmp/fp-exception /tmp/fp-exception.8 || fail floating-point-link
/tmp/fp-exception || fail floating-point-exception
cd /sys/src/cmd/rio9
mk install || fail window-server-build
cd /sys/src/cmd/rill
mk install || fail desktop-build
cd /cfg/q9
cpp -+ -I/sys/src/cmd/rill/include -I/sys/src/kryon/src/platform/plan9/include -I/sys/src/kryon/include -DKRYON_NATIVE_PLAN9 window-smoke.c >/tmp/window-smoke.i || fail preprocess
8c -FTVw -o /tmp/window-smoke.8 /tmp/window-smoke.i || fail compile
8l -o /tmp/window-smoke /tmp/window-smoke.8 /sys/src/cmd/rill/src/platform_plan9.8 /386/lib/libstdio.a -ldraw || fail link
result=/usr/glenda/tmp/window-smoke-result
echo >$result
rio9 -d '/tmp/window-smoke >/usr/glenda/tmp/window-smoke-result >[2=1]' &
for(attempt in `{seq 1 30}){
if(grep -s 'taiji-window-' $result){
cat $result
rm -f $result
exit
}
sleep 1
}
cat $result
fail timeout
+49
View File
@@ -0,0 +1,49 @@
#!/bin/rc
# Wine notepad against a live Xvfb display: the end-to-end Track 4 probe.
# If notepad maps a window, the xbridge snapshot of the X screen shows it.
if(! test -x /debian/rootfs/usr/lib/wine/wine){
echo taiji-wine-missing
exit missing
}
cd /sys/src/cmd/linuxrun
if(! mk install){
echo taiji-wine-linuxrun-build-failed
exit failed
}
rfork n
ramfs
bind -c /tmp /debian/rootfs/tmp
mkdir -p /debian/rootfs/tmp/.X11-unix
debian-session /taiji/bin/linuxrun /usr/bin/Xvfb :61 -screen 0 640x480x24 -nolisten tcp -extension GLX >/tmp/wine-xvfb.log >[2=1] &
server=$apid
ready=no
for(i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45){
if(test -e /debian/rootfs/tmp/.X11-unix/X61^.req)
ready=yes
if not
sleep 1
}
if(~ $ready no){
echo taiji-wine-xvfb-failed
cat /tmp/wine-xvfb.log
if(test -e /proc/$server/ctl)
echo kill >/proc/$server/ctl
exit failed
}
echo taiji-wine-xvfb-ready
LINUXRUN_LOW=1 debian-session /taiji/bin/linuxrun -e 'WINEDEBUG=-all' -e 'HOME=/home/user' -e 'DISPLAY=:61' /usr/lib/wine/wine notepad >/tmp/wine-notepad.log >[2=1] &
npid=$apid
for(i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30)
sleep 1
xbridge -s /usr/glenda/tmp/wine-notepad.ppm /debian/rootfs/tmp/.X11-unix/X61
echo '--- notepad log tail ---'
cat /tmp/wine-notepad.log
if(test -e /proc/$npid/ctl){
echo kill >/proc/$npid/ctl
echo wine-notepad-alive
}
if not
echo wine-notepad-exited
if(test -e /proc/$server/ctl)
echo kill >/proc/$server/ctl
echo taiji-wine-display-probe-done
+61
View File
@@ -0,0 +1,61 @@
#!/bin/rc
# Measure what happens when Wine runs through linuxrun: the Track 4
# prototype step. Any result here is progress: loader diagnostics,
# syscall gaps, or (eventually) a running notepad. Debian ships the
# loader as /usr/lib/wine/wine; /usr/bin/wine* are shell apploaders.
if(! test -x /debian/rootfs/usr/lib/wine/wine){
echo taiji-wine-missing
exit missing
}
cd /sys/src/cmd/linuxrun
if(! mk install){
echo taiji-wine-linuxrun-build-failed
exit failed
}
echo taiji-wine-linuxrun-rebuilt
if(! test -x /debian/rootfs/usr/lib/wine/wine){
echo taiji-wine-missing
exit missing
}
# Keep Wine's prefix and sockets in a private temporary tree.
rfork n
ramfs
bind -c /tmp /debian/rootfs/tmp
debian-session /taiji/bin/linuxrun -e 'WINEDEBUG=-all' -e 'HOME=/home/user' /usr/lib/wine/wine --version >/tmp/wine-version.log >[2=1] &
wpid=$apid
for(i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20){
if(test -s /tmp/wine-version.log)
break
if(! test -e /proc/$wpid)
break
sleep 1
}
sleep 2
echo '--- wine --version output ---'
cat /tmp/wine-version.log
if(test -e /proc/$wpid/ctl)
echo kill >/proc/$wpid/ctl
sleep 1
# The heavier test: start the builtin notepad. Without a display it will
# stop at the X connection; everything before that line is measurement.
debian-session /taiji/bin/linuxrun -e 'WINEDEBUG=-all' -e 'HOME=/home/user' -e 'DISPLAY=:61' /usr/lib/wine/wine notepad >/tmp/wineboot.log >[2=1] &
bpid=$apid
for(i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30){
if(test -s /tmp/wineboot.log)
break
if(! test -e /proc/$bpid)
break
sleep 1
}
sleep 5
echo '--- wine notepad output (first 60 lines) ---'
sed -n '1,60p' /tmp/wineboot.log
echo '--- notepad alive? ---'
if(test -e /proc/$bpid/ctl){
echo kill >/proc/$bpid/ctl
echo wine-still-running
}
if not
echo wine-exited
echo taiji-wine-probe-done
+10
View File
@@ -0,0 +1,10 @@
#!/bin/rc
mkdir -p /debian/rootfs/tmp/.X11-unix
rm -f /debian/rootfs/tmp/.X0-lock /debian/rootfs/tmp/.X11-unix/X0.req /debian/rootfs/tmp/.X11-unix/X0.q
debian-session -c 'linuxrun /usr/bin/Xvfb :0 -screen 0 1024x768x24' &
sleep 75
echo xvfb-up
debian-session -c 'linuxrun /usr/bin/xeyes -display :0 -geometry +400+300' &
sleep 120
echo diag-done
ps
+26
View File
@@ -0,0 +1,26 @@
#!/bin/rc
rm -f /debian/rootfs/tmp/shot1.xwd
mkdir -p /debian/rootfs/tmp/.X11-unix
rm -f /debian/rootfs/tmp/.X0-lock /debian/rootfs/tmp/.X11-unix/X0.req /debian/rootfs/tmp/.X11-unix/X0.q
debian-session -c 'linuxrun /usr/bin/Xvfb :0 -screen 0 1024x768x24' >[2] /tmp/xvfb.log &
sleep 75
echo xvfb-up
debian-session -c 'linuxrun /usr/bin/xeyes -display :0 -geometry +400+300' >[2] /tmp/xeyes.log &
sleep 240
echo xeyes-phase
#debian-session -c 'SHELL=/bin/sh linuxrun /usr/bin/xfwm4 --display :0' >[2] /tmp/xfwm4.log &
sleep 420
echo xfwm4-phase
#debian-session -c 'linuxrun /usr/bin/xwd -root -out /tmp/shot1.xwd' >[2] /tmp/xwd1.log &
sleep 600
echo shot1-phase
cp /debian/rootfs/tmp/shot1.xwd /debian/rootfs/shot1.xwd
echo shot-ls
ls -l /debian/rootfs/shot1.xwd
echo ps
ps
echo log-xwd1
cat /tmp/xwd1.log
echo log-xeyes
cat /tmp/xeyes.log
echo bisect-done
+40
View File
@@ -0,0 +1,40 @@
#!/bin/rc
rm -f /debian/rootfs/tmp/shot2.xwd
mkdir -p /debian/rootfs/tmp/.X11-unix
rm -f /debian/rootfs/tmp/.X0-lock /debian/rootfs/tmp/.X11-unix/X0.req /debian/rootfs/tmp/.X11-unix/X0.q
debian-session -c 'linuxrun /usr/bin/Xvfb :0 -screen 0 1024x768x24' >[2] /tmp/xvfb.log &
sleep 75
echo xvfb-up
debian-session -c 'linuxrun /usr/bin/xfdesktop --display :0' >[2] /tmp/xfdesktop.log &
sleep 480
echo xfdesktop-phase
debian-session -c 'linuxrun /usr/bin/xfce4-panel --display :0' >[2] /tmp/panel.log &
sleep 540
echo panel-phase
if(!test -e /debian/rootfs/tmp/shot2.xwd){
debian-session -c 'linuxrun /usr/bin/xwd -root -out /tmp/shot2.xwd' >[2] /tmp/xwd2.log &
sleep 600
}
echo shot-try1
if(!test -e /debian/rootfs/tmp/shot2.xwd){
debian-session -c 'linuxrun /usr/bin/xwd -root -out /tmp/shot2.xwd' >[2] /tmp/xwd2.log &
sleep 600
}
echo shot-try2
if(!test -e /debian/rootfs/tmp/shot2.xwd){
debian-session -c 'linuxrun /usr/bin/xwd -root -out /tmp/shot2.xwd' >[2] /tmp/xwd2.log &
sleep 600
}
echo shot-try3
cp /debian/rootfs/tmp/shot2.xwd /debian/rootfs/shot2.xwd
echo shot-ls
ls -l /debian/rootfs/shot2.xwd
echo ps
ps
echo log-xwd2
grep -av 'invalid opcode' /tmp/xwd2.log | head -20
echo log-desktop
grep -av 'invalid opcode' /tmp/xfdesktop.log | tail -6
echo log-panel
grep -av 'invalid opcode' /tmp/panel.log | tail -6
echo xfce-dp-done
+60
View File
@@ -0,0 +1,60 @@
#!/bin/rc
rm -f /debian/rootfs/shot.xwd /debian/rootfs/tmp/shot1.xwd /debian/rootfs/tmp/shot2.xwd
mkdir -p /debian/rootfs/tmp/.X11-unix
rm -f /debian/rootfs/tmp/.X0-lock /debian/rootfs/tmp/.X11-unix/X0.req /debian/rootfs/tmp/.X11-unix/X0.q
debian-session -c 'linuxrun /usr/bin/Xvfb :0 -screen 0 1024x768x24' >[2] /tmp/xvfb.log &
sleep 75
echo xvfb-up
debian-session -c 'SHELL=/bin/sh linuxrun /usr/bin/xterm -display :0 -geometry +120+120' >[2] /tmp/xterm.log &
sleep 300
echo xterm-phase
debian-session -c 'linuxrun /usr/bin/xeyes -display :0 -geometry +500+400' >[2] /tmp/xeyes.log &
sleep 240
echo xeyes-phase
debian-session -c 'linuxrun /usr/bin/xwd -root -out /tmp/shot1.xwd' >[2] /tmp/xwd1.log &
sleep 600
echo shot1-phase
debian-session -c 'linuxrun /usr/bin/xfwm4 --display :0' >[2] /tmp/xfwm4.log &
sleep 420
echo xfwm4-phase
debian-session -c 'linuxrun /usr/bin/xfdesktop --display :0' >[2] /tmp/xfdesktop.log &
sleep 420
echo xfdesktop-phase
debian-session -c 'linuxrun /usr/bin/xfce4-panel --display :0' >[2] /tmp/panel.log &
sleep 480
echo panel-phase
if(!test -e /debian/rootfs/tmp/shot2.xwd){
debian-session -c 'linuxrun /usr/bin/xwd -root -out /tmp/shot2.xwd' >[2] /tmp/xwd2.log &
sleep 600
}
echo shot2-try1
if(!test -e /debian/rootfs/tmp/shot2.xwd){
debian-session -c 'linuxrun /usr/bin/xwd -root -out /tmp/shot2.xwd' >[2] /tmp/xwd2.log &
sleep 600
}
echo shot2-try2
if(!test -e /debian/rootfs/tmp/shot2.xwd){
debian-session -c 'linuxrun /usr/bin/xwd -root -out /tmp/shot2.xwd' >[2] /tmp/xwd2.log &
sleep 600
}
echo shot2-try3
echo shot2-phase
cp /debian/rootfs/tmp/shot1.xwd /debian/rootfs/shot1.xwd
cp /debian/rootfs/tmp/shot2.xwd /debian/rootfs/shot2.xwd
echo shot-ls
ls -l /debian/rootfs/shot1.xwd /debian/rootfs/shot2.xwd
echo ps
ps
echo log-xwd1
cat /tmp/xwd1.log
echo log-xwd2
cat /tmp/xwd2.log
echo log-xterm
sed -n '1,80p' /tmp/xterm.log
echo log-xfwm4
sed -n '1,80p' /tmp/xfwm4.log
echo log-xfdesktop
sed -n '1,80p' /tmp/xfdesktop.log
echo log-panel
sed -n '1,80p' /tmp/panel.log
echo xfce-full-done
+21
View File
@@ -0,0 +1,21 @@
#!/bin/rc
rm -f /debian/rootfs/tmp/shot1.xwd
mkdir -p /debian/rootfs/tmp/.X11-unix
rm -f /debian/rootfs/tmp/.X0-lock /debian/rootfs/tmp/.X11-unix/X0.req /debian/rootfs/tmp/.X11-unix/X0.q
debian-session -c 'linuxrun /usr/bin/Xvfb :0 -screen 0 1024x768x24' >[2] /tmp/xvfb.log &
sleep 75
echo xvfb-up
debian-session -c 'SHELL=/bin/sh linuxrun /usr/bin/xfwm4 --display :0' >[2] /tmp/xfwm4.log &
sleep 480
echo xfwm4-phase
debian-session -c 'linuxrun /usr/bin/xwd -root -out /tmp/shot1.xwd' >[2] /tmp/xwd1.log &
sleep 600
echo shot1-phase
cp /debian/rootfs/tmp/shot1.xwd /debian/rootfs/shot1.xwd
echo shot-ls
ls -l /debian/rootfs/shot1.xwd
echo ps
ps
echo log-xwd1
cat /tmp/xwd1.log
echo min-done
+26
View File
@@ -0,0 +1,26 @@
#!/bin/rc
rm -f /debian/rootfs/tmp/n-shot1.xwd /debian/rootfs/tmp/n-shot2.xwd
rm -f /debian/rootfs/tmp/n-xfwm4.log /debian/rootfs/tmp/n-xvfb.log /debian/rootfs/tmp/n-xeyes.log
mkdir -p /debian/rootfs/tmp/.X11-unix
rm -f /debian/rootfs/tmp/.X0-lock /debian/rootfs/tmp/.X11-unix/X0.req /debian/rootfs/tmp/.X11-unix/X0.q
debian-session -c 'linuxrun /usr/bin/Xvfb :0 -screen 0 1024x768x24' >[2] /debian/rootfs/tmp/n-xvfb.log &
sleep 75
echo xvfb-up
debian-session -c 'linuxrun /usr/bin/xeyes -display :0 -geometry +400+300' >[2=1] /debian/rootfs/tmp/n-xeyes.log &
sleep 300
echo xeyes-phase
debian-session -c 'linuxrun /usr/bin/xfwm4 --display :0' >[2=1] /debian/rootfs/tmp/n-xfwm4.log &
sleep 240
echo xfwm4-phase
debian-session -c 'linuxrun /usr/bin/xwd -root -out /tmp/shot1.xwd' >[2] /debian/rootfs/tmp/n-xwd1.log &
sleep 300
echo shot-try1
ls -l /debian/rootfs/tmp/n-shot1.xwd
cp /debian/rootfs/tmp/n-shot1.xwd /debian/rootfs/shot1.xwd
echo xfwm4-log
sed -n '1,220p' /debian/rootfs/tmp/n-xfwm4.log
echo xvfb-log
cat /debian/rootfs/tmp/n-xvfb.log
echo ps
ps
echo xfce-shot-done
+20
View File
@@ -0,0 +1,20 @@
#!/bin/rc
# WM BEFORE clients: launch xfwm4 first, then map xeyes fresh so the WM
# sees a live MapRequest — testing event-driven adoption end to end.
mkdir -p /debian/rootfs/tmp/.X11-unix
rm -f /debian/rootfs/tmp/.X0-lock /debian/rootfs/tmp/.X11-unix/X0.req /debian/rootfs/tmp/.X11-unix/X0.q
debian-session -c 'linuxrun /usr/bin/Xvfb :0 -screen 0 1024x768x24' >[2] /debian/rootfs/tmp/n10-xvfb.log &
sleep 75
echo xvfb-up
debian-session -c 'linuxrun /usr/bin/xfwm4 --display :0' >[2=1] /debian/rootfs/tmp/n10-xfwm4.log &
sleep 240
echo wm-up
debian-session -c 'linuxrun /usr/bin/xeyes -display :0 -geometry +400+300' >[2=1] /debian/rootfs/tmp/n10-xeyes.log &
sleep 300
echo xeyes-phase
debian-session -c 'linuxrun /usr/bin/xwd -root -out /tmp/shot10.xwd' >[2] /debian/rootfs/tmp/n10-xwd.log &
sleep 900
echo shot-try1
ls -l /debian/rootfs/tmp/shot10.xwd
cp /debian/rootfs/tmp/shot10.xwd /debian/rootfs/shot1.xwd
echo xfce-shot-done
+23
View File
@@ -0,0 +1,23 @@
#!/bin/rc
# Rebuild linuxrun in-VM (XWR full-write probe), then WM-first run:
# Xvfb -> xfwm4 -> xeyes fresh -> xwd capture.
rc /cfg/q9/build-all.rc
echo build-phase-done
sleep 30
mkdir -p /debian/rootfs/tmp/.X11-unix
rm -f /debian/rootfs/tmp/.X0-lock /debian/rootfs/tmp/.X11-unix/X0.req /debian/rootfs/tmp/.X11-unix/X0.q
debian-session -c 'linuxrun /usr/bin/Xvfb :0 -screen 0 1024x768x24' >[2] /debian/rootfs/tmp/n12-xvfb.log &
sleep 75
echo xvfb-up
debian-session -c 'linuxrun /usr/bin/xfwm4 --display :0' >[2=1] /debian/rootfs/tmp/n12-xfwm4.log &
sleep 240
echo wm-up
debian-session -c 'linuxrun /usr/bin/xeyes -display :0 -geometry +400+300' >[2=1] /debian/rootfs/tmp/n12-xeyes.log &
sleep 300
echo xeyes-phase
debian-session -c 'linuxrun /usr/bin/xwd -root -out /tmp/shot12.xwd' >[2] /debian/rootfs/tmp/n12-xwd.log &
sleep 900
echo shot-try1
ls -l /debian/rootfs/tmp/shot12.xwd
cp /debian/rootfs/tmp/shot12.xwd /debian/rootfs/shot1.xwd
echo xfce-shot-done
+24
View File
@@ -0,0 +1,24 @@
#!/bin/rc
# dbus FIRST (ufs is healthiest at boot; its config read hung when
# launched later), then the X stack. Conf was written host-side.
rm -f /debian/rootfs/tmp/dbus-1 /debian/rootfs/tmp/dbus-1.req
debian-session -c 'linuxrun /usr/bin/dbus-daemon --config-file /usr/share/dbus-1/dbus-run.conf --nofork --nopidfile' &
sleep 20
echo dbus-phase
mkdir -p /debian/rootfs/tmp/.X11-unix
rm -f /debian/rootfs/tmp/.X0-lock /debian/rootfs/tmp/.X11-unix/X0.req /debian/rootfs/tmp/.X11-unix/X0.q
debian-session -c 'linuxrun /usr/bin/Xvfb :0 -screen 0 1024x768x24' &
sleep 75
echo xvfb-up
debian-session -c 'linuxrun /usr/bin/xeyes -display :0 -geometry +400+300' &
sleep 300
echo xeyes-phase
debian-session -c 'env DBUS_SESSION_BUS_ADDRESS=unix:path=/tmp/dbus-1 linuxrun /usr/bin/xfwm4 --display :0' &
sleep 240
echo xfwm4-phase
debian-session -c 'linuxrun /usr/bin/xwd -root -out /tmp/shot9.xwd' &
sleep 900
echo shot-try1
ls -l /debian/rootfs/tmp/shot9.xwd
cp /debian/rootfs/tmp/shot9.xwd /debian/rootfs/shot1.xwd
echo xfce-shot-done
+24
View File
@@ -0,0 +1,24 @@
#!/bin/rc
# dbus FIRST (ufs is healthiest at boot; its config read hung when
# launched later), then the X stack. Conf was written host-side.
rm -f /debian/rootfs/tmp/dbus-1 /debian/rootfs/tmp/dbus-1.req
debian-session -c 'linuxrun /usr/bin/dbus-daemon --config-file /usr/share/dbus-1/dbus-run.conf --nofork --nopidfile' &
sleep 20
echo dbus-phase
mkdir -p /debian/rootfs/tmp/.X11-unix
rm -f /debian/rootfs/tmp/.X0-lock /debian/rootfs/tmp/.X11-unix/X0.req /debian/rootfs/tmp/.X11-unix/X0.q
debian-session -c 'linuxrun /usr/bin/Xvfb :0 -screen 0 1024x768x24' &
sleep 75
echo xvfb-up
debian-session -c 'linuxrun /usr/bin/xeyes -display :0 -geometry +400+300' &
sleep 60
echo xeyes-phase
debian-session -c 'linuxrun /usr/bin/xfwm4 --display :0' &
sleep 1800
echo xfwm4-phase
debian-session -c 'linuxrun /usr/bin/xwd -root -out /tmp/shot9.xwd' &
sleep 900
echo shot-try1
ls -l /debian/rootfs/tmp/shot9.xwd
cp /debian/rootfs/tmp/shot9.xwd /debian/rootfs/shot1.xwd
echo xfce-shot-done
+28
View File
@@ -0,0 +1,28 @@
#!/bin/rc
# Rebuild linuxrun in-VM (sysconnect diagnostics + 64KB /srv scans), then
# dbus-first + Xvfb + xeyes + xfwm4 (30 min) + xwd capture.
rc /cfg/q9/build-all.rc
echo build-phase-done
sleep 30
rm -f /debian/rootfs/tmp/dbus-1 /debian/rootfs/tmp/dbus-1.req
rm -f /debian/rootfs/tmp/*.t.* /debian/rootfs/tmp/dbus-1.t.*
debian-session -c 'linuxrun /usr/bin/dbus-daemon --config-file /usr/share/dbus-1/dbus-run.conf --nofork --nopidfile' &
sleep 20
echo dbus-phase
mkdir -p /debian/rootfs/tmp/.X11-unix
rm -f /debian/rootfs/tmp/.X0-lock /debian/rootfs/tmp/.X11-unix/X0.req /debian/rootfs/tmp/.X11-unix/X0.q
debian-session -c 'linuxrun /usr/bin/Xvfb :0 -screen 0 1024x768x24' &
sleep 75
echo xvfb-up
debian-session -c 'linuxrun /usr/bin/xeyes -display :0 -geometry +400+300' &
sleep 60
echo xeyes-phase
debian-session -c 'linuxrun /usr/bin/xfwm4 --display :0' &
sleep 1800
echo xfwm4-phase
debian-session -c 'linuxrun /usr/bin/xwd -root -out /tmp/shot15.xwd' &
sleep 900
echo shot-try1
ls -l /debian/rootfs/tmp/shot15.xwd
cp /debian/rootfs/tmp/shot15.xwd /debian/rootfs/shot1.xwd
echo xfce-shot-done
+28
View File
@@ -0,0 +1,28 @@
#!/bin/rc
# Rebuild linuxrun in-VM (sysconnect diagnostics + 64KB /srv scans), then
# dbus-first + Xvfb + xeyes + xfwm4 (30 min) + xwd capture.
rc /cfg/q9/build-all.rc
echo build-phase-done
sleep 30
rm -f /debian/rootfs/tmp/dbus-1 /debian/rootfs/tmp/dbus-1.req
rm -f /debian/rootfs/tmp/*.t.* /debian/rootfs/tmp/dbus-1.t.*
debian-session -c 'linuxrun /usr/bin/dbus-daemon --config-file /usr/share/dbus-1/dbus-run.conf --nofork --nopidfile' &
sleep 20
echo dbus-phase
mkdir -p /debian/rootfs/tmp/.X11-unix
rm -f /debian/rootfs/tmp/.X0-lock /debian/rootfs/tmp/.X11-unix/X0.req /debian/rootfs/tmp/.X11-unix/X0.q
debian-session -c 'linuxrun /usr/bin/Xvfb :0 -screen 0 1024x768x24 -extension GLX' &
sleep 75
echo xvfb-up
debian-session -c 'linuxrun /usr/bin/xeyes -display :0 -geometry +400+300' &
sleep 60
echo xeyes-phase
debian-session -c 'linuxrun /usr/bin/xfwm4 --display :0' &
sleep 1800
echo xfwm4-phase
debian-session -c 'linuxrun /usr/bin/xwd -root -out /tmp/shot16.xwd' &
sleep 900
echo shot-try1
ls -l /debian/rootfs/tmp/shot16.xwd
cp /debian/rootfs/tmp/shot16.xwd /debian/rootfs/shot1.xwd
echo xfce-shot-done
+25
View File
@@ -0,0 +1,25 @@
#!/bin/rc
# Long WM window with periodic screenshots: xfwm4 needs a long stretch
# of emulated file I/O to finish theme/font loading after claiming WM_S0.
rm -f /debian/rootfs/tmp/dbus-1 /debian/rootfs/tmp/dbus-1.req
rm -f /debian/rootfs/tmp/*.t.*
debian-session -c 'linuxrun /usr/bin/dbus-daemon --config-file /usr/share/dbus-1/dbus-run.conf --nofork --nopidfile' &
sleep 20
echo dbus-phase
mkdir -p /debian/rootfs/tmp/.X11-unix
rm -f /debian/rootfs/tmp/.X0-lock /debian/rootfs/tmp/.X11-unix/X0.req /debian/rootfs/tmp/.X11-unix/X0.q
debian-session -c 'linuxrun /usr/bin/Xvfb :0 -screen 0 1024x768x24 -extension GLX' &
sleep 75
echo xvfb-up
debian-session -c 'linuxrun /usr/bin/xeyes -display :0 -geometry +400+300' &
sleep 60
echo xeyes-phase
debian-session -c 'linuxrun /usr/bin/xfwm4 --display :0' &
for(i in 1 2 3 4 5 6 7 8){
sleep 600
echo shot-cycle-$i
debian-session -c 'linuxrun /usr/bin/xwd -root -out /tmp/shot17.'^$i^'.xwd' &
sleep 240
echo cycle-$i-done
}
echo xfce-shot-done
+28
View File
@@ -0,0 +1,28 @@
#!/bin/rc
# Warm fontconfig caches once (persistent in the rootfs), then the
# long-window xfwm4 run with periodic screenshots.
debian-session -c 'linuxrun /usr/bin/fc-cache -f' &
sleep 2400
echo fccache-phase-done
rm -f /debian/rootfs/tmp/dbus-1 /debian/rootfs/tmp/dbus-1.req
rm -f /debian/rootfs/tmp/*.t.*
debian-session -c 'linuxrun /usr/bin/dbus-daemon --config-file /usr/share/dbus-1/dbus-run.conf --nofork --nopidfile' &
sleep 20
echo dbus-phase
mkdir -p /debian/rootfs/tmp/.X11-unix
rm -f /debian/rootfs/tmp/.X0-lock /debian/rootfs/tmp/.X11-unix/X0.req /debian/rootfs/tmp/.X11-unix/X0.q
debian-session -c 'linuxrun /usr/bin/Xvfb :0 -screen 0 1024x768x24 -extension GLX' &
sleep 75
echo xvfb-up
debian-session -c 'linuxrun /usr/bin/xeyes -display :0 -geometry +400+300' &
sleep 60
echo xeyes-phase
debian-session -c 'linuxrun /usr/bin/xfwm4 --display :0' &
for(i in 1 2 3 4 5 6 7 8 9 a b){
sleep 1200
echo shot-cycle-$i
debian-session -c 'linuxrun /usr/bin/xwd -root -out /tmp/shot18.'^$i^'.xwd' &
sleep 300
echo cycle-$i-done
}
echo xfce-shot-done
+37
View File
@@ -0,0 +1,37 @@
#!/bin/rc
# Warm fontconfig caches once (persistent in the rootfs), then the
# long-window xfwm4 run with periodic screenshots.
rc /cfg/q9/build-all.rc
echo build-phase-done
sleep 20
rm -f /debian/rootfs/tmp/dbus-1 /debian/rootfs/tmp/dbus-1.req
rm -f /debian/rootfs/tmp/*.t.*
debian-session -c 'linuxrun /usr/bin/dbus-daemon --config-file /usr/share/dbus-1/dbus-run.conf --nofork --nopidfile' &
sleep 20
echo dbus-phase
mkdir -p /debian/rootfs/tmp/.X11-unix
rm -f /debian/rootfs/tmp/.X0-lock /debian/rootfs/tmp/.X11-unix/X0.req /debian/rootfs/tmp/.X11-unix/X0.q
debian-session -c 'linuxrun /usr/bin/Xvfb :0 -screen 0 1024x768x24 -extension GLX' &
sleep 75
echo xvfb-up
debian-session -c 'linuxrun /usr/bin/xeyes -display :0 -geometry +400+300' &
sleep 60
echo xeyes-phase
debian-session -c 'linuxrun /usr/bin/xfwm4 --display :0' &
watchdog=1
fn wdog {
while($watchdog){
sleep 180
echo ===WATCHDOG===
ps
}
}
wdog &
for(i in 1 2 3 4 5 6 7 8 9 a b){
sleep 1200
echo shot-cycle-$i
debian-session -c 'linuxrun /usr/bin/xwd -root -out /tmp/shot19.'^$i^'.xwd' &
sleep 300
echo cycle-$i-done
}
echo xfce-shot-done
+26
View File
@@ -0,0 +1,26 @@
#!/bin/rc
rm -f /debian/rootfs/tmp/n-shot1.xwd
mkdir -p /debian/rootfs/tmp/.X11-unix
rm -f /debian/rootfs/tmp/.X0-lock /debian/rootfs/tmp/.X11-unix/X0.req /debian/rootfs/tmp/.X11-unix/X0.q
echo defaults-check
debian-session -c 'linuxrun /bin/cat /usr/share/xfwm4/defaults' >[2=1] /debian/rootfs/tmp/n-defaults.txt &
sleep 15
debian-session -c 'linuxrun /usr/bin/Xvfb :0 -screen 0 1024x768x24' >[2] /debian/rootfs/tmp/n2-xvfb.log &
sleep 75
echo xvfb-up
debian-session -c 'linuxrun /usr/bin/xeyes -display :0 -geometry +400+300' >[2=1] /debian/rootfs/tmp/n2-xeyes.log &
sleep 300
echo xeyes-phase
debian-session -c 'linuxrun /usr/bin/xfwm4 --display :0' >[2=1] /debian/rootfs/tmp/n2-xfwm4.log &
sleep 240
echo xfwm4-phase
debian-session -c 'linuxrun /usr/bin/xwd -root -out /tmp/n-shot1.xwd' >[2] /debian/rootfs/tmp/n2-xwd.log &
sleep 300
echo shot-try1
ls -l /debian/rootfs/tmp/n-shot1.xwd
cp /debian/rootfs/tmp/n-shot1.xwd /debian/rootfs/shot1.xwd
echo xfwm4-log
sed -n '1,120p' /debian/rootfs/tmp/n2-xfwm4.log
echo defaults-dump
cat /debian/rootfs/tmp/n-defaults.txt
echo xfce-shot-done
+45
View File
@@ -0,0 +1,45 @@
#!/bin/rc
# xfwm4 full run: rebuild linuxrun, dbus-first, GLX-off Xvfb, xeyes,
# xfwm4 with a long window and static screenshot cycles (the rc
# for-loop concatenation proved unreliable - keep it flat).
rc /cfg/q9/build-all.rc
echo build-phase-done
sleep 20
rm -f /debian/rootfs/tmp/dbus-1 /debian/rootfs/tmp/dbus-1.req
rm -f /debian/rootfs/tmp/*.t.*
debian-session -c 'linuxrun /usr/bin/dbus-daemon --config-file /usr/share/dbus-1/dbus-run.conf --nofork --nopidfile' &
sleep 20
echo dbus-phase
debian-session -c 'linuxrun /usr/lib/i386-linux-gnu/xfce4/xfconf/xfconfd' &
sleep 90
echo xfconfd-phase
mkdir -p /debian/rootfs/tmp/.X11-unix
rm -f /debian/rootfs/tmp/.X0-lock /debian/rootfs/tmp/.X11-unix/X0.req /debian/rootfs/tmp/.X11-unix/X0.q
debian-session -c 'linuxrun /usr/bin/Xvfb :0 -screen 0 1024x768x24 -extension GLX' &
sleep 75
echo xvfb-up
debian-session -c 'linuxrun /usr/bin/xeyes -display :0 -geometry +400+300' &
sleep 60
echo xeyes-phase
debian-session -c 'linuxrun /usr/bin/xfwm4 --display :0' &
sleep 1200
echo shot-cycle-1
debian-session -c 'linuxrun /usr/bin/xwd -root -out /tmp/shot20.1.xwd' &
sleep 300
echo cycle-1-done
sleep 900
echo shot-cycle-2
debian-session -c 'linuxrun /usr/bin/xwd -root -out /tmp/shot20.2.xwd' &
sleep 300
echo cycle-2-done
sleep 900
echo shot-cycle-3
debian-session -c 'linuxrun /usr/bin/xwd -root -out /tmp/shot20.3.xwd' &
sleep 300
echo cycle-3-done
sleep 900
echo shot-cycle-4
debian-session -c 'linuxrun /usr/bin/xwd -root -out /tmp/shot20.4.xwd' &
sleep 300
echo cycle-4-done
echo xfce-shot-done
+64
View File
@@ -0,0 +1,64 @@
#!/bin/rc
# Long-haul: xfwm4 with xfconf working needs many slow dbus roundtrips
# for its property load - give it hours, screenshot every 20 minutes.
rc /cfg/q9/build-all.rc
echo build-phase-done
sleep 20
rm -f /debian/rootfs/tmp/dbus-1 /debian/rootfs/tmp/dbus-1.req
rm -f /debian/rootfs/tmp/*.t.*
debian-session -c 'linuxrun /usr/bin/dbus-daemon --config-file /usr/share/dbus-1/dbus-run.conf --nofork --nopidfile' &
sleep 20
echo dbus-phase
debian-session -c 'linuxrun /usr/lib/i386-linux-gnu/xfce4/xfconf/xfconfd' &
sleep 90
echo xfconfd-phase
mkdir -p /debian/rootfs/tmp/.X11-unix
rm -f /debian/rootfs/tmp/.X0-lock /debian/rootfs/tmp/.X11-unix/X0.req /debian/rootfs/tmp/.X11-unix/X0.q
debian-session -c 'linuxrun /usr/bin/Xvfb :0 -screen 0 1024x768x24 -extension GLX' &
sleep 75
echo xvfb-up
debian-session -c 'linuxrun /usr/bin/xeyes -display :0 -geometry +400+300' &
sleep 60
echo xeyes-phase
debian-session -c 'linuxrun /usr/bin/xfwm4 --display :0' &
sleep 1200
echo shot-cycle-1
debian-session -c 'linuxrun /usr/bin/xwd -root -out /tmp/shot21.1.xwd' &
sleep 300
echo cycle-1-done
sleep 900
echo shot-cycle-2
debian-session -c 'linuxrun /usr/bin/xwd -root -out /tmp/shot21.2.xwd' &
sleep 300
echo cycle-2-done
sleep 900
echo shot-cycle-3
debian-session -c 'linuxrun /usr/bin/xwd -root -out /tmp/shot21.3.xwd' &
sleep 300
echo cycle-3-done
sleep 900
echo shot-cycle-4
debian-session -c 'linuxrun /usr/bin/xwd -root -out /tmp/shot21.4.xwd' &
sleep 300
echo cycle-4-done
sleep 900
echo shot-cycle-5
debian-session -c 'linuxrun /usr/bin/xwd -root -out /tmp/shot21.5.xwd' &
sleep 300
echo cycle-5-done
sleep 900
echo shot-cycle-6
debian-session -c 'linuxrun /usr/bin/xwd -root -out /tmp/shot21.6.xwd' &
sleep 300
echo cycle-6-done
sleep 900
echo shot-cycle-7
debian-session -c 'linuxrun /usr/bin/xwd -root -out /tmp/shot21.7.xwd' &
sleep 300
echo cycle-7-done
sleep 900
echo shot-cycle-8
debian-session -c 'linuxrun /usr/bin/xwd -root -out /tmp/shot21.8.xwd' &
sleep 300
echo cycle-8-done
echo xfce-shot-done
+28
View File
@@ -0,0 +1,28 @@
#!/bin/rc
# xfce screenshot run: Xvfb + xeyes + xfwm4 (GDK_GL=disable comes from
# linuxrun's genv). Logs go to guest RAM and are dumped to the serial
# console at the end - the ufs share is unreliable under sustained
# logging. The shot is copied through ufs once, at the very end.
mkdir -p /debian/rootfs/tmp/.X11-unix
rm -f /debian/rootfs/tmp/.X0-lock /debian/rootfs/tmp/.X11-unix/X0.req /debian/rootfs/tmp/.X11-unix/X0.q
debian-session -c 'linuxrun /usr/bin/Xvfb :0 -screen 0 1024x768x24' >[2] /tmp/n3-xvfb.log &
sleep 75
echo xvfb-up
debian-session -c 'linuxrun /usr/bin/xeyes -display :0 -geometry +400+300' >[2=1] /tmp/n3-xeyes.log &
sleep 300
echo xeyes-phase
debian-session -c 'linuxrun /usr/bin/xfwm4 --display :0' >[2=1] /tmp/n3-xfwm4.log &
sleep 240
echo xfwm4-phase
debian-session -c 'linuxrun /usr/bin/xwd -root -out /tmp/shot3.xwd' >[2=1] /tmp/n3-xwd.log &
sleep 300
echo shot-try1
ls -l /debian/rootfs/tmp/shot3.xwd
cp /debian/rootfs/tmp/shot3.xwd /debian/rootfs/shot1.xwd
echo xfwm4-log
sed -n '1,120p' /tmp/n3-xfwm4.log
echo xwd-log
sed -n '1,20p' /tmp/n3-xwd.log
echo ps
ps
echo xfce-shot-done
+20
View File
@@ -0,0 +1,20 @@
#!/bin/rc
# everything to the serial console: guest /tmp logs vanish mid-session
# and the ufs share is unreliable under load, but serial never lies.
mkdir -p /debian/rootfs/tmp/.X11-unix
rm -f /debian/rootfs/tmp/.X0-lock /debian/rootfs/tmp/.X11-unix/X0.req /debian/rootfs/tmp/.X11-unix/X0.q
debian-session -c 'linuxrun /usr/bin/Xvfb :0 -screen 0 1024x768x24' &
sleep 75
echo xvfb-up
debian-session -c 'linuxrun /usr/bin/xeyes -display :0 -geometry +400+300' &
sleep 300
echo xeyes-phase
debian-session -c 'linuxrun /usr/bin/xfwm4 --display :0' &
sleep 240
echo xfwm4-phase
debian-session -c 'linuxrun /usr/bin/xwd -root -out /tmp/shot4.xwd' &
sleep 300
echo shot-try1
ls -l /debian/rootfs/tmp/shot4.xwd
cp /debian/rootfs/tmp/shot4.xwd /debian/rootfs/shot1.xwd
echo xfce-shot-done
+35
View File
@@ -0,0 +1,35 @@
#!/bin/rc
mkdir -p /debian/rootfs/tmp/.X11-unix
rm -f /debian/rootfs/tmp/.X0-lock /debian/rootfs/tmp/.X11-unix/X0.req /debian/rootfs/tmp/.X11-unix/X0.q
debian-session -c 'linuxrun /usr/bin/Xvfb :0 -screen 0 1024x768x24' &
sleep 75
echo xvfb-up
debian-session -c 'linuxrun /usr/bin/xeyes -display :0 -geometry +400+300' &
sleep 300
echo xeyes-phase
debian-session -c 'linuxrun /usr/bin/xfwm4 --display :0' &
sleep 240
echo xfwm4-phase
debian-session -c 'linuxrun /usr/bin/xwd -root -out /tmp/shot5.xwd' &
sleep 240
echo wedges
ps
for(f in /proc/[0-9]*/args) { }
echo procsys
for(d in /proc/[0-9]*) {
if(test -f $d^/args) {
echo == $d
cat $d^/args
if(test -f $d^/syscall) {
echo syscall:
cat $d^/syscall
}
}
}
echo second-shot
debian-session -c 'linuxrun /usr/bin/xwd -root -out /tmp/shot5.xwd' &
sleep 300
echo shot-try
ls -l /debian/rootfs/tmp/shot5.xwd
cp /debian/rootfs/tmp/shot5.xwd /debian/rootfs/shot1.xwd
echo xfce-shot-done
+23
View File
@@ -0,0 +1,23 @@
#!/bin/rc
# full stack: Xvfb + session dbus + xeyes + xfwm4, then capture.
mkdir -p /debian/rootfs/tmp/.X11-unix
rm -f /debian/rootfs/tmp/.X0-lock /debian/rootfs/tmp/.X11-unix/X0.req /debian/rootfs/tmp/.X11-unix/X0.q
rm -f /debian/rootfs/tmp/dbus-1
debian-session -c 'linuxrun /usr/bin/Xvfb :0 -screen 0 1024x768x24' &
sleep 75
echo xvfb-up
debian-session -c 'linuxrun /usr/bin/dbus-daemon --session --address=unix:path=/tmp/dbus-1 --nofork --nopidfile' &
sleep 30
echo dbus-up
debian-session -c 'linuxrun /usr/bin/xeyes -display :0 -geometry +400+300' &
sleep 300
echo xeyes-phase
debian-session -c 'linuxrun /usr/bin/xfwm4 --display :0' &
sleep 240
echo xfwm4-phase
debian-session -c 'linuxrun /usr/bin/xwd -root -out /tmp/shot6.xwd' &
sleep 300
echo shot-try1
ls -l /debian/rootfs/tmp/shot6.xwd
cp /debian/rootfs/tmp/shot6.xwd /debian/rootfs/shot1.xwd
echo xfce-shot-done
Loaded 100 of 321 files, more files were not shown because too many files have changed in this diff. Show more