XL1200-EMU Symbolics XL1200 Emulator
Plans & Roadmap SpecsTODO docs/genera-pv.md

XL1200 VME Paravirtual Board (IVPV) & Genera 8.3 Integration Plan

Status: Future / Proposed Design Plan (Tier 1.5 Idle Yield → Tier 2 Full PV) — Not yet implemented. Built on the shared Merlin-II VMEbus & VIC068 bridge in docs/vme-bus-plan.md (coexisting cleanly with docs/color-graphics-plan.md). See docs/ROADMAP.md for overall sequencing and docs/emulator/README.md for the currently implemented C11 XL1200 emulator.

Staged Delivery & Scope Alignment:

  • Tier 1.5 (Early Standalone Milestone — Wave 1B): Implement the 1-register IVPV Idle Yield Device (PV_REG_IDLE_YIELD) immediately on top of vme_bus.c for ~0% idle host CPU before full mouse/RPC/HOST: work begins.
  • Tier 2 (Full IVPV): Seamless uncaptured mouse, bidirectional Solstice/UX-style RPC + External RPC Sidecar Proxy (Section 3.4b below, allowing external host programs to attach custom RPC modules or invoke guest RPCs), zero-copy HOST: filesystem, and clipboard.
  • Tier 3 (Lowest Priority — Decoupled Card IVFB): Linear VME Color Framebuffers (0x1400_0000, screen_id = 1..4) are decoupled into a separate optional VME card (IVFB) registered independently on vme_bus.c rather than bundled into IVPV.

Scope: C11 ivory-xl1200 (emu/) + Genera 8.3 SCT System (emulator-pv)


1. Executive Summary & Architectural Guardrails

This plan specifies a synthetic Merlin-II VMEbus A32/D32 Paravirtual Board ("IVPV") and its companion Genera 8.3 loadable system (emulator-pv) for the from-scratch Symbolics XL1200 emulator (emu/).

Instead of spoofing a UX1200/MacIvory embedded machine via sys:*emb-communication-area*—which would flip (system-case (Embedded ...)) across Genera and break standalone Merlin-II SCSI, console, and Ethernet assumptions—the machine remains a 100% authentic standalone XL1200 with an optional expansion card plugged into a free VME slot:

  1. Deterministic Guest Idle Yield (PV_REG_IDLE_YIELD): Immediate zero-overhead exit from ivory_cpu_run() (L_outer_reload in cpu.c) into pthread_cond_timedwait(&rt->wake_cv) bounded by merlin_us_until_next_timer_irq(), dropping host idle CPU usage to ~0% with sub-millisecond input/network wake latency.
  2. Multi-Head Seamless Uncaptured Host Mouse (PV_REG_MOUSE_XY / PV_REG_MOUSE_BTN): Zero-capture host cursor tracking across the onboard 1-bpp monochrome console (screen_id = 0) and up to 15 future VME color framebuffers (screen_id = 1..15) across multiple SDL3 windows, using a two-half Genera driver (wired interrupt fast path + :fg 32 screen-switch daemon).
  3. Bidirectional Solstice/UX-Style RPC Channel (PV-VME-TRANSPORT-AGENT) + Unified HOST: Filesystem: Reuses Genera 8.3's built-in RPC:STD-TRANSPORT-AGENT, RPC::LITTLE-ENDER-DATA (zero byte-swapping between Ivory and x86-64/ARM64), and Syntax: Lisp+C stub generator (DEFINE-REMOTE-MODULE). Provides zero-copy DMA HOST: file access (fs:file-access-path), host clipboard/time integration, and typed Host \(\to\) Guest RPC control.
  4. Multi-Head Linear VME Color Framebuffer Architecture (screen_id = 1..4): Flat VME A32 linear VRAM apertures (8-bpp pseudocolor CLUT and 32-bpp truecolor) + hardware cursor sprite registers, enabling up to 4 simultaneous color heads alongside the onboard monochrome console.

