XL1200-EMU Symbolics XL1200 Emulator

Symbolics XL1200 IFEP 328/325 Internals & Dynamic Overlay (.flod) Guide

Architectural reference for the Symbolics XL1200 (Merlin-II / Ivory Rev 4/4A) Boot PROM handoff contract, .fep kernel container format, and .flod dynamic overlay ABI. Every register, address, bitfield, and protocol below was verified directly against authentic hardware execution on ivory-xl1200 and our portable Common Lisp assembler (tools/ivasm/).


1. Zone 31 Physical Memory Map & Handoff Contract

On cold power-on reset, emu/src/loader.c maps the Boot PROM (IFEP promJ, combined rom.dump or sequential 64 KiB split EPROM pair 115988 low + 115989 high) into Zone 31 (direct-mapped physical memory: VMA 0xF8000000 + offset -> PMA offset) and begins execution at the PROM's declared entry VMA (0xF8007162).

Before handing off control to the IFEP kernel (i328-kernel.fep on FEP7: SCSI disks or i325-bol.fep on CART11: ISO-9660 CD-ROMs), the Boot PROM establishes the following architectural state:

Address (VMA / PMA)Type / RegionRequired State Before Handoff
PMA 0x0A000000Merlin-II Diagnostic LEDsDiagnostic hex code (0x07 before handoff; IFEP transitions to 0x04 at FEP Command:)
PMA 0x0A000004Merlin-II Cache Control2 (L1/Merlin-II cache enabled)
PMA 0x4402C000Merlin-II Video Control2 (1bpp framebuffer BOW enabled, 1152x896, stride 64 words/row at PMA 0x48000000)
PMA 0x4401702FSignetics SCN68562 DUSCC CCRCh.B TX enabled (0x02) & RX enabled (0x42)
VMA 0xF8040940*BOOT-SPY-BLOCK-ADDRESS*Boot spy block base pointer stored at 0xFFFE0007 (DTP-LOCATIVE)
VMA 0xF804096E..6FBoot flagsDTP-FIXNUM 0
VMA 0xF8040970CRASH-ACTIONDTP-FIXNUM 2
VMA 0xF8040971..74, 76..78Boot spy string/option slotsDTP-NIL 0xF8041200
VMA 0xF8040975BOOT-FEP-KERNEL-DPNDTP-FIXNUM ((unit << 27) | dpn) — unit=7 (0x38000000 | fep_dpn) for FEP7: SCSI Target 0; unit=11 (0x58000000 | lba) for CART11: SCSI Target 4 CD-ROM
VMA 0xF8041000FEP-COMMUNICATION-AREA + 0IFEP version (DTP-FIXNUM 328 or 325), patched by .fep Page 0
VMA 0xF8041002FEP-COMMUNICATION-AREA + 2(FUNCTION FEP-STARTUP) (DTP-COMPILED-FUNCTION), patched by .fep Page 0
VMA 0xFFFE0000..0ABOOT-COMMUNICATION-AREAStandard Ivory/Merlin boot comm words (+0=NIL, +1=0x209, +2=0xF8000000, +3=0xC00, +4=EVEN-PC 0xFFFE0010, +7=LOCATIVE 0xF8040940, +A=330)

Kernel Invocation Sequence

Once .fep Page 0 descriptors (both page extents and inline FEP-COMMUNICATION-AREA patches) are applied and the 32-bit ones-complement checksum matches Page 0 word 5, the Boot PROM transfers control via standard Ivory call transfer:

