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 KiB115988/115989EPROMs), 1C (CART11:ISO-9660 CD-ROM), 2A (docs/fep-internals-and-overlays.md), and 2B (livecustom-diag.flodoverlay command"Show Emulator Info"atFEP Command:). Depends on:docs/assembler-disassembler-plan.md(tools/ivasm/). Zerolibivory_coreABI changes. Seedocs/ROADMAP.mdfor 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:
- 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
IFEPkernels (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.
- Phase 2 — Deep IFEP Analysis, Custom
.flodOverlays & New FEP Commands:- Systematic disassembly and clean-room documentation of Symbolics IFEP (
i328-kernel.fep,i325-bol.fep, and stock.flodoverlays) usingivasm disasm. - Documenting the
0xF8001100overlay 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.flodoverlay that registers a new command atFEP Command:.
- Systematic disassembly and clean-room documentation of Symbolics IFEP (
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 & Boot Comm Area"]
SCSI["2. WD33C93A SCSI Reset & 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) & 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 & 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 --> LOAD2.2 Hardware Initialization Requirements
- 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 into0x0A000004.
- Lesson confirmed by
- 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 0x44017114for 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 viaOP_P_DPB) for dual-output boot status, countdown, and interactive SCSI boot device selection.
- Drive the 8-bit Merlin-II status LEDs (
- 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), andBOOT-FEP-KERNEL-DPN(0xF8040975=DTP-FIXNUM ((unit << 27) | dpn)) whereunit = 7(FEP7:Target 0) orunit = 11(CART11:Target 4) soi328-kernel.fepandi325-bol.fepinherit an authentic machine state indistinguishable from stockIFEP promJ.
- Initialize
- WD33C93A SCSI-Only Driver:
- Direct register access via Merlin-II I/O window (
0x44015000Merlin SCSI/DMA control:0xB6reset /0xB7idle /0x37DMA read;0x44017800..1Fwrite /0x44017900..1Fread WD33C93A registers;0x4401A000START_WRAP;0x4401B800DMA_COUNTER). - Uses the 32 KiB SCSI SRAM DMA ring (
0x40005000..0x40006FFF,START_WRAP = 0x3D) and handles multi-chunk transfers exceeding 32 KiB (Phase0x45continuation), 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), andREAD(10)(0x28).
- Direct register access via Merlin-II I/O window (
2.3 Boot Path A: FEPFS SCSI Hard Disk (FEP7:, Target 0)
- Issue
INQUIRY+READ CAPACITY+READ(10)for sector 0 (1,280 Blogical block). - Validate the
LABLdisk label magic (0x4C41424C) and extractfep_dpn(word 53), which points to the kernel'sFEPF(0x46455046) file header block (not raw.fepPage 0). - Walk the
FEPFextent list (words 51..319, supporting both direct extents and indirectFEPP0x46455050blocks when bit 24 is set) to stream the.fepfile. - Unpack
.fepPage 0 (64 × 20-byte tag-first chunks: 4 tag bytesbytes[0..3]followed by 4 × u32 LE data wordsbytes[4..19]), parse its 3-word descriptors (target_vma, spec, sourcestarting atw[8]), stream page extents into target Zone 31 VMAs, apply inlineFEP-COMMUNICATION-AREApatches (bit 24ofspecset, installing version at0xF8041000and(FUNCTION FEP-STARTUP)at0xF8041002), verify the 32-bit ones-complement end-around-carry checksum (w[5]), writeBOOT-FEP-KERNEL-DPN(0x38000000 | fep_dpn), and transfer control viaSTART-CALL/FINISH-CALL-Non0xF8041002.
2.4 Boot Path B: ISO-9660 SCSI CD-ROM (CART11:, Target 4)
- Probe SCSI Target 4 (
INQUIRYperipheral type0x05CD-ROM,READ CAPACITYconfirming 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 frombytes[72..75](e.g., LBA158514→SYS/IFEP/I325_BOL.FEP;11on 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 walksSYS→IFEP→I325_BOL.FEP(orI328_KERNEL.FEP), matching case-insensitively and stripping;versionsuffixes. - Streams the file's extent using
READ(10)in 2,048-byte sectors through a word-aligned reblocker (512u32 words →320u32 words =1,280-byte FEP pages), sharing the exact same.fepPage 0 parser, unpacker, and ones-complement checksum verifier asFEP7:.
- First reads the ISO-9660 Boot Record at LBA 17 (
- Populates
BOOT-FEP-KERNEL-DPN(0x58000000 | lba, unit11 = 7 + 4) so IFEP mountsCART11:automatically ([Default FEP11:>*.*.newest]) and permits runningDisk Restore,Load World, orCopydirectly from CD-ROM without an existing FEPFS disk.
2.5 Boot Device Selection, 3-Second Interruptible Prompt & Multi-SCSI Menu
- 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 1simultaneously 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. - Full SCSI Bus Discovery (
IDs 0..6): Scans all seven SCSI targets (0..6), probing each for a valid FEPFS hard disk (INQUIRYtype0x00,LABLmagic,fep_dpn, andFEPFheader ->FEP<7+tid>:) or bootable ISO-9660 CD-ROM (INQUIRYtype0x05, LBA 17 Boot Record or LBA 16 PVDSYS/IFEPkernel ->CART<7+tid>:). - 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). - 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>:), kerneldpn/lba, and[default]tag, then promptsSelect SCSI target ID [0-6] (Enter = default ID <N>):(rejecting non-bootable IDs and booting the selected target with the matchingBOOT-FEP-KERNEL-DPNunit 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
- 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 mountsFEP7:/CART11:.
- Map code sections, resident data/state globals, stack/scratch buffers, and the shared overlay window starting at
- 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:.
- Console output (
- Catalog stable kernel entry points callable from overlays:
.flodOverlay Loader & Kernel UID Mechanics:- Verify exact binary layout of
"IFEP overlayH", the 64-bit Kernel Build UID (5c3931aef3e75a93for IFEP 328), section headers, relocation/fixup records (if any), and checksum algorithm. - Determine how IFEP resolves an unknown command name by scanning
.flodfiles in the FEPFS root directory (or explicitLoad Overlay), checking their embedded command directory tables, and swapping the matching overlay into0xF8001100.
- Verify exact binary layout of
- Command Directory Table & Registration:
- Document the exact record layout of every command descriptor inside a
.flodoverlay (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
.floddirectory entries.
- Document the exact record layout of every command descriptor inside a
3.2 Deliverable: Clean-Room .flod Overlay SDK & Demo Command
- Authored
prom/overlays/ifep328-sdk.lisp(IFEP 328 Kernel UID, residentFORMAT0xF8016448, default command handler0xF80130BA,:EXECUTEselector0xF900018C, Merlin-II PMAs) andprom/overlays/hello-overlay.lispusingivasm's:ifep-flodbackend and(def-ivory-string ...)macro. - Assembled
prom/build/custom-diag.flod(494 bytes), injected into a test FEPFS disk image viaivory-fep-convert --inject, registered withScan FEP7:>custom-diag.flod.1, and executedShow Emulator Infolive atFEP Command:insideivory-xl1200.
4. Verification & Acceptance Criteria (All Gates Passed)
| Gate | Command / Scenario | Verified Result |
|---|---|---|
| Gate 1A — PROM Container Validity | make -C prom all inspect | PASS — 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 Doc | docs/fep-internals-and-overlays.md | PASS — 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 Command | ivory-fep-convert --inject + Scan FEP7:>custom-diag.flod.1 + Show Emulator Info | PASS — 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:. |
- Signetics SCN68562 / SCN26562 —
signetics_1991_IC019_data_comm_SCN68562.pdf(mirror) - Western Digital WD33C93A —
wd_WD33C93A_datasheet_and_appnotes_1990.pdf(mirror) - Western Digital WD33C93A —
wd_WD33C93A_scsi_datasheet.pdf(mirror)