NOTE
Historical document. Planning/test artifact from the removed Rust prototype (crates/xl1200-emu). Paths, cargo commands and the 1 GB test_1gb.sh rule no longer apply; the current emulator is the C11 tree in emu/ (make -C emu test, make -C emu test-e2e).
Project: Ivory Emulator (xl1200-emu) — Phases 1 & 2 Implementation
Architecture
- Boot Pipeline Subsystem (
cpu.rs,subprimitives/frame.rs,rom.rs):- Authentic reset vector resolution:
Address::BOOT_ROM_START + target_idxwithout double-adding PROM word count. - Elimination of synthetic PC overrides (
0x0000_C010) to ensure genuine hardware reset vector execution from0o777400100. - Harmonization of coprocessor reset vector dispatch across both
--ux1200(solstice-device.prom, 18,464 words) and--macivory(Device-PROM, 17,120 words). - Alpha VLM ground-truth alignment for
StartCallonDataType::Symbol: when symbol function cell is uninitialized/null, dispatchstart-call-escapetrap vector instead of fatal emulator crash.
- Authentic reset vector resolution:
- Storage & DiskChannel Subsystem (
life_support/disk.rs,life_support/comm_area.rs,main.rs):- Authentic 1280-byte Ivory page size (
WORDS_PER_PAGE_32 = 320for 32-bit untagged buffered transfers,WORDS_PER_PAGE_40 = 256for 40-bit tagged transfers). - Multi-DAP scatter-gather support in
EmbDiskQueueElement: iterate over all buffer address pairs (0..n_addresses) and transfer up to 16 DAPs per command. - Handshake signal completion: assert
DiskSignal(bit 4,0x0000_0010) inHOST_TO_GUEST_SIGNALS(slot::HOST_TO_GUEST_SIGNALS/0o001011014) upon disk transaction completion. - Partition base offset support: automatic discrimination of Apple Partition Map (APM) partition 6
FEP0(0x87d4bb00/0x87d4c000) onMacIvory_Virginal_9GB.img, and byte 1024 on raw partition slices (macivory_fep0.raw). - Streaming
FileBlockDeviceI/O: on-demandseekandread_exactwithout loading entire disk images into memory, strictly adhering to the 1GB host address space ceiling.
- Authentic 1280-byte Ivory page size (
- Overlay & World Loading Subsystem (
life_support/cold_load.rs,fepfs, Genera entry):- FEP filesystem directory traversal (
FEPDat DPN 65) via authentic guest execution andDiskChannel. - Dynamic loading and execution of
.flodoverlays (I328-LOADERS.FLOD) exposingLoad World(entry0o37000024304) andStart(entry0o37000015335). .ilodworld image parsing and population of guest memory and Page Hash Table (PHT) wired pages using authentic 20-byte/4-word packing.- Cold boot transition into Genera execution via
Start.
- FEP filesystem directory traversal (
- Integrity, Testability & Containment:
- Strict compliance with
AGENTS.md § 6: zero synthetic guest code, zero mock string emitters, zero fake bootloaders in platform verification. - All tests must pass under
nix develop --command ./scripts/test_1gb.sh(prlimit --as=1GB).
- Strict compliance with
Feature Inventory
| # | Feature | Description | Milestone | Source |
|---|---|---|---|---|
| 1 | Remove Reset Vector Double-Offset Bug | Fix cpu.rs:138-142 to set target_addr = Address::BOOT_ROM_START + target_idx without double-adding bus.rom.word_count() | M1 | ORIGINAL_REQUEST R1 |
| 2 | Eliminate Synthetic PC Overrides | Remove synthetic override at cpu.rs:116-120 (Address(0x0000_C010)) to enforce authentic reset from 0o777400100 | M1 | ORIGINAL_REQUEST R1 |
| 3 | Harmonize UX1200 & MacIvory Boot Pipeline | Harmonize PROM entry alignment and kernel loading so both --ux1200 and --macivory advance cleanly into FEP command loop | M1 | ORIGINAL_REQUEST R1 |
| 4 | Alpha VLM StartCall Symbol Trap | In FrameSubprimitives::start_call, handle uninitialized Symbol function cell via start-call-escape trap instead of fatal abort | M1 | explorer_survey_1 |
| 5 | Update Obsolete Test Assertions | Update tests in ux1200_terminal_streaming_tests.rs and ux1200_m3_flow_signal_challenger_tests.rs to assert clean stepping instead of cycle 20 halt | M1 | explorer_survey_1 |
| 6 | Authentic 1280-Byte Disk Page Sizing | Update disk.rs to calculate page * 1280 (320 * 4 bytes untagged buffered, 256 * 5 bytes tagged) | M2 | ORIGINAL_REQUEST R2 |
| 7 | Multi-DAP Scatter-Gather Transfers | Iterate through all buffer address pairs (0..n_addresses) in EmbDiskQueueElement and transfer up to 16 DAPs | M2 | ORIGINAL_REQUEST R2 |
| 8 | DiskSignal Completion Handshake | Assert DiskSignal (bit 4, 0x0000_0010) in HOST_TO_GUEST_SIGNALS upon disk transaction completion | M2 | ORIGINAL_REQUEST R2 |
| 9 | APM & Raw Partition Offset Support | Support partition base offset 0x87d4bb00 / 0x87d4c000 for MacIvory_Virginal_9GB.img and byte 1024 for macivory_fep0.raw | M2 | ORIGINAL_REQUEST R2 |
| 10 | Streaming FileBlockDevice under 1GB Ceiling | Replace whole-file std::fs::read in main.rs with streaming on-demand file block device | M2 | ORIGINAL_REQUEST R2 |
| 11 | FEP0 Directory Traversal via DiskChannel | Guest FEP reads DPN 65 root directory and authentic file extents via DiskChannel | M3 | ORIGINAL_REQUEST R3 |
| 12 | Dynamic .flod Overlay Loading | Dynamically load I328-LOADERS.FLOD into Zone 31 RAM and register authentic commands (Load World, Start) | M3 | ORIGINAL_REQUEST R3 |
| 13 | World Loading (.ilod) & PHT Population | Parse .ilod 20-byte/4-word packing, populate wired memory and PHT entries | M3 | ORIGINAL_REQUEST R3 |
| 14 | Genera Start Transition | Execute Start command to initialize Ivory registers and transition into Genera cold-boot vector | M3 | ORIGINAL_REQUEST R3 |
| 15 | 100% E2E Test Suite Pass under 1GB | Pass 100% of unit, integration, and E2E tests under ./scripts/test_1gb.sh (prlimit --as=1GB) | M4 | ORIGINAL_REQUEST R4 |
| 16 | Anti-Cheating Forensic Verification | Verify zero synthetic instructions, zero mock prompt emitters, pure authentic execution | M4 | ORIGINAL_REQUEST R4 |
| 17 | Adversarial Coverage Hardening | White-box adversarial testing verifying edge cases in disk boundaries, memory limits, and traps | M4 | Project Pattern Phase 2 |
Milestones
| # | Name | Scope | Dependencies | Status |
|---|---|---|---|---|
| M1 | UX1200 & MacIvory Boot Pipeline Stabilization | Features 1–5: double-offset fix, synthetic override removal, boot harmonization, symbol trap, test assertion updates | none | DONE |
| M2 | Authentic 1280-Byte DiskChannel & Partition Mounting | Features 6–10: 1280B page sizing, multi-DAP scatter-gather, DiskSignal handshake, APM offset, streaming FileBlockDevice | none | PLANNED |
| M3 | FEP Overlay Loading (.flod) & World Loading (.ilod) | Features 11–14: FEP0 directory read, I328-LOADERS.FLOD execution, .ilod parsing, Genera Start transition | M1, M2 | PLANNED |
| M4 | Final Milestone: 100% E2E Pass & Adversarial Hardening | Features 15–17: test_1gb.sh pass, forensic anti-cheating audit, adversarial coverage hardening | M1, M2, M3 | PLANNED |
Interface Contracts
crates/xl1200-emu/src/cpu.rs ↔ ROM / Hardware Bus
- Reset vector contract:
target_addr = Address::BOOT_ROM_START + target_idxwheretarget_idx = raw_data & 0x7_FFFF.- No synthetic PC overrides. PC initialized to
Pc::new(Address::BOOT_ROM_START + 0o100, Phase::Even).
crates/xl1200-emu/src/subprimitives/frame.rs ↔ cpu.rs
FrameSubprimitives::start_call:- When target is
DataType::SymbolwithDataType::Nullfunction cell, triggerstart-call-escapevia trap vector dispatch (Address(0o37000000000 | 0x00)) matching Alpha VLMfcallmac.lisp:114-155.
- When target is
crates/xl1200-emu/src/life_support/disk.rs ↔ Guest Ivory CPU
- Logical page size:
FEP_PAGE_BYTES = 1280(WORDS_PER_PAGE_32 = 320for untagged,WORDS_PER_PAGE_40 = 256for tagged). - Byte offset calculation:
byte_offset = self.base_offset + (cmd.page as u64 * 1280). - Scatter-gather: iterate over
0..n_addresses, transferringn_wordsper address pair. - Completion signaling: assert
comm_area::signal::DiskSignal (0x0000_0010)inslot::HOST_TO_GUEST_SIGNALS(0o001011014).
Code Layout
crates/xl1200-emu/src/cpu.rs: Hardware reset vector resolution, execution loop, trap dispatch.crates/xl1200-emu/src/subprimitives/frame.rs: Function calling,StartCall,FinishCall, symbol trap dispatch.crates/xl1200-emu/src/life_support/disk.rs: Authentic 1280-byteDiskChannel, multi-DAP scatter-gather,DiskSignalhandshake, partition offset.crates/xl1200-emu/src/life_support/comm_area.rs: Shared memory communication area slots and signals.crates/xl1200-emu/src/main.rs: CLI flags, streamingFileBlockDeviceinitialization,--debugger-on-haltintegration.crates/xl1200-emu/tests/: Boot pipeline tests, DiskChannel tests, autoboot & world load tests, anti-cheating audit.