(gvar-get #xF8041002)     ; raw-read (FUNCTION FEP-STARTUP) (DTP-COMPILED-FUNCTION)
(start-call (sp-pop))     ; open call frame for FEP-STARTUP
(finish-call-n :effect 0) ; invoke with 0 Lisp arguments

2. .fep Kernel Container Format (1,280-Byte Pages)

Both i328-kernel.fep (193 pages, 247,040 bytes) and i325-bol.fep (305 pages, 390,400 bytes) share the exact same 1,280-byte page format:

  • Page geometry: 1,280 bytes = 64 × 20-byte chunks = 256 × 40-bit Ivory words.
  • 20-byte chunk layout (tag-first):
    • bytes[0..3]: 4 × 8-bit tag bytes [tag0, tag1, tag2, tag3] where tag = (cdr_code << 6) | dtp.
    • bytes[4..19]: 4 × 32-bit little-endian data payload words [data0, data1, data2, data3].
  • Page 0 header words:
    • w[0]: Magic data 0x00410040 (stored with header tag 0x48).
    • w[1]: Descriptor count N (typically 5; note its stored header tag is 0x49 = DTP-SMALL-RATIO, so Ivory guest loaders must coerce with (set-tag (imm 8)) before fixnum arithmetic).
    • w[4]: Build identifier.
    • w[5]: 32-bit ones-complement (end-around-carry) sum of all 32-bit little-endian words across pages 1 .. total_pages - 1.
    • w[7]: Build digest / UID word.
  • Page 0 descriptors (d = 0 .. N-1, starting at w[8 + 3*d]):
    • target_vma = w[8 + 3*d]
    • spec = w[9 + 3*d]
    • source = w[10 + 3*d] (full 40-bit Ivory word)
    • If bit 24 of spec is 0: load spec words (spec / 256 pages) sequentially from the .fep stream starting at file page source into target_vma, accumulating all raw 32-bit words into the ones-complement checksum.
    • If bit 24 of spec is 1 (e.g., spec = 0x01000001): inline single-word patch — write the full 40-bit source word (including its exact tag and CDR bits) directly into target_vma (this is how 0xF8041000 version and 0xF8041002 (FUNCTION FEP-STARTUP) are installed).

3. Storage Media Boot Layouts

3.1 FEPFS SCSI Disk (FEP7:, Target 0, 1,280-Byte Sectors)

  • Block 0 (LABL): 1,280-byte raw disk label.
    • w[0] == 0x4C41424C ("LABL" in little-endian bytes 4C 42 41 4C).
    • w[53] (fep_dpn): physical block number of the kernel's FEPF file header block (not raw .fep Page 0).
  • FEPF file header block:
    • w[0] == 0x46455046 ("FEPF").
    • w[51..319]: extent descriptor list (terminated by 0). Each entry packs (count << 25) | (indirect << 24) | dpn:
      • When indirect == 0: contiguous run of count blocks starting at dpn.
      • When indirect == 1: dpn points to a FEPP (0x46455050) indirect extent block whose words w[1..319] list child extents.

3.2 ISO-9660 CD-ROM (CART11:, Target 4, 2,048-Byte Sectors)

  • Fast Path — ISO-9660 Boot Record (LBA 17):
    • byte[0] == 0x00 (Boot Record Volume Descriptor), bytes[1..5] == "CD001", byte[6] == 0x01.
    • bytes[72..75] (32-bit LE): starting 2,048-byte LBA of the bootable .fep kernel (e.g., SYS/IFEP/I325_BOL.FEP;11 on Genera 8.3 distribution media).
  • Fallback Path — Primary Volume Descriptor (LBA 16):
    • byte[0] == 0x01, bytes[1..5] == "CD001", Root Directory Extent LBA at bytes[158..161] LE.
    • Walks SYS -> IFEP -> I325_BOL.FEP (or I328_KERNEL.FEP), matching case-insensitively and stripping ;version suffixes.
  • 2,048-Byte to 1,280-Byte Reblocking:
    • Since 2048 = 512 * 4 and 1280 = 320 * 4, word-aligned 32-bit reblocking seamlessly spans 20-byte .fep chunks crossing 2,048-byte sector boundaries.

4. IFEP 328 Dynamic Overlay (.flod) Binary Format

Dynamic FEP commands (such as i328-info.flod, i328-loaders.flod, and user-built overlays like prom/build/custom-diag.flod) use the "IFEP overlayH" container format:

Offset  Size   Field
0       13     ASCII magic: "IFEP overlayH"
13      1      Format version (1)
14      2      Header pad bytes (0x00, 0x00)
16      8      Kernel Build UID (8 bytes; for IFEP 328: 5c 39 31 ae f3 e7 5a 93)
24      var    Command directory entries (repeated until name_len == 0):
                 u8   name_len
                 char name[name_len]     (e.g. "Show Emulator Info")
                 u8   doc_len
                 char doc[doc_len]       (one-line command help text)
                 u32  entry_vma (LE)     (VMA of command compiled-function entry)
        1      0x00 directory terminator
        var    Checksummed Ivory word sections (same framing as IFEP prom):
                 u32  vma_base (LE)      (typically 0xF8001100)
                 u32  word_count (LE)
                 u8   payload[word_count * 5]  (5 bytes LE per 40-bit word: data[0..3], tag)
                 u32  checksum (LE)      (wrapping u32 sum of payload bytes)
        8      End-of-sections sentinel: 0xFFFFFFFF, 0xFFFFFFFF
  • Kernel UID matching: IFEP refuses to load an overlay whose 8-byte Kernel Build UID does not match the running kernel (5c3931aef3e75a93 for IFEP 328).
  • On-demand loading: Scan FEP7:><name>.flod.<ver> parses only the command directory and registers each command's name, documentation, and entry VMA. When the user invokes a command at FEP Command:, IFEP loads the overlay's sections into the overlay window (0xF8001100) and invokes entry_vma.

5. IFEP 328 Resident ABI for Custom .flod Commands

The following resident addresses are defined as symbolic constants in prom/overlays/ifep328-sdk.lisp:

ConstantVMA / PMARole
IFEP328-OVERLAY-BASE0xF8001100Standard overlay code/data load base
IFEP328-SYM-EXECUTE0xF900018C:EXECUTE message selector passed in FP+2
IFEP328-FN-DEFAULT-CMD0xF80130BADefault command handler cell (handles :PARSE-ARGUMENTS, :DOCUMENTATION, etc.)
IFEP328-FN-FORMAT0xF8016448Resident FORMAT indirect function cell
IFEP328-FN-CHECK-NO-ARGS0xF80157F5Resident zero-argument validator cell
IFEP328-FN-STRING-LENGTH0xF8015C68Resident string length helper (accepts both DTP-STRING and DTP-STRING-INSTANCE)
IFEP328-VAR-TERMINAL-IO0xF800C088*terminal-io* stream cell
IFEP328-VAR-STRING-POOL0xF800C099Active overlay compressed-string Huffman pool pointer
IFEP328-VAR-BOOT-DPN0xF8040975BOOT-FEP-KERNEL-DPN ((unit << 27) | dpn)
IFEP328-VAR-KERNEL-VERSION0xF8041000Resident IFEP kernel version (DTP-FIXNUM 328)

5.1 Command Entry & Message Dispatch Protocol

Every .flod command entry point is a compiled function preceded by a 2-word Ivory compiled-function header:

  (word :cdr :next :dtp :header-i :data #x00040000)
  (word :cdr :nil  :dtp :compiled-function :data my-cmd)
(:label my-cmd)
  (:word :cdr :jump :even (entry-rest-accepted 3) :odd (car (fp 3)))
  (:word :cdr :jump :even (zerop (imm 1)) :odd (no-op)) ; entry+1: push NIL for empty &rest in LP+0

Critical Ivory entry-rest-accepted invariant: When invoked with 0 &rest arguments (nargs == max), Ivory advances to entry + 1 so the callee initializes LP+0 to NIL. When invoked with >= 1 &rest arguments (or via APPLY), Ivory packages the &rest list into LP+0 and jumps directly to entry + 2. Always place the 1-word push NIL ((zerop (imm 1))) at entry + 1.

At entry + 2:

  1. FP+2 holds the operation selector symbol; LP+0 holds the &rest argument list.
  2. Compare FP+2 (EQ) against IFEP328-SYM-EXECUTE (0xF900018C):
    • If not equal: delegate metadata/parsing queries cleanly by tail-calling IFEP328-FN-DEFAULT-CMD:
      (call-indirect IFEP328-FN-DEFAULT-CMD)
      (push (fp 2))
      (push (lp 0))
      (finish-call-n-apply (imm #x203)) ; :return disposition, apply 2 args
      
    • If equal: run the command body, call FORMAT (IFEP328-FN-FORMAT) for console output, and return NIL via (return-single :constant-nil).

5.2 Uncompressed DTP-STRING Output via Resident FORMAT

Although stock Symbolics overlays use Huffman-compressed DTP-STRING-INSTANCE (0o23) tokens, IFEP 328's resident FORMAT (0xF8016448) and STRING-LENGTH (0xF8015C68) natively accept standard uncompressed Ivory 8-bit DTP-STRING (0o27) objects embedded directly in the overlay:

  • Header word: (word :cdr :nil :dtp :header-i :data (logior #x50000000 len)) (header_type=ARRAY, element_type=CHARACTER(1), byte_packing=8-bit(2), short_length=len).
  • Payload words: ceil(len / 4) × (word :cdr :nil :dtp :fixnum :data <4 LE ASCII bytes>).
  • Generated automatically by (def-ivory-string label "format ~D~%") in tools/ivasm/.

6. Building, Injecting & Running a Custom .flod Overlay

# 1. Assemble both the clean-room Boot PROM and the sample diagnostic overlay
make -C prom all inspect

# 2. Copy a bootable XL1200 FEPFS disk image (never modify your master image in place)
cp --reflink=auto emu/disks/xl1200_clean_fep0.raw /tmp/test_overlay.raw

# 3. Inject custom-diag.flod into the FEPFS disk directory (updates DIRB, FEPF, FEPB)
./emu/build/ivory-fep-convert --inject /tmp/test_overlay.raw \
    prom/build/custom-diag.flod CUSTOM-DIAG FLOD 1

# 4. Boot with the clean-room Boot PROM and run the custom command at FEP Command:
./emu/build/ivory-xl1200 --rom prom/build/custom-rom.dump --disk /tmp/test_overlay.raw
# At "FEP Command:", type:
#   Scan FEP7:>custom-diag.flod.1
#   Show Emulator Info
Related Chip Datasheets (1)All Component Datasheets →