XL1200-EMU Symbolics XL1200 Emulator
Plans & Roadmap SpecsDONE docs/custom-boot-prom-plan.md

XL1200 SCSI/CD-ROM Boot PROM & IFEP Overlay Plan (prom/)

Status: DONE (Tier 1.5, Priority #6) — Implemented and verified end-to-end across Gates 1A, 1B (FEP7: SCSI disk + split 64 KiB 115988/115989 EPROMs), 1C (CART11: ISO-9660 CD-ROM), 2A (docs/fep-internals-and-overlays.md), and 2B (live custom-diag.flod overlay command "Show Emulator Info" at FEP Command:). Depends on: docs/assembler-disassembler-plan.md (tools/ivasm/). Zero libivory_core ABI changes. See docs/ROADMAP.md for overall sequencing.

Target Artifact: Clean-room Ivory Rev 4/4A Boot PROM (prom/) + IFEP internals guide & sample .flod overlay
Hardware & Format References: docs/boot-rom.md, docs/fep-rom-structure.md, docs/fep-architecture-and-boot-lifecycle.md, docs/ifep-file-formats-and-decompilation.md, docs/hardware-reference/04-merlin-ii-core-and-vmebus.md, docs/hardware-reference/05-xl1200-workstation-peripherals.md


1. Executive Summary & Clean-Room Boundary

Booting ivory-xl1200 today requires user-supplied Symbolics Boot PROM dumps (115988+115989 or rom.dump, IFEP promJ). Once tools/ivasm/ can assemble canonical Ivory Lisp S-expression sources directly into checksummed IFEP prom containers, this plan delivers two sequential milestones:

  1. Phase 1 — Clean-Room Open-Source XL1200 Boot PROM (prom/):
    • SCSI-only (WD33C93A controller). No ESDI or streaming tape; Ethernet netboot is permanently out of scope (Symbolics netboot relies on a local disk-resident FEP/boot world that loads the rest over the network rather than PROM-level network boot).
    • Boots IFEP kernels (e.g., i328-kernel.fep) from both FEPFS SCSI hard disks (FEP7:, Target 0) and ISO-9660 SCSI CD-ROMs (CART11:, Target 4) — allowing direct cold boot from a Genera 8.3 installation CD-ROM without proprietary Boot EPROM dumps.
    • Incorporates proven Merlin-II initialization lessons from the MiSTer FPGA stand-in PROM (Symbolics-XL1200_MiSTer/tools/bootprom.py), notably enabling the Merlin-II main-board memory cache (PMA 0x0A000004, mode 2) and populating the wired Boot Comm Area (0xFFFE0000..0xFFFE003F) before handing off to IFEP.
  2. Phase 2 — Deep IFEP Analysis, Custom .flod Overlays & New FEP Commands:
    • Systematic disassembly and clean-room documentation of Symbolics IFEP (i328-kernel.fep, i325-bol.fep, and stock .flod overlays) using ivasm disasm.
    • Documenting the 0xF8001100 overlay window, Kernel Build UID matching, resident kernel service calling conventions, and command directory table, culminating in an open-source SDK macro kit and working custom .flod overlay that registers a new command at FEP Command:.
IMPORTANT

Compliance with Emulator Clean-Room & Anti-Cheating Rules: AGENTS.md prohibits host-side synthetic bootloaders, fake string emitters, or guest-memory trampolines inside emu/src/. This Boot PROM is 100% genuine 40-bit Ivory guest firmware, assembled into a standard checksummed IFEP prom container (custom-rom.dump + split 115988/115989 pair) and executed unmodified through emu/src/loader.c, cold Merlin-II reset, and real WD33C93A SCSI DMA registers. Authentic Symbolics IFEP promJ regression tests remain independent and untouched.


2. Phase 1: Minimal Clean-Room SCSI & CD-ROM Boot PROM

2.1 Boot Architecture & Flow

flowchart TD
    RESET["Ivory Cold Reset<br/>PC = 0xF8007162 (IFEP prom entry)"]
    POST["1. Minimal Merlin-II Bring-Up<br/>LEDs (0x0A000000), Cache Mode 2 (0x0A000004),<br/>PIT/Timers, Zone 31 RAM Size &amp; Boot Comm Area"]
    SCSI["2. WD33C93A SCSI Reset &amp; Bus Init<br/>0x44015000 / 0x44017800 / 0x4401A000..B800<br/>32 KiB SRAM DMA Ring (0x40005000)"]
    SEL{"3. Boot Device Probe<br/>(FEP7: Target 0 first,<br/>fallback/override CART11: Target 4)"}
    DISK["4A. SCSI Disk (FEP7:, Target 0)<br/>Read 1,280B Sector 0 (LABL magic)<br/>Extract fep_dpn (word 53) &amp; geometry"]
    CDROM["4B. SCSI CD-ROM (CART11:, Target 4)<br/>2,048B ISO-9660 PVD (LBA 16) + Dir Walk<br/>Locate i328-kernel.fep / IFEP-Kernel"]
    LOAD["5. Kernel Unpack &amp; Handoff<br/>Unpack 20-byte chunks (4x 40-bit words)<br/>into Zone 31 RAM, set Boot Comm Area unit,<br/>jump to IFEP Kernel entry"]

    RESET --> POST --> SCSI --> SEL
    SEL -- "Valid LABL + fep_dpn" --> DISK --> LOAD
    SEL -- "No bootable disk or CD override" --> CDROM --> LOAD

2.2 Hardware Initialization Requirements

  1. Merlin-II Main-Board Cache Mode 2 (PMA 0x0A000004):
    • Lesson confirmed by Symbolics-XL1200_MiSTer/tools/bootprom.py: IFEP itself does not enable the Merlin-II main-board memory cache; if the Boot PROM leaves it disabled, Genera boots with a hardware warning complaining that the cache is disabled/defective. Early PROM init must program mode 2 into 0x0A000004.
  2. Merlin-II Board Control & Diagnostics:
    • Drive the 8-bit Merlin-II status LEDs (0x0A000000) with documented milestone codes at each bring-up stage (POST, cache init, SCSI reset, target probe, kernel read, handoff, error halt).
    • Initialize the Signetics SCN68562 DUSCC Serial Ch.A RX (CCR 0x4401700F, RXFIFO 0x44017114 for the XL1200 SLB console keyboard) + Ch.B TX/RX (CCR 0x4401702F, TXFIFO 0x44017030, RXFIFO 0x44017134, GSR 0x4401711B) and 1bpp monochrome framebuffer text console (PMA 0x48000000, VIDEO_CTRL 0x4402C000 = 2, clean-room 5×7-in-8×8 bitmap font rendered via OP_P_DPB) for dual-output boot status, countdown, and interactive SCSI boot device selection.
  3. Wired Boot Comm Area (0xFFFE0000..0xFFFE003F) & Boot Spy Block (0xF8040940+):
    • Initialize *BOOT-SPY-PC* (0xFFFE0004 → 0xFFFE0010), *BOOT-SPY-BLOCK-ADDRESS* (0xFFFE0007 → DTP-LOCATIVE 0xF8040940), CRASH-ACTION (0xF8040970 = DTP-FIXNUM 2), and BOOT-FEP-KERNEL-DPN (0xF8040975 = DTP-FIXNUM ((unit << 27) | dpn)) where unit = 7 (FEP7: Target 0) or unit = 11 (CART11: Target 4) so i328-kernel.fep and i325-bol.fep inherit an authentic machine state indistinguishable from stock IFEP promJ.
  4. WD33C93A SCSI-Only Driver:
    • Direct register access via Merlin-II I/O window (0x44015000 Merlin SCSI/DMA control: 0xB6 reset / 0xB7 idle / 0x37 DMA read; 0x44017800..1F write / 0x44017900..1F read WD33C93A registers; 0x4401A000 START_WRAP; 0x4401B800 DMA_COUNTER).
    • Uses the 32 KiB SCSI SRAM DMA ring (0x40005000..0x40006FFF, START_WRAP = 0x3D) and handles multi-chunk transfers exceeding 32 KiB (Phase 0x45 continuation), required when reading multi-hundred-KiB IFEP kernels from either disk or CD-ROM.
    • Implements the minimal SCSI command set: TEST UNIT READY (0x00), REQUEST SENSE (0x03), INQUIRY (0x12), READ CAPACITY (0x25), and READ(10) (0x28).

2.3 Boot Path A: FEPFS SCSI Hard Disk (FEP7:, Target 0)

  • Issue INQUIRY + READ CAPACITY + READ(10) for sector 0 (1,280 B logical block).
  • Validate the LABL disk label magic (0x4C41424C) and extract fep_dpn (word 53), which points to the kernel's FEPF (0x46455046) file header block (not raw .fep Page 0).
  • Walk the FEPF extent list (words 51..319, supporting both direct extents and indirect FEPP 0x46455050 blocks when bit 24 is set) to stream the .fep file.
  • Unpack .fep Page 0 (64 × 20-byte tag-first chunks: 4 tag bytes bytes[0..3] followed by 4 × u32 LE data words bytes[4..19]), parse its 3-word descriptors (target_vma, spec, source starting at w[8]), stream page extents into target Zone 31 VMAs, apply inline FEP-COMMUNICATION-AREA patches (bit 24 of spec set, installing version at 0xF8041000 and (FUNCTION FEP-STARTUP) at 0xF8041002), verify the 32-bit ones-complement end-around-carry checksum (w[5]), write BOOT-FEP-KERNEL-DPN (0x38000000 | fep_dpn), and transfer control via START-CALL / FINISH-CALL-N on 0xF8041002.

2.4 Boot Path B: ISO-9660 SCSI CD-ROM (CART11:, Target 4)

  • Probe SCSI Target 4 (INQUIRY peripheral type 0x05 CD-ROM, READ CAPACITY confirming 2,048-byte logical sectors).
  • Minimal Read-Only ISO-9660 Parser (Fast Boot Record + PVD Fallback):
    • First reads the ISO-9660 Boot Record at LBA 17 (0x00 "CD001" 0x01), extracting the 32-bit LE kernel starting LBA from bytes[72..75] (e.g., LBA 158514 → SYS/IFEP/I325_BOL.FEP;11 on Genera 8.3 distribution media).
    • If no Boot Record is present, falls back to the Primary Volume Descriptor at LBA 16 (0x01 "CD001"), extracts the Root Directory Extent LBA (bytes[158..161]), and walks SYS → IFEP → I325_BOL.FEP (or I328_KERNEL.FEP), matching case-insensitively and stripping ;version suffixes.
    • Streams the file's extent using READ(10) in 2,048-byte sectors through a word-aligned reblocker (512 u32 words → 320 u32 words = 1,280-byte FEP pages), sharing the exact same .fep Page 0 parser, unpacker, and ones-complement checksum verifier as FEP7:.
  • Populates BOOT-FEP-KERNEL-DPN (0x58000000 | lba, unit 11 = 7 + 4) so IFEP mounts CART11: automatically ([Default FEP11:>*.*.newest]) and permits running Disk Restore, Load World, or Copy directly from CD-ROM without an existing FEPFS disk.

2.5 Boot Device Selection, 3-Second Interruptible Prompt & Multi-SCSI Menu

  1. 3-Second Interruptible Prompt: On cold reset (v1.1), the Boot PROM displays Press any key within 3s to select SCSI boot device... 3 2 1 simultaneously on the 1bpp monochrome framebuffer and SCN68562 Serial Ch.B, timed via the Ivory Rev 4 microsecond clock (IVORY_REG_MICROSECOND_CLOCK, #o47). Any keypress on either the XL1200 SLB Console Keyboard (DUSCC Ch.A) or Serial Ch.B interrupts auto-boot.
  2. Full SCSI Bus Discovery (IDs 0..6): Scans all seven SCSI targets (0..6), probing each for a valid FEPFS hard disk (INQUIRY type 0x00, LABL magic, fep_dpn, and FEPF header -> FEP<7+tid>:) or bootable ISO-9660 CD-ROM (INQUIRY type 0x05, LBA 17 Boot Record or LBA 16 PVD SYS/IFEP kernel -> CART<7+tid>:).
  3. Auto-Boot Priority (on 3s timeout): Automatically boots the preferred default device: Target 0 (FEP7:) if bootable, else the first bootable FEPFS disk (0..6), else Target 4 (CART11:) if bootable, else the first bootable ISO-9660 CD-ROM (0..6).
  4. Interactive Boot Device Menu (on keypress): Lists every detected eligible SCSI device with its SCSI Target ID, Genera unit name (FEP<7+tid>: / CART<7+tid>:), kernel dpn/lba, and [default] tag, then prompts Select SCSI target ID [0-6] (Enter = default ID <N>): (rejecting non-bootable IDs and booting the selected target with the matching BOOT-FEP-KERNEL-DPN unit bits ((7 + tid) << 27) | loc).

2.6 Implemented Directory Layout (prom/)

prom/
├── Makefile                    # Invokes tools/ivasm to build custom-rom.dump, 115988/115989, custom-diag.flod
├── src/
│   ├── boot-prom.lisp          # Top-level IFEP promJ module including all PROM modules
│   ├── hw-defs.lisp            # Merlin-II PMA map, SCN68562 DUSCC Ch.A/B, WD33C93A regs, Boot Spy/Comm & scan table
│   ├── entry.lisp              # Reset vector (0xF8007162), LEDs, cache mode 2, video/DUSCC Ch.A+B, Boot Comm/Spy init
│   ├── console.lisp            # Dual 1bpp VRAM (8x8 font via OP_P_DPB) + Serial Ch.B output & SLB/Serial input + us-clock
│   ├── font8x8.lisp            # Clean-room 5x7-in-8x8 LSB-first ASCII bitmap font (0x20..0x7E, 190 words)
│   ├── scsi-wd33c93a.lisp      # WD33C93A register + 32 KiB SRAM DMA ring driver (multi-chunk Phase 0x45)
│   ├── fep-loader.lisp         # Shared .fep Page 0 parser, 20B tag-first chunk unpacker, ones-comp checksum
│   ├── fepfs-boot.lisp         # Multi-target LABL/FEPF probe & FEP<7+tid>: disk stream booter
│   ├── iso9660-boot.lisp       # Multi-target ISO-9660 LBA 17/16 probe & CART<7+tid>: 2048B->1280B reblocker booter
│   └── boot-main.lisp          # 3s countdown prompt, SCSI 0..6 scan, interactive device menu & FEP-STARTUP handoff
└── overlays/                   # (Phase 2) IFEP 328 SDK & sample custom .flod overlay
    ├── ifep328-sdk.lisp        # Kernel UID, resident service indirect cells, hardware PMA constants
    └── hello-overlay.lisp      # Sample clean-room .flod overlay registering "Show Emulator Info"

3. Phase 2: Deep Analysis of IFEP, Custom .flod Overlays & New Commands

Once ivasm disasm supports :ifep-fep and :ifep-flod containers, Phase 2 performs a structured clean-room analysis of Symbolics IFEP (i328-kernel.fep, i325-bol.fep, and stock .flod overlays on local user-supplied media) and documents the findings in a new reference manual (docs/fep-internals-and-overlays.md).

3.1 IFEP Internals Research Objectives

  1. Resident Kernel Memory Map (i328-kernel.fep & i325-bol.fep):
    • Map code sections, resident data/state globals, stack/scratch buffers, and the shared overlay window starting at 0xF8001100.
    • Identify how i325-bol.fep (Boot Overlay Loader) bootstraps the command interpreter and mounts FEP7: / CART11:.
  2. Resident Kernel Service ABI & Calling Conventions:
    • Catalog stable kernel entry points callable from overlays:
      • Console output (write-string, format, terpri, write-hex) and line/key input.
      • FEPFS file open/read/write/directory enumeration and raw SCSI block I/O.
      • Command-line parser & typed argument readers (pathname, number, keyword, switch parsing).
      • Abort / error signaling and clean return to FEP Command:.
  3. .flod Overlay Loader & Kernel UID Mechanics:
    • Verify exact binary layout of "IFEP overlayH", the 64-bit Kernel Build UID (5c3931aef3e75a93 for IFEP 328), section headers, relocation/fixup records (if any), and checksum algorithm.
    • Determine how IFEP resolves an unknown command name by scanning .flod files in the FEPFS root directory (or explicit Load Overlay), checking their embedded command directory tables, and swapping the matching overlay into 0xF8001100.
  4. Command Directory Table & Registration:
    • Document the exact record layout of every command descriptor inside a .flod overlay (command name string, abbreviation/prefix matching rules, help string, argument descriptor, and entry VMA).
    • Investigate whether additional commands can also be registered dynamically in memory or solely through .flod directory entries.

3.2 Deliverable: Clean-Room .flod Overlay SDK & Demo Command

  • Authored prom/overlays/ifep328-sdk.lisp (IFEP 328 Kernel UID, resident FORMAT 0xF8016448, default command handler 0xF80130BA, :EXECUTE selector 0xF900018C, Merlin-II PMAs) and prom/overlays/hello-overlay.lisp using ivasm's :ifep-flod backend and (def-ivory-string ...) macro.
  • Assembled prom/build/custom-diag.flod (494 bytes), injected into a test FEPFS disk image via ivory-fep-convert --inject, registered with Scan FEP7:>custom-diag.flod.1, and executed Show Emulator Info live at FEP Command: inside ivory-xl1200.

4. Verification & Acceptance Criteria (All Gates Passed)

GateCommand / ScenarioVerified Result
Gate 1A — PROM Container Validitymake -C prom all inspectPASS — Assembles checksum-valid prom/build/custom-rom.dump (5,295 B, 1,049 words) and split 64 KiB 115988-custom.bin/115989-custom.bin, accepted by emu/src/loader.c with zero warnings.
Gate 1B — SCSI Hard Disk Boot (FEP7:)ivory-xl1200 --rom prom/build/115988-custom.bin --rom-hi prom/build/115989-custom.bin --disk <genera-fepfs.dsk>PASS — Boots cleanly through WD33C93A SCSI DMA into FEP Command:, Show Version prints FEP version 328 (IFEP Kernel 328.23, IFEP Utilities 328.4) running in RAM, Merlin-II Cache Control verified = 2.
Gate 1C — ISO-9660 CD-ROM Boot (CART11:)ivory-xl1200 --rom prom/build/custom-rom.dump --cdrom <genera-8.3.iso> (no disk attached)PASS — Probes Target 4, reads LBA 17 Boot Record (with LBA 16 PVD fallback), reblocks 2,048B → 1,280B across boundaries, verifies ones-complement checksum, and boots I325_BOL.FEP;11 to FEP Command: with [Default FEP11:>*.*.newest] recognized.
Gate 2A — IFEP Internals Docdocs/fep-internals-and-overlays.mdPASS — Complete clean-room reference of Boot PROM handoff, .fep container format, .flod overlay binary layout, Kernel UID check, entry-rest-accepted dispatch, and resident FORMAT ABI (zero Symbolics binaries committed).
Gate 2B — Live Custom .flod Commandivory-fep-convert --inject + Scan FEP7:>custom-diag.flod.1 + Show Emulator InfoPASS — IFEP 328 dynamically loads custom-diag.flod into 0xF8001100, prints live IFEP 328, Merlin-II Cache=2, Boot Unit=7 DPN=232 / VideoCtrl=2 LEDs=0x4, and returns cleanly to FEP Command:.
Related Chip Datasheets (3)All Component Datasheets →