Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ hashes are given where a change is easiest to understand by reading the commit.
cursor position fields are 12-bit signed; they were read as unsigned, so a
cursor partly off the edge was drawn 4000 pixels away. (`src/dev/o2gfx.rs`)

### SCSI

- Every SCSI controller attaches its targets through one shared bus, and
disks report one emulated identity on every machine. The O2 and Octane now
say `IRIS EMUL DISK` and `IRIS EMUL CDROM` in INQUIRY; the Indy and Indigo2
keep their Sony CD-ROM.
- A disc change loads a CHD CD as well as an ISO, and the O2, the Octane and
the Indigo2's second controller fold pending CHD diffs on a clean exit as the
first controller always did.

### Host efficiency on small machines

- **Threads that have nothing to do now sleep in milliseconds, not
Expand Down
33 changes: 23 additions & 10 deletions HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,29 @@ reach the machine through one shared `MachineSlot` per machine, which the
machine's `Drop` nulls, so a holder that outlives the machine (the monitor,
after iris-gui's Stop) gets "machine is not running" instead of freed memory.

SCSI storage follows the same pattern one level down. `src/scsi.rs` is the
target (disk, CD-ROM, DaynaPort) any controller can hold, and
`src/scsi_monitor.rs` implements the monitor's `scsi` and `cow` subcommands and
the run-time disc changes once, over a controller's target table lent through
its `ScsiTargets` trait. The WD33C93A (Indy, Indigo2) and the Adaptec 7880 (O2)
lend theirs and keep only chip-specific subcommands (`regs`; the WD's `wdt`,
`defer`, `debug`), and `DiscChanger` is implemented once for every
`ScsiTargets`. Configuration is shared the same way: both machines attach
their devices from the `[scsi.N]` tables, where the key is a slot
(controller × 16 + id, see `config::scsi_slot`).
SCSI storage follows the same pattern one level down. `ScsiTarget` is what
varies on a bus (a `ScsiDevice` disk or CD-ROM, a `DaynaPort`): `request`,
the lifecycle, and optional behaviour with do-nothing defaults (a
copy-on-write layer, CHD sync, a disc changer), so callers ask for behaviour
and never for a type. `ScsiBus` (`src/scsi/bus.rs`) is the mechanism: the
id-to-target table with attach, request and overlay export and import, and
the controller's INQUIRY identities. A disk or CD-ROM sits on a `BlockNode`
(`src/block_node.rs`), built by `open_image` for everything that mounts an
image. A CD-ROM's node is a `ChangerNode`: the queue of discs and the open
active one, with the `Removable` trait (present, changed, eject, load)
separate from `BlockNode` so that removable media which is not a block device,
a tape, can use it too. The WD33C93A (Indy, Indigo2), the Adaptec
7880 (O2) and the ISP1040 (Octane) each make an empty bus of their own kind
(`new_bus`); the machine fills it from config and gives it to the controller's
constructor, so a controller exists with its targets and keeps only its
registers and DMA. `src/scsi_monitor.rs` implements the monitor's `scsi` and `cow`
subcommands and the run-time disc changes once, over the bus a controller hands
out through `ScsiTargets::scsi_bus`; chip-specific subcommands (`regs`; the
WD's `wdt`, `defer`, `debug`) stay with the chip, and `DiscChanger` is
implemented once for every `ScsiTargets`. Configuration is shared the same
way: `scsi::attach_from_config` walks the `[scsi.N]` tables for every machine,
where the key is a slot (controller × 16 + id, see `config::scsi_slot`), and
the machine supplies only a route from controller number to bus.

## 2. Data path and endianness

Expand Down
Loading
Loading