Non-Negotiable Invariants for All Swarm Agents

  1. libivory_core.so Purity & Hot-Reload ABI (Makefile, ivory_emu.h):
    • Files in CORE_SRCS (mem.c, merlin.c, cpu.c, core_api.c, etc.) MUST remain pure ISO C11 with zero OS/POSIX/pthreads/SDL3/socket/filesystem headers and zero mutable .data or .bss globals (verified via readelf -WS build/libivory_core.so).
    • All host OS operations (condvar sleep, SDL3 window coordinate mapping, host POSIX open/pread/pwrite/readdir, RPC worker threads) MUST live in SHELL_SRCS (main.c, sdl_console.c, debug_ctl.c, and new pv_rpc_host.c), communicating with libivory_core.so strictly through MerlinBoard state fields and host callback pointers (same pattern as eth_82586_set_callbacks and console_hw_set_serial_callbacks).
  2. Exact Page-Aligned Core Struct Sizes (ivory_emu.h:601-925):
    • sizeof(MerlinBoard) == 278528U (_reserved[1054] = 8,432 bytes available).
    • sizeof(IvoryMem) == 32768U (_reserved[937] available).
    • sizeof(IvoryCpu) == 4096U (_clk_pad[7] + _reserved[248] available).
    • Carve IvoryPvBoard pv directly out of MerlinBoard::_reserved and keep all three _Static_assert checks exact!
  3. 29-Bit Positive Fixnum Register Rule:
    • On Ivory, 32-bit integers with bit 31 (or bit 30 negative sign) allocate heap DTP-BIGNUMs if touched with Lisp arithmetic, which is illegal inside si:defwiredfun. All IVPV magic constants, status words, and packed coordinate fields read by wired Lisp MUST fit in unsigned 29-bit positive fixnums (0 .. #x1FFFFFFF).
  4. Anti-Cheating & Ground-Truth Verification (AGENTS.md § 6):
    • Never synthesize guest instruction streams, mock bootloaders, or fake string buffers for integration verification. Unit tests in emu/tests/ may test MMIO register state machines directly; integration verification MUST boot genuine ivory-fep-roms/fep330/rom.dump and authentic Genera 8.3 .ilod worlds.

2. VME Hardware & Register Specification (IvoryPvBoard)

2.1 Bus Addressing & Interrupt Plumbing

On Merlin-II (XL1200), genera-original/sys.sct/i-sys/vme-bus.lisp (lines 325–343, cli:make-bus-address) encodes direct VME master addresses as DTP-PHYSICAL-ADDRESS words:

  • Bits <31:30> = #b11 (0xC0000000 direct VME master window).
  • Bit <29> = 0 for VME A32 (1 for A24/A16).
  • Bit <28> = 0 for :shuffle :none (1 for :32-bit byte-swap).
  • Bits <27:0> = vme_byte_addr >> 2.

We assign IVPV to VME A32 base #x10000000 (with optional linear color VRAM apertures starting at VME A32 #x14000000):

RegionVME A32 Byte RangeDirect Ivory PMA (:shuffle :none)Purpose
IVPV Control MMIO0x1000_0000 .. 0x1000_03FF0xC400_0000 .. 0xC400_00FF (256 words)Control, Idle, Multi-Head Mouse, RPC, Color Head Descriptors
Color Head 0 VRAM0x1400_0000 .. 0x147F_FFFF0xC500_0000 .. 0xC51F_FFFF (2 MW = 8 MiB)Future Linear Color Framebuffer Head 1 (screen_id = 1)
Color Head 1 VRAM0x1480_0000 .. 0x14FF_FFFF0xC520_0000 .. 0xC53F_FFFF (2 MW = 8 MiB)Future Linear Color Framebuffer Head 2 (screen_id = 2)
Color Head 2 VRAM0x1500_0000 .. 0x157F_FFFF0xC540_0000 .. 0xC55F_FFFF (2 MW = 8 MiB)Future Linear Color Framebuffer Head 3 (screen_id = 3)
Color Head 3 VRAM0x1580_0000 .. 0x15FF_FFFF0xC560_0000 .. 0xC57F_FFFF (2 MW = 8 MiB)Future Linear Color Framebuffer Head 4 (screen_id = 4)

Routing Note: mem.c:119-134 (is_merlin_mmio_pma) already routes all pma >= 0x60000000U to merlin_io_read / merlin_io_write! No change to is_merlin_mmio_pma is needed for 0xC4000000 MMIO registers. (When Wave 4 adds Color VRAM, 0xC5000000..0xC57FFFFF can fast-path directly in mem.c like monochrome VRAM at 0x48000000.)

Dual Access Support (Direct Master + Polled VME) & VIC068 Interrupts

In merlin.c, implement pv_mmio_read(board, offset) and pv_mmio_write(board, offset, val) and wire them to both:

  1. Direct VME Master Window: pma in 0xC4000000U .. 0xC40000FFU (offset = pma - 0xC4000000U) and :shuffle :32-bit alias 0xD4000000U .. 0xD40000FFU (bswap32 on payload). Returns IVORY_CDR_NEXT + DTP_FIXNUM on reads.
  2. Polled VME Cycles (cli:bus-read / cli:bus-write, genera-original/sys.sct/i-sys/vme-bus.lisp lines 186–318):
    • #x88000140: Latch VME Address Modifier + IA bit (board->vme_am_reg).
    • #x88000080: VME Read/Write Data latch (board->vme_data_reg).
    • #x880000C0: VME Write Request (vme_byte_addr written; if IA == 1 and 0x10000000 .. 0x100003FC, call pv_mmio_write).
    • #x88000100: VME Read / IACK Request:
      • If (board->vme_am_reg & 1U) == 1U (normal VME read, IA=1) and vme_byte_addr in 0x10000000 .. 0x100003FC, latch pv_mmio_read into board->vme_data_reg.
      • If (board->vme_am_reg & 1U) == 0U (VME Interrupt Acknowledge cycle, IA=0, triggered by merlin-ii-high-priority-vme-interrupt at genera-original/sys.sct/i-sys/interrupts.lisp lines 1321–1339 writing IRQ level * 2 = 8 for IRQ4 to #x88000100), latch board->pv.irq_vector (default 0x60, never 0x5F which is reserved for Solstice slave trigger at interrupts.lisp:1332) into board->vme_data_reg.
  3. Interrupt Line:
    • pv_irq_pending = (board->pv.irq_status & board->pv.irq_mask) != 0 && (board->pv.ctrl & PV_CTRL_ENABLE) != 0.
    • Assert/deassert MERLIN_IRQ_MII_VME_HIGH (1U << 3) in board->irq_raw_status inside merlin_refresh_irq_cache() (when VIC068 high-priority VME IRQ4 is enabled or pv.ctrl & PV_CTRL_IRQ_ENABLE is set). Because MERLIN_IRQ_MII_VME_HIGH is already in MERLIN_HIGH_PRIO_IRQ_MASK, Ivory takes IVORY_TRAP_HIGH_PRIO_SEQ_BREAK, runs merlin-ii-high-priority-vme-interrupt, performs IACK, reads vector #x60, and calls the Lisp handler installed via (cli:install-bus-interrupt-handler ... #x60).

2.2 Complete IVPV Register Map (PMA = 0xC4000000 + word_offset)

All values read by wired Lisp fit in unsigned 29-bit positive fixnums (<= 0x1FFFFFFF).

Word OffsetConstant NameR/WReset ValueBit Layout & Semantics
0x00PV_REG_MAGICRO0x19565056Fixnum-safe magic (#x19565056, ASCII "VP" in low 16b). Unpatched emulator returns bus error or 0.
0x01PV_REG_VERSIONRO0x00010000Major <23:16> = 1, Minor <15:0> = 0.
0x02PV_REG_FEATURESROBitmask<0> IDLE, <1> ABS_MOUSE, <2> RPC, <3> HOST_DMA, <4> COLOR_FB, <5> HW_CURSOR.
0x03PV_REG_CTRLRW0x00000000<0> ENABLE, <1> ABS_MOUSE_EN (suppresses relative console mouse deltas in sdl_console.c), <2> IDLE_EN, <3> RPC_EN, <4> IRQ_EN. Writing 0 resets pending IRQs and restores legacy relative mouse.
0x04PV_REG_IRQ_STATUSRW1C0x00000000Pending IRQ bits (Write-1-to-Clear): <0> MOUSE_MOVE, <1> MOUSE_BTN, <2> RPC_RX (Host \(\to\) Guest queue/reply ready), <3> DISPLAY_CFG.
0x05PV_REG_IRQ_MASKRW0x00000000Mask corresponding to PV_REG_IRQ_STATUS bits <3:0>.
0x06PV_REG_IRQ_VECTORRW0x000000608-bit VME IACK vector (#x60 default; reject #x5F).
0x07PV_REG_HOST_MONO_LOROHost clockMonotonic host microseconds <27:0> (28-bit fixnum). Latches upper bits into 0x08.
0x08PV_REG_HOST_MONO_HIROHost clockLatched monotonic host microseconds <55:28> (28-bit fixnum).
0x08..0x0F(Reserved Core)—0—
0x10PV_REG_IDLE_YIELDWO0Guest writes max sleep hint in \(\mu\text{s}\) (1 .. 100000, e.g. 16000). Sets board->pv.idle_yield_us = val, exits ivory_cpu_run() slice immediately after current instruction.
0x11PV_REG_IDLE_COUNTRO0Diagnostic counter <28:0> of guest-initiated idle yields.
0x18PV_REG_MOUSE_XYRO0<11:0> X (0..4095), <23:12> Y (0..4095), <27:24> screen_id (0 = B&W console, 1..15 = Color Heads), <28> in_window (1 = inside SDL content rect).
0x19PV_REG_MOUSE_BTNRO0<2:0> buttons (bit0=Left, bit1=Middle, bit2=Right—matches Genera tv:mouse-buttons-buffer), <10:3> signed 8-bit wheel delta (+128 biased), <27:16> 12-bit monotonic event seq.
0x20PV_REG_RPC_CHAN_PMARW0Physical Memory Address (27-bit wired RAM PMA) of guest-allocated PV-RPC-CHANNEL-HEADER struct.
0x21PV_REG_RPC_DOORBELLWO0Guest writes <0>=1 (GUEST_TO_HOST_TX) or <1>=1 (HOST_TO_GUEST_ACK). Invokes board->pv.on_rpc_doorbell(ctx, val) to wake host RPC worker immediately.
0x22PV_REG_RPC_STATUSRO0<0> HOST_AGENT_READY, <1> CHANNEL_VALID, <15:8> active RPC protocol version (1).
0x30PV_REG_HEAD_COUNTRO1Total configured heads (1 = B&W only; 2..5 = B&W + 1..4 VME Color Heads).
0x31PV_REG_HEAD_SELECTRW0Selects Color Head index (1..4) for banked registers 0x32..0x39.
0x32PV_REG_HEAD_MODERW0<0> ENABLE, <3:1> pixel format (0=off, 1=8bpp CLUT, 2=32bpp BGRX8888), <15:4> width (1152/1280/1600), <27:16> height (900/1024/1200).
0x33PV_REG_HEAD_STRIDERO0Row stride in 32-bit Ivory words (width / 4 for 8-bpp, width for 32-bpp).
0x34PV_REG_HEAD_VRAM_PMARO0Direct Ivory PMA base of selected head's linear VRAM (0xC5000000 + (head-1)*0x00200000).
0x35PV_REG_HEAD_CLUT_IDXRW08-bit CLUT write index (0..255, auto-increments on write to 0x36).
0x36PV_REG_HEAD_CLUT_RGBRW024-bit #x00RRGGBB palette entry (24-bit positive fixnum).
0x37PV_REG_HEAD_CUR_CTLRW0Hardware cursor sprite: <0> VISIBLE, <12:1> X, <24:13> Y, <28:25> hotspot X/Y latch.
0x38PV_REG_HEAD_CUR_PMARW0Wired RAM PMA of 32x32 cursor bitmap/mask (or ARGB32 sprite) for zero-flicker color cursor.

3. Detailed Subsystem Designs

3.1 Core C11 Data Structures (ivory_hw.h, ivory_emu.h)

Add constants in emu/include/ivory_hw.h and IvoryPvBoard inside MerlinBoard in emu/include/ivory_emu.h by reducing MerlinBoard::_reserved[1054] by the exact multiple of uint64_t words (sizeof(IvoryPvBoard) / 8):

#define IVORY_PV_MMIO_BASE_PMA       UINT32_C(0xC4000000)
#define IVORY_PV_MMIO_SWAP_BASE_PMA  UINT32_C(0xD4000000)
#define IVORY_PV_MMIO_WORDS          256U
#define IVORY_PV_VME_A32_BYTE_BASE   UINT32_C(0x10000000)
#define IVORY_PV_VME_A32_BYTE_SIZE   UINT32_C(0x00000400)

#define IVORY_PV_MAGIC               UINT32_C(0x19565056)
#define IVORY_PV_VERSION             UINT32_C(0x00010000)
#define IVORY_PV_DEFAULT_VECTOR      UINT32_C(0x00000060)

typedef void (*IvoryPvDoorbellFn)(void *ctx, uint32_t doorbell_bits);
typedef void (*IvoryPvCtrlChangeFn)(void *ctx, uint32_t new_ctrl);

typedef struct IvoryPvBoard {
    uint32_t            ctrl;
    uint32_t            features;
    uint32_t            irq_status;
    uint32_t            irq_mask;
    uint32_t            irq_vector;
    uint32_t            idle_yield_us;      /* Non-zero exits ivory_cpu_run() immediately */
    uint32_t            idle_yield_count;
    uint32_t            host_mono_hi_latch;

    /* Multi-head uncaptured mouse state */
    uint32_t            mouse_xy;           /* <28> in_win | <27:24> screen_id | <23:12> y | <11:0> x */
    uint32_t            mouse_btn;          /* <27:16> seq | <10:3> wheel | <2:0> btns */

    /* Bidirectional RPC channel */
    uint32_t            rpc_chan_pma;
    uint32_t            rpc_status;

    /* Future multi-head color descriptors (heads 1..4 -> idx 0..3) */
    uint32_t            head_count;
    uint32_t            head_select;
    uint32_t            head_mode[4];
    uint32_t            head_cur_ctl[4];
    uint32_t            head_cur_pma[4];
    uint8_t             head_clut_idx[4];
    uint32_t            head_clut_rgb[4][256]; /* 4 * 1024 = 4096 bytes */

    /* Reload-safe host shell callbacks (NULL in pure unit tests) */
    uint64_t            (*read_host_mono_us)(void *ctx);
    IvoryPvDoorbellFn   on_rpc_doorbell;
    IvoryPvCtrlChangeFn on_ctrl_change;
    void               *host_ctx;
    uint32_t            _pad;
} IvoryPvBoard;
/* Ensure sizeof(IvoryPvBoard) % 8 == 0 and subtract sizeof(IvoryPvBoard)/8 from MerlinBoard::_reserved[1054] */

Export thin core helpers in IvoryCoreApi (ivory_core_api.h & core_api.c)—bumping IVORY_CORE_ABI_VERSION:

  • merlin_pv_set_callbacks(MerlinBoard *board, ...)
  • merlin_pv_push_mouse_abs(MerlinBoard *board, uint8_t screen_id, uint16_t x, uint16_t y, bool in_win, uint8_t buttons, int8_t wheel_delta) (updates mouse_xy/mouse_btn, sets PV_IRQ_MOUSE_MOVE / PV_IRQ_MOUSE_BTN in irq_status, calls merlin_refresh_irq_cache(board)).
  • merlin_pv_raise_irq(MerlinBoard *board, uint32_t irq_bits) (used by host RPC thread to raise PV_IRQ_RPC_RX).

3.2 Real Guest Idle Trigger (Host + Genera)

  1. Zero-Overhead Slice Exit in libivory_core.so (cpu.c:1698-1706 & cpu.c:2345-2357):
    • In cpu_run_threaded, OP_MEMORY_WRITE is already routed to &&L_exec_sys_sync (cpu.c:1568), which calls THREADED_FINISH_CALLOUT(..., /*force_reload_=*/true) \(\to\) L_page_exit (advancing ip and materializing cpu->pc) \(\to\) L_outer_reload.
    • At L_outer_reload: (cpu.c:1703) and at the top of the scalar while (!cpu->halted) loop (cpu.c:2346), add:
      if (IVORY_UNLIKELY(board != NULL && board->pv.idle_yield_us != 0U)) {
          FLUSH_TIMERS(); /* in cpu_run_threaded */
          return IVORY_OK;
      }
      
    • Hot-loop cost: 0 instructions added to DISPATCH_NEXT_STRIDE().
  2. Condvar Sleep in emu_thread_main (main.c:1539-1602):
    • Immediately after debug_ctl_run_budget(...), check uint32_t guest_yield_us = rt->board->pv.idle_yield_us; rt->board->pv.idle_yield_us = 0U;.
    • If guest_yield_us > 0U && rt->dbg.idle_yield_enabled && !rt->core.api->merlin_irq_asserted(rt->board):
      • Compute uint64_t next_timer_us = rt->core.api->merlin_us_until_next_timer_irq(rt->board);
      • uint64_t sleep_us = (guest_yield_us < next_timer_us) ? guest_yield_us : next_timer_us; (clamp to <= 25000U, skip if < 150U).
      • Sleep on pthread_cond_timedwait(&rt->wake_cv, &rt->lock, &ts)—which is already signaled immediately by SDL keyboard/mouse events, SLIRP Ethernet RX, serial RX, debug socket commands, and now Host \(\to\) Guest RPC responses!
      • Keep the existing 3-slice heuristic spin detector as an automatic fallback when PV_CTRL_IDLE_EN is 0 (e.g. during FEP prompt before Genera boots).
  3. Genera 8.3 Scheduler Idle Hook (emulator-pv:pv-idle-hook):
    • Hook Genera's scheduler idle loop (si::process-scheduler-idle-function / si:*scheduler-idle-hook* or sys:advise on the scheduler's idle pass when no runnable process exists in si:active-processes).
    • Inside the hook, verify (and *pv-enabled* (zerop (ldb sys:%%cr-trap-mode (sys:%control-register)))) (interrupts enabled) and execute a single (sys:%memory-write *pv-reg-idle-yield-pma* 16000). The next Merlin 60 Hz / periodic timer, keyboard, mouse, Ethernet, or RPC VME #x60 interrupt wakes the CPU cleanly.

3.3 Multi-Head Seamless Absolute Mouse (screen_id = 0..15)

Host Side (sdl_console.c)

  • When (board->pv.ctrl & (PV_CTRL_ENABLE | PV_CTRL_ABS_MOUSE_EN)) == (PV_CTRL_ENABLE | PV_CTRL_ABS_MOUSE_EN):
    1. Disable SDL_SetWindowRelativeMouseMode (never grab/trap the host cursor) and call SDL_HideCursor() while inside the active content rect (or keep OS cursor until first motion).
    2. On SDL_EVENT_MOUSE_MOTION, SDL_EVENT_MOUSE_BUTTON_DOWN/UP, and SDL_EVENT_MOUSE_WHEEL:
      • Map event.windowID \(\to\) screen_id (0 for the primary XL1200 B&W console window; 1..4 for secondary color head windows when Wave 4 is active).
      • Transform window coordinates (event.x, event.y) through the window's letterboxed win_rect (accounting for overscan_trim margins in sdl_console.c so trimmed margins add the exact X/Y pixel offset of the visible VRAM sub-rect!).
      • Clamp (gx, gy) to [0..fb_width-1, 0..fb_height-1] and call core->api->merlin_pv_push_mouse_abs(board, screen_id, gx, gy, in_rect, buttons, wheel) + pthread_cond_signal(&rt->wake_cv).
    3. Suppress console_hw_push_mouse quadrature packets while PV_CTRL_ABS_MOUSE_EN is set, preserving automatic fallback to relative quadrature mouse whenever PV_CTRL_ABS_MOUSE_EN is 0 (FEP mode or unpatched worlds).

Genera 8.3 Guest Side (Two-Half Wired + Preemptive Daemon Design)

Why two halves are mandatory (verified in genera-original/sys.sct/i-sys/wired-console.lisp lines 427–686 and genera-original/sys.sct/window/mouse.lisp lines 1211–1242):

  • Constraint A (tv:mouse-set-sheet cannot run wired): Switching tv:mouse-sheet between screens acquires window-system locks, updates per-screen blinkers, and sends Flavor messages—illegal inside si:defwiredfun high-priority VME interrupt context.
  • Constraint B (wired-mouse 32-bit XOR fast-track width): si::xor-mouse-cursor uses a 32-bit wide ART-1B mask (32 px on 1-bpp monochrome, which would only span 4 px at 8-bpp or 1 px at 32-bpp). On color screens (> 1 bpp), tv::update-wired-mouse-cursor leaves wired-mouse-cursor-state = %mouse-cursor-open, delegating drawing to Genera's MOUSE process blinker (tv:wakeup-wired-mouse) or our PV_REG_HEAD_CUR_* hardware sprite!

Therefore, the VME #x60 interrupt handler (pv-vme-interrupt-handler, si:defwiredfun) does:

  1. Read PV_REG_IRQ_STATUS and W1C the handled bits.
  2. On PV_IRQ_MOUSE_MOVE / PV_IRQ_MOUSE_BTN:
    • Read xy = (sys:%memory-read *pv-reg-mouse-xy-pma*) and btn = (sys:%memory-read *pv-reg-mouse-btn-pma*).
    • Extract x = (ldb (byte 12 0) xy), y = (ldb (byte 12 12) xy), sid = (ldb (byte 4 24) xy), buttons = (ldb (byte 3 0) btn).
    • Same-Screen Fast Path ((= sid *pv-active-screen-id*)):
      • Call (si::wired-mouse-handle-motion (- x si::wired-mouse-x) (- y si::wired-mouse-y)) (exact zero-drift delta against Genera's wired coordinate!).
      • If (/= buttons si::wired-mouse-last-buttons), push a hardware-free timestamped entry directly into tv:mouse-buttons-buffer (tv:mouse-buttons-buffer-in-index, matching wired-console.lisp:629-656) and call (tv:wakeup-wired-mouse).
      • If sid > 0 and hardware cursor sprite is enabled on head sid, write (dpb y (byte 12 13) (dpb x (byte 12 1) 1)) to PV_REG_HEAD_CUR_CTL.
    • Cross-Screen Warp Path ((/= sid *pv-active-screen-id*)):
      • Store sid, x, y, buttons into wired variables *pv-pending-screen-id*, *pv-pending-x*, *pv-pending-y*.
      • Wake pv-screen-switch-daemon—a tiny background Lisp process created with (process:make-process "PV Mouse Screen Switcher" :warm-boot-action ... :priority 32 :preemptive t)—which looks up (aref *pv-screen-table* sid), calls (tv:mouse-set-sheet target-screen), warps (tv:mouse-warp x y), and updates *pv-active-screen-id*!

3.4 Bidirectional RPC Channel (PV-VME-TRANSPORT-AGENT) & Unified HOST: Filesystem

Instead of inventing a custom ad-hoc filesystem protocol, we build directly on Genera 8.3's existing Embedding RPC framework (genera-original/sys.sct/embedding/rpc/std-agent.lisp, genera-original/sys.sct/embedding/rpc/emb-agent.lisp, genera-original/sys.sct/embedding/emb-queue.lisp, genera-original/sys.sct/embedding/ux/rpc-services.lisp) and its C counterpart in genera-original/sun/sun-ux-support/src/ (RPC.h, rpc.c, stdagent.c, rpcspprt.c, fepfs.c).

Why This Fits Cleanly Without EmbCommArea

  • Zero EmbCommArea Pollution: Rather than allocating inside sys:*emb-communication-area* (which stays NIL), emulator-pv allocates one wired block in :wired-structure-area (PV-RPC-CHANNEL-HEADER + 4 standard emb:emb-queue ring buffers + packet buffers) and writes its physical address to PV_REG_RPC_CHAN_PMA (0xC4000020).
  • Zero Byte-Swapping (RPC::LITTLE-ENDER-DATA): Both Ivory (<31:0> payload) and x86-64/ARM64 are little-endian! Subclassing RPC:STD-TRANSPORT-AGENT + RPC::LITTLE-ENDER-DATA + RPC::SERVER-PROCESS-MIXIN means integers, floats, and arrays transfer natively without bswap32.
  • Interrupt-Driven Wakeup (Zero Spin-Polling):
    • Guest \(\to\) Host: send-message pushes packet index to guest_to_host_queue and writes 1 to PV_REG_RPC_DOORBELL, waking the host C RPC worker immediately.
    • Host \(\to\) Guest: Host pushes reply or incoming Host \(\to\) Guest request to host_to_guest_queue and calls merlin_pv_raise_irq(board, PV_IRQ_RPC_RX). The VME #x60 ISR sets *pv-rpc-rx-ready* = t and wakes the waiting RPC client/server process (process:process-wait on *pv-rpc-rx-ready*), unlike stock emb-agent.lisp:243 which spin-polled!

Shared Wired Memory Layout (PV-RPC-CHANNEL-HEADER at PV_REG_RPC_CHAN_PMA)

All words are standard 40-bit Ivory DTP-FIXNUMs in wired RAM (host accesses mem->ram[pma].q.pointer under rt->lock or short copy-in/copy-out, marking dirty pages via ivory_mem_mark_ram_dirty on writes):

  • +0: magic (#x12504331, "RPC1" fixnum-safe)
  • +1: version (1)
  • +2: g2h_call_queue_pma (Guest \(\to\) Host RPC calls, 64 slots)
  • +3: h2g_reply_queue_pma (Host \(\to\) Guest RPC replies, 64 slots)
  • +4: h2g_call_queue_pma (Host \(\to\) Guest RPC calls, 32 slots)
  • +5: g2h_reply_queue_pma (Guest \(\to\) Host RPC replies, 32 slots)
  • +6: pool_base_pma (Wired packet pool: 128 buffers \(\times\) 1024 words = 128 KW = 512 KiB)
  • +7: pool_buf_words (1024)

Defined Remote Modules (Syntax: Lisp+C)

  1. Module PV-HOST-SERVICES (#x50560001, Guest \(\to\) Host):

    • Host Info & Time: GetHostInfo() -> (hostname os-name arch pid), GetHostUnixTimeNs() -> (sec_hi sec_lo nsec tz_offset_min).
    • Clipboard & Desktop: GetClipboardText() -> string, SetClipboardText(string) -> ok, OpenHostUrl(string) -> ok.
    • Unified Zero-Copy HOST: Filesystem Operations (sandboxed on host under configurable --host-fs-root <dir>, disallowing .. escapes unless --host-fs-full is passed):
      • FsStat(rel_path) -> (exists kind size_hi size_lo mtime_univ uid gid mode)
      • FsListDir(rel_path) -> list-of-entries
      • FsOpen(rel_path, flags, create_mode) -> (handle size_hi size_lo mtime_univ)
      • FsClose(handle) -> ok
      • FsReadDma(handle, offset_hi, offset_lo, wired_buf_pma, byte_len, xlate_mode) -> (bytes_read eof_p): Host C reads directly from host fd and writes straight into wired guest RAM mem->ram[wired_buf_pma ..] (calling ivory_mem_mark_ram_dirty), supporting both raw binary (8-bit / 16-bit .ibin FASL files!) and Lisp character newline/font translation (\n \(\leftrightarrow\) #\Return = 0215 octal, reusing genera-original/sun/sun-ux-support/src/fepfs.c rules).
      • FsWriteDma(handle, offset_hi, offset_lo, wired_buf_pma, byte_len, xlate_mode) -> bytes_written: Zero-copy DMA read from wired guest RAM directly to host pwrite().
      • FsRename(old_path, new_path), FsDelete(rel_path), FsMkdir(rel_path).
    • Genera HOST: Pathname & fs:file-access-path Integration:
      • Define logical/physical host "HOST" (HOST:/path/to/file.lisp, mapping Lisp versions .newest / .1 cleanly to unversioned POSIX files, .ibin as binary 16-bit/byte stream, .lisp/.text with LF\(\leftrightarrow\)Return translation) backed by a 64 KiB wired bounce buffer per open stream for FsReadDma / FsWriteDma.
  2. Module PV-GUEST-CONTROL (#x50560002, Host \(\to\) Guest, exposed on debug_ctl.c socket as rpc ...):

    • Ping() -> (genera-version world-name uptime-sec free-wired-words)
    • EvalString(pkg_name, form_string) -> (ok_p values_string error_string)
    • CompileAndLoadHostFile(host_pathname_string) -> (ok_p warnings_string)
    • SaveIncrementalWorld(ilod_name) -> ok_p

3.4b External RPC Bridge / Sidecar Proxy (Beyond the Emulator)

To allow external host programs (Python/Common Lisp/Rust/C tooling, IDE plugins, custom UIs, external service daemons, or AI assistants) to interact directly with Genera over the low-latency IVPV RPC bus without modifying ivory-xl1200 C code:

  • Local IPC Transport (--pv-rpc-listen <addr> / :pv-rpc-listen): Reuses emu/include/emu_ipc.h to expose a framed binary/JSON-RPC proxy over AF_UNIX (Linux/Unix), Win32 Named Pipe (\\.\pipe\ivory-pv-rpc-<pid>), or opt-in localhost TCP (127.0.0.1:<port>).
  • Two-Way Extensibility:
    1. External Guest \(\to\) Host Modules: An attached external process sends REGISTER_MODULE(module_id, name) (for custom module IDs outside built-in #x50560001/#x50560002, e.g., #x50561000..#x5056FFFF). When Genera invokes a procedure on that module ID, pv_rpc_host.c forwards the little-endian RPC call packet to the registered sidecar client and relays its reply back into h2g_reply_queue + PV_IRQ_RPC_RX.
    2. External Host \(\to\) Guest Calls: Attached clients can invoke PV-GUEST-CONTROL (or any guest-registered RPC server module) asynchronously through h2g_call_queue and receive typed replies without going through text-only debug_ctl line parsing.
  • Safety: Disabled by default unless --pv-rpc-listen is passed; disconnects cleanly on sidecar exit by returning an RPC MODULE_UNAVAILABLE error to any in-flight guest call so Genera never hangs.

3.5 Separate Optional VME Linear Color Card (IVFB, screen_id = 1..4 — Lower Priority)

Decoupled Card Design: Linear color heads are modeled as a separate optional VME card (VME_CARD_IVFB) registered at VME A32 0x1400_0000..0x15FF_FFFF (PMA 0xC500_0000..0xC57F_FFFF) on the shared docs/vme-bus-plan.md bus rather than required inside IVPV. This keeps IVPV minimal and lower-risk while allowing IVFB to be added independently later if desired.

Capacity Analysis on Physical XL1200 Architecture

  • Physical XL1200 has a 7-slot VME chassis (Slot 1 = Merlin-II Ivory CPU, Slot 2 = Merlin I/O, leaving 5 free VME slots—1 for IVPV + up to 4 simultaneous Color Framebuffer Heads).
  • Genera's window system (tv:all-the-screens in genera-original/sys.sct/window/screen.lisp, tv:define-screen in genera-original/sys.sct/window/screen-init.lisp) natively manages 1 onboard B&W console (screen_id = 0) + 1..4 simultaneous color screens (screen_id = 1..4) concurrently, each with independent window hierarchies, color maps, and Lisp Listeners, with seamless host cursor traversal across all SDL3 windows via PV_REG_MOUSE_XY<27:24>!

Hardware & Guest Driver Design (Wave 4)

  • VRAM Backing: Allocate on-demand per enabled head (--color-heads N, default 0, up to 4) at PMA 0xC5000000 + (head - 1) * 0x00200000 (2 MW = 8 MiB per head, enough for 1152x900 or 1280x1024 at both 8-bpp pseudocolor and 32-bpp BGRX8888, with dirty-page bitmap tracking identical to vram_dirty_bitmap).
  • Genera Screen Class (pv-color-screen):
    • Subclass tv:hardware-bitmap-screen-mixin + tv:color-bitmap-mixin + tv:screen (genera-original/sys.sct/window/bitmap-screen.lisp lines 55–165, genera-original/sys.sct/window/colors.lisp).
    • Map the linear VME aperture (0xC5000000+) into an ART-8B (8-bpp, :bits-per-pixel 8, hardware CLUT via PV_REG_HEAD_CLUT_IDX/RGB) or ART-32B (32-bpp) displaced screen array (tv:screen-buffer). Because Ivory ALU BitBlt (bitblt / draw-line / draw-char) operates directly on ART-8B/ART-32B screen arrays, zero custom graphics acceleration microcode is required (unlike the TMS34010/bt458 Symbolics Color/FrameThrower boards!).
    • Register each active head in *pv-screen-table* at index 1..4 so pv-screen-switch-daemon switches tv:mouse-sheet automatically the moment the host pointer enters that SDL3 window.

4. Genera 8.3 Patching, Wired-Code Rules, Bootstrapping & World Save

4.1 Mandatory Genera Wired-Code Compilation Rules (genera-original/sys.sct/sys2/memory-cold.lisp lines 114–237, genera-original/sys.sct/sys/cold-load.lisp line 112)

Every function reachable from VME #x60 interrupt context (pv-vme-interrupt-handler and helpers) MUST obey these five rules or Genera will crash with a page fault inside high-priority sequence break:

  1. Storage Category Before Definition: Declare (si:declare-storage-category :function-cell 'pv-vme-interrupt-handler :wired) BEFORE (si:defwiredfun pv-vme-interrupt-handler ...) so the symbol's function cell itself resides in wired memory.
  2. Wired Variables Only: Every global read or written by a defwiredfun MUST be defined with (si:defwiredvar *pv-...* ...) (which places its value cell in :wired-Preset-Variables).
  3. Compile to .ibin File First (Compile File / Compile System): Do not interactively C-sh-C (Compile Definition) a defwiredfun in Zmacs unless compiler:*allow-wired-compile-to-core* is bound, because FASLoading a compiled .ibin is what allocates the DTP-COMPILED-FUNCTION in :wired-function-area!
  4. No Consing / No Bignums / No Flavor Messages: Use only fixnum ldb/dpb/logand/+/-, sys:%memory-read, sys:%memory-write, aref on pre-allocated wired arrays, and process:wakeup / tv:wakeup-wired-mouse.
  5. Post-Load Verification: After loading emulator-pv, verify wired linkage via (si:funcall-in-wired-environment ...) / checking that every function in the ISR call graph resides in a wired region (sys:%region-bits).

4.2 Graceful Probe & Cold/Warm Initialization

Register pv-probe-and-enable on '(:warm :cold) via si:add-initialization:

(defun pv-probe-board-p ()
  (condition-case ()
      (= (sys:%memory-read *pv-reg-magic-pma*) #x19565056)
    (sys:memory-bus-error nil)))
  • If pv-probe-board-p returns NIL (e.g., world booted with --no-pv-board), set *pv-enabled* to NIL, leave PV_REG_CTRL = 0, and fall back 100% cleanly to standard XL1200 relative mouse, heuristic idle, and Chaos/TCP/NFS networking.
  • If T: allocate/verify wired RPC channel, write PV_REG_RPC_CHAN_PMA, install (cli:install-bus-interrupt-handler 'pv-vme-interrupt-handler #x60), start pv-screen-switch-daemon and pv-rpc-server, unmask PV_REG_IRQ_MASK, and set PV_REG_CTRL enable bits.

4.3 Guest System Tree (genera-pv/ on Host \(\to\) SYS:SITE;EMULATOR-PV; in Guest)

Organize the Genera source files cleanly in a new repo directory genera-pv/:

  1. emulator-pv.system — sct:defsystem :emulator-pv declaration (:default-pathname "SYS:SITE;EMULATOR-PV;").
  2. pkgdcl.lisp — (defpackage :emulator-pv (:use :scl :sys) ...).
  3. pv-defs.lisp — Register PMAs (DTP-PHYSICAL-ADDRESS constants via cli:make-bus-address), bitfields, si:defwiredvar declarations, and :function-cell ... :wired declarations.
  4. pv-wired.lisp — si:defwiredfun VME #x60 interrupt handler, wired mouse fast-path + button ring injector, RPC RX wakeup flag, and pv-idle-yield primitive.
  5. pv-init-and-mouse.lisp — pv-probe-and-enable, scheduler idle hook installation, pv-screen-switch-daemon (tv:mouse-set-sheet), and (:warm :cold) initializations.
  6. pv-rpc-agent.lisp — PV-VME-TRANSPORT-AGENT (RPC:STD-TRANSPORT-AGENT + RPC::LITTLE-ENDER-DATA + RPC::SERVER-PROCESS-MIXIN) and wired emb-queue channel allocator.
  7. pv-rpc-services.lisp — Syntax: Lisp+C DEFINE-REMOTE-MODULE definitions (PV-HOST-SERVICES & PV-GUEST-CONTROL).
  8. pv-host-fs.lisp — HOST: logical/physical host & fs:file-access-path implementation using FsReadDma / FsWriteDma + wired bounce buffers.
  9. pv-color-screen.lisp (Wave 4) — pv-color-screen (tv:hardware-bitmap-screen-mixin + tv:color-bitmap-mixin).

4.4 Bootstrap Injection & Incremental World Save (IDS) Procedure

  1. First-Time Bootstrap into Running Stock Genera 8.3:
    • Build a tiny ISO9660 image (mkisofs/xorriso) containing genera-pv/*.lisp and attach it dynamically via the live debug control socket (scsi attach-cdrom ...—see xl1200-live-debug and genera-8.3-cdrom-install.md), or serve via SLIRP host gateway.
    • Copy to LMFS (SYS:SITE;EMULATOR-PV;*.*), register SYS:SITE;EMULATOR-PV.SYSTEM, and run Compile System :Emulator-Pv.
    • Once emulator-pv loads, HOST: is immediately live! All subsequent iterations edit files directly in genera-pv/ on the Linux host and run (sct:compile-system :emulator-pv) or invoke rpc compile-and-load over the emulator control socket in <1 second!
  2. Persisting into an Incremental Bootable World (.ilod):
    • Do NOT run (si:full-gc) beforehand (keeps incremental delta small—typically 1–3 MB).
    • Quiesce in-flight RPC calls, leaving the (:warm :cold) initialization hook registered.
    • Run:
      Command: Save World :Bootable Yes :Incremental Yes
      
      saving e.g. genera_8_3_pv.ilod to FEPFS alongside genera_8_3.ilod and updating hello.boot (or FEP Boot script). On every future cold/warm boot, pv-probe-and-enable activates idle yield, seamless mouse, HOST:, and RPC automatically within milliseconds of reaching Lisp!

5. /swarm Execution Plan: Waves, File Ownership & Verification Gates

To maximize parallel execution with zero merge conflicts, work is partitioned into 4 waves with strict file ownership boundaries.

flowchart TD
    W1["Wave 1: Core C11 IVPV Board & Slice Yield (libivory_core.so)"]
    W2A["Wave 2A: Shell Idle Condvar & Multi-Window Uncaptured Mouse (main.c, sdl_console.c)"]
    W2B["Wave 2B: Host C11 RPC Engine, HOST: POSIX/DMA Sandbox & debug_ctl RPC Bridge (pv_rpc_host.c, debug_ctl.c)"]
    W3A["Wave 3A: Genera Wired Core, Idle Hook & Multi-Head Mouse Lisp (genera-pv/ core)"]
    W3B["Wave 3B: Genera PV-VME-TRANSPORT-AGENT, RPC Modules & HOST: Access Path (genera-pv/ rpc+fs)"]
    W3C["Wave 3C: Live Genera Bootstrap, Integration Test & Incremental World Save"]
    W4["Wave 4 (Optional/Stretch): Linear VME Color Framebuffers (screen_id 1..4) + Multi-Window SDL3"]

    W1 --> W2A
    W1 --> W2B
    W2A --> W3A
    W2B --> W3B
    W3A --> W3C
    W3B --> W3C
    W3C --> W4

Wave 1 — Core C11 IvoryPvBoard, VME IACK & Zero-Overhead CPU Yield

  • Owned Files:
    • emu/include/ivory_hw.h
    • emu/include/ivory_emu.h
    • emu/include/ivory_core_api.h
    • emu/src/core_api.c
    • emu/src/merlin.c
    • emu/src/cpu.c
    • emu/tests/test_pv_board.c + emu/Makefile (unit test target only)
  • Deliverables:
    • IvoryPvBoard struct carved out of MerlinBoard::_reserved preserving sizeof(MerlinBoard) == 278528U, sizeof(IvoryMem) == 32768U, sizeof(IvoryCpu) == 4096U.
    • Direct VME A32 MMIO (0xC4000000 / 0xD4000000), polled VME read/write (#x88000080..#x88000140), and VIC068 high-priority VME IACK (IA=0 \(\to\) vector #x60, asserting MERLIN_IRQ_MII_VME_HIGH).
    • Zero-overhead board->pv.idle_yield_us != 0U exit at L_outer_reload (cpu.c:1703) and scalar ivory_cpu_run (cpu.c:2346).
    • Exported merlin_pv_* functions in IvoryCoreApi.
  • Verification Gate:
    • nix develop --command make -C emu test passes 100%, including new test_pv_board covering: magic/version 29-bit fixnum check, direct vs polled VME R/W parity, W1C IRQ status + MERLIN_IRQ_MII_VME_HIGH assertion + IACK #x60 vector read, #x5F vector rejection, and PV_REG_IDLE_YIELD slice exit.
    • readelf -WS emu/build/libivory_core.so confirms 0 bytes of mutable .data/.bss and ldd confirms zero SDL/pthread/OS library dependencies.

Wave 2 — Host Shell Plumbing (Parallel Workstreams 2A & 2B)

Workstream 2A: Condvar Idle Sleep & Uncaptured Multi-Head SDL3 Mouse

  • Owned Files:
    • emu/src/main.c
    • emu/src/sdl_console.c
  • Deliverables:
    • CLI flags --no-pv-board (disables IVPV magic for fallback testing) and --host-fs-root <dir> (default: none/disabled unless specified; passed to 2B).
    • emu_thread_main immediate condvar sleep on board->pv.idle_yield_us bounded by merlin_us_until_next_timer_irq(), keeping 3-slice heuristic fallback when PV_CTRL_IDLE_EN == 0.
    • sdl_console.c uncaptured absolute mouse mode when PV_CTRL_ABS_MOUSE_EN == 1: letterbox + overscan_trim coordinate conversion, windowID -> screen_id mapping, merlin_pv_push_mouse_abs + wake_cv signal, and automatic fallback to relative quadrature mouse when PV_CTRL_ABS_MOUSE_EN == 0.

Workstream 2B: Host C11 RPC Engine, Sandboxed HOST: DMA & debug_ctl Bridge

  • Owned Files:
    • emu/src/pv_rpc_host.c (new) + emu/include/pv_rpc_host.h (new)
    • emu/src/debug_ctl.c
    • emu/Makefile (SHELL_SRCS)
    • emu/tests/test_pv_rpc_host.c (new)
  • Deliverables:
    • Clean C11 port/adaptation of STD-TRANSPORT-AGENT little-endian marshaling (emb-queue ring reader/writer against mem->ram + ivory_mem_mark_ram_dirty + merlin_pv_raise_irq(PV_IRQ_RPC_RX) + wake_cv signal).
    • PV-HOST-SERVICES handlers (GetHostInfo, GetHostUnixTimeNs, SDL clipboard bridge, and path-jailed FsStat/FsListDir/FsOpen/FsClose/FsReadDma/FsWriteDma/FsRename/FsDelete/FsMkdir with binary + Lisp Return/\n translation).
    • PV-GUEST-CONTROL client commands exposed in debug_ctl.c (pv-status, rpc-ping, rpc-eval <pkg> <expr>, rpc-compile-load <path>).
  • Wave 2 Verification Gate:
    • nix develop --command make -C emu all test succeeds cleanly; test_pv_rpc_host verifies ring-buffer wraparound, .. path-traversal rejection, binary .ibin DMA exactness, and Lisp newline translation.
    • Booting authentic fep330/rom.dump to FEP prompt confirms zero regression when PV_CTRL == 0.

Wave 3 — Genera 8.3 emulator-pv Guest Suite & Live World Verification

Workstream 3A: Wired Core, Idle Hook & Two-Half Multi-Head Mouse (genera-pv/ Core)

  • Owned Files: genera-pv/emulator-pv.system, genera-pv/pkgdcl.lisp, genera-pv/pv-defs.lisp, genera-pv/pv-wired.lisp, genera-pv/pv-init-and-mouse.lisp.

Workstream 3B: PV-VME-TRANSPORT-AGENT, RPC Modules & HOST: Access Path (genera-pv/ RPC & FS)

  • Owned Files: genera-pv/pv-rpc-agent.lisp, genera-pv/pv-rpc-services.lisp, genera-pv/pv-host-fs.lisp.

Workstream 3C: Live Genera Bootstrap, End-to-End Gate & Incremental .ilod Save

  • Execution & Verification Gate (Strictly Authentic Genera 8.3 World):
    1. Generate bootstrap ISO from genera-pv/, boot authentic Genera 8.3 in ivory-xl1200 --host-fs-root genera-pv, compile emulator-pv to .ibin via SCT, and load it.
    2. Gate 1 (Wired Safety): Confirm zero page faults under sustained mouse movement + PV_IRQ_RPC_RX bursts while GC (si:gc-immediately) runs concurrently.
    3. Gate 2 (Real Idle Trigger): Measure host ivory-xl1200 thread CPU% at idle Genera Lisp Listener (< 3% host CPU vs spin baseline, pv-status idle_yield_count incrementing at ~60 Hz, keystroke response < 5 ms).
    4. Gate 3 (Seamless Mouse): Verify pixel-exact (tv:mouse-x) / (tv:mouse-y) correspondence with debug_ctl injected/SDL mouse coordinates across both normal and overscan_trim modes, plus clean fallback when PV_REG_CTRL is cleared.
    5. Gate 4 (Bidirectional RPC & HOST: DMA):
      • From Genera: (probe-file "HOST:pv-defs.lisp"), (compile-file "HOST:pv-init-and-mouse.lisp"), and (load "HOST:pv-init-and-mouse.ibin") succeed with byte-identical checksums.
      • From Host (xl1200-live-debug socket): rpc-ping and rpc-eval CL-USER "(+ 40 2)" return "42" via VME #x60 interrupt without guest polling.
    6. Gate 5 (Persistence & Fallback): Save incremental genera_8_3_pv.ilod, cold-boot with IVPV enabled (verify auto-activation via (:warm :cold) hook), and cold-boot the same .ilod with --no-pv-board (verify bus-error-safe fallback to stock XL1200 peripherals).

Wave 4 (Optional / Stretch) — Multi-Head Linear VME Color Framebuffers (screen_id = 1..4)

  • Owned Files:
    • Host: emu/src/mem.c (0xC5000000..0xC57FFFFF fast VRAM aperture), emu/src/sdl_console.c (secondary SDL3 windows 1..4 presenting 8-bpp CLUT / 32-bpp BGRX + hardware cursor sprite overlay), emu/src/merlin.c (PV_REG_HEAD_* registers).
    • Guest: genera-pv/pv-color-screen.lisp (pv-color-screen subclassing tv:hardware-bitmap-screen-mixin + tv:color-bitmap-mixin, registered in tv:all-the-screens and *pv-screen-table*).
  • Verification Gate:
    • Boot Genera with --color-heads 2 (3 active screens simultaneously: 1 B&W + 2 Color).
    • Create colored windows/graphics on Color Heads 1 & 2, verify non-blank PPM dumps on all 3 heads, and verify moving the host pointer across Windows 0 \(\leftrightarrow\) 1 \(\leftrightarrow\) 2 smoothly transitions tv:mouse-sheet via pv-screen-switch-daemon without locking or page-faulting wired code.
Related Chip Datasheets (2)All Component Datasheets →