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
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,38 @@ hashes are given where a change is easiest to understand by reading the commit.
programs through their prescaler, including the half steps MIDI's 31250
needs.

### Ethernet

- The Ethernet's host end and MAC are a `net` device at `ethernet`, on every
machine: `backend` is `nat`, `pcap:IFACE`, `stream:tcp:IP:PORT` or
`stream:unix:PATH`, and a port with no entry is NAT. `type = "none"` at
`ethernet` unplugs it, and the port then has the machine's own MAC.
`[network]`'s `mode`, `pcap_interface`, `stream` and `mac` are read with a
warning and saved as the entry, as are the `--net-mode` and
`--pcap-interface` flags, which replace the file's entry. An older key that
is not its default, beside an entry at the port, is an error. `tftp_dir`,
`rsh_dir`, `rx_hold` and `nfs_pcap_ip` stay.

### Audio

- A sound chip's host output is an `audio` device at its `audio` port (an
ICE1724 card's is `CARD/audio`): `backend` is `default`, `pulse`, `wasapi`,
`coreaudio`, `null` or `file:PATH`, with `prebuf_ms`, `latency_ms` and
`channels`. A port with no entry plays to the host; `type = "none"` keeps the
chip and drops its sound. The `[audio]` table is read with a warning and saved
as the entry (an error beside one at the port), as is `--audio-host`, which
replaces the file's entry.
- A serial `midi_synth` plays where its own `backend` says (the same values),
not where the machine's sound goes, so it works on machines with no sound
port. `[audio] host` and `file` no longer reach it.

### IndyCam

- The camera is a `camera` device at the Indy's `video` input: `backend` is
`webcam:N`, `test_pattern` or `black`, and `standard` is `ntsc` or `pal`. No
entry, no camera, as before. The `[vino]` table is read with a warning and
saved as the entry; beside an entry at the port it is an error.

- The host camera works with cameras that offer only MJPEG, NV12, RGB or gray
at a usable size, such as high-resolution laptop webcams on Windows
(techomancer/iris#70), and on Linux with cameras that have no YUYV mode.
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ jitv2_smc_check = ["jitv2"]
# as Npcap. IRIS links dynamically and never bundles the driver,
# so the runtime driver's license does not attach to IRIS.
# Off by default — enable with `cargo build --features pcap`. Select at runtime
# with `[network] mode = "pcap"` in iris.toml.
# with a `net` device with `backend = "pcap"` in iris.toml.
pcap = ["dep:pcap"]
# Host services for IRIX programs, reached through the private system calls
# 3000-3009 (iris-hostcall/): the trap in `exec_syscall` and the self-test
Expand Down
50 changes: 14 additions & 36 deletions FEATURES.md

Large diffs are not rendered by default.

46 changes: 26 additions & 20 deletions HELP.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,15 @@ Indigo2 keeps it in a serial EEPROM. A fresh or blank `nvram.bin` has no
address, which prevents networking from working.

**You usually don't have to do anything.** Before boot, IRIS writes a MAC into
a blank `eaddr` slot: `[network] mac` from `iris.toml` if you set one, otherwise
a blank `eaddr` slot: the `mac` of the `net` device from `iris.toml` if you set one, otherwise
`08:00:69:12:34:56`. It never overwrites an address that is already there.
iris-gui does the same and offers a guided prompt. Set one yourself when you run
more than one emulated machine on the same network:

```toml
[network]
[[devices]]
type = "net"
at = "ethernet"
mac = "08:00:69:de:ad:01"
```

Expand Down Expand Up @@ -596,14 +598,15 @@ type = "midi_synth"
at = "serial1" # the Tezro's first DB9
path = "GeneralUser-GS.sf2"
gain = 2.0 # optional
backend = "null" # optional: default, pulse, wasapi, coreaudio, null or file:PATH
```

`gain` sets how loud the synth plays (`gain = 2.0` is twice as loud). The
default is the synth's own level, which leaves room for a whole General MIDI
song: a single line of notes sounds quiet at it, and a loud song with a high
gain clips. The synth plays as an output stream of its own, beside the
machine's sound; when `[audio] file` records the machine to a WAV, the synth
writes its own file beside it (`out.wav` and `out-midi.wav`). It plays
machine's sound, and its `backend` is its own: the machine's `audio` entry does not touch it. With a
`file:` backend it writes a WAV beside the name given (`out.wav` and `out-midi.wav`). It plays
channel messages and resets on GM System On, GS Reset and System Reset; it
sends nothing back. `no_audio` mutes it.

Expand Down Expand Up @@ -893,11 +896,14 @@ path = "cdrom4.iso"

# ── Networking ───────────────────────────────────────────────────────────────

# [[devices]] # the Ethernet's host end; none is NAT
# type = "net"
# at = "ethernet"
# backend = "nat" # or "pcap:1" (--features pcap) or "stream:tcp:IP:PORT"; type = "none" unplugs
# mac = "08:00:69:12:34:56" # ec0 MAC, injected into blank NVRAM before boot

[network]
mode = "nat" # or "pcap" (--features pcap), "stream" or "off"
# pcap_interface = "1" # index, name, or '\Device\NPF_{...}' on Windows
# nfs_pcap_ip = "192.168.1.250" # PCAP only: LAN IP the NFS server answers on
# mac = "08:00:69:12:34:56" # ec0 MAC, injected into blank NVRAM before boot
# tftp_dir = "tftpboot" # serve read-only over TFTP at the gateway
# rsh_dir = "shared" # `rsh <gateway> cat|ls|echo|pwd` on this dir, read-only

Expand All @@ -913,17 +919,19 @@ mode = "nat" # or "pcap" (--features pcap), "stream" or "off"

# ── Devices ──────────────────────────────────────────────────────────────────

[vino] # IndyCam video-in
source = "off" # "off" (default) | "test_pattern" | "black" | "camera"
standard = "ntsc" # or "pal"
camera_index = 0 # host camera, source = "camera" only

[audio]
# host = "default" # or "pulse", "wasapi", "coreaudio", "null" (discard)
prebuf_ms = 20 # sound held before playing: the margin against a late guest, and the latency added
# [[devices]] # the Indy's IndyCam; no entry, no camera
# type = "camera"
# at = "video"
# backend = "webcam:0" # host camera N, or "test_pattern" or "black"
# standard = "ntsc" # or "pal"

# [[devices]] # host sound; no entry plays to the host, type = "none" discards it
# type = "audio"
# at = "audio" # an ICE1724 card's is CARD/audio
# backend = "default" # or "pulse", "wasapi", "coreaudio", "null" (discard), "file:out.wav"
# prebuf_ms = 20 # sound held before playing: the margin against a late guest, and the latency added
# latency_ms = 20 # what the host's device buffers; unset: its low-latency default
# channels = 2 # speakers for the Tezro's multichannel card: 2, 4, 6 or 8
# file = "out.wav" # play into a WAV file instead of a sound card
# channels = 2 # speakers for the Tezro's multichannel card: 2, 4, 6 or 8

# Cards go in the same list. Left without `at`, a virtio device takes a spare slot the
# board has for it, and a PCI card the first real slot.
Expand Down Expand Up @@ -1108,12 +1116,10 @@ Display and audio
--keyboard <LAYOUT> Host keyboard: ansi (default), iso or jis
--headless No window; drops Newport (other boards stay fitted), O2 uses serial
--noaudio Disable sound device output (graphics unaffected)
--audio-host HOST Host audio: default, pulse, wasapi, coreaudio or null

Networking
--nat-subnet <CIDR> NAT subnet, e.g. 192.168.5.0/24
--net-mode <MODE> nat (default), pcap, stream or off
--pcap-interface <IFACE> Host interface to bridge onto (implies pcap)
--device net@ethernet,backend=B The Ethernet's host end: nat (default), pcap:IFACE, stream:tcp:IP:PORT; none@ethernet unplugs it
--list-net-interfaces Print bridgeable interfaces and exit
--nfs-dir <DIR> Export DIR over the in-process NFS server
--tftp-dir <DIR> Serve DIR read-only over TFTP at the gateway
Expand Down
36 changes: 19 additions & 17 deletions NETWORKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,19 @@ Debian/Ubuntu, or the macOS system libpcap).
cargo build --release --features pcap
```

2. **Configure** in `iris.toml` (or pass CLI flags):
2. **Configure** in `iris.toml` (or pass `--device`):
```toml
[network]
mode = "pcap"
pcap_interface = "1" # 1-based index (recommended), or exact name, or omit to auto-pick
[[devices]]
type = "net"
at = "ethernet"
backend = "pcap:1" # 1-based index (recommended), or exact name; "pcap" alone auto-picks
```

On Windows, if you prefer the full device name (`\Device\NPF_{GUID}`), use a
TOML *single-quoted* literal string (backslashes are escape characters in
`"double-quoted"` strings):
```toml
pcap_interface = '\Device\NPF_{8D30ACAE-AC0F-4E05-BF89-F35AD7950663}'
backend = 'pcap:\Device\NPF_{8D30ACAE-AC0F-4E05-BF89-F35AD7950663}'
```

3. **List interfaces**:
Expand All @@ -63,8 +64,8 @@ Debian/Ubuntu, or the macOS system libpcap).

Alternatively specify on the command line (the index form works here too):
```
./target/release/iris --net-mode pcap --pcap-interface 1
./target/release/iris --net-mode pcap --pcap-interface eth0
./target/release/iris --device net@ethernet,backend=pcap:1
./target/release/iris --device net@ethernet,backend=pcap:eth0
```

Caveats:
Expand All @@ -79,26 +80,27 @@ Caveats:
as a separate LAN host using `[network] nfs_pcap_ip` (see [HELP.md](HELP.md)).
- Wired bridges work best. Many Wi-Fi access points reject the guest's extra
MAC address, so bridging onto a wireless interface may not pass traffic.
- Give each emulated machine on the LAN a distinct `[network] mac`. Indy
- Give each emulated machine on the LAN a distinct `mac` on its `net` entry. Indy
and Indigo2 keep it in their NVRAM/EEPROM; newer platforms use their own
identity and address setup. See [Ethernet MAC address](HELP.md#ethernet-mac-address).

Without `--features pcap`, selecting `mode = "pcap"` logs a warning and falls
Without `--features pcap`, selecting `backend = "pcap"` logs a warning and falls
back to the NAT gateway, and `--list-net-interfaces` reports that the feature
is missing.


## Stream segment (`mode = "stream"`)
## Stream segment (`backend = "stream:..."`)

`[network] mode = "stream"` plugs the Ethernet into a private segment served
by another program, using the framing of QEMU's `-netdev stream`: each frame
is a 32-bit big-endian length and then the Ethernet frame, without FCS. iris
is the client and connects to `stream`:
A `net` entry with `backend = "stream:..."` plugs the Ethernet into a private
segment served by another program: each frame is a 32-bit big-endian length
and then the Ethernet frame, without FCS. iris is the client and connects to
the peer in the backend:

```toml
[network]
mode = "stream"
stream = "tcp:127.0.0.1:7000" # or "unix:/run/segment.sock"
[[devices]]
type = "net"
at = "ethernet"
backend = "stream:tcp:127.0.0.1:7000" # or "stream:unix:/run/segment.sock"
```

Anything that speaks that framing works as the peer, for example another
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ boots to a usable system: shell, networking, X11, the works.
binary); `prom` names a file to run instead
- Sound on every machine that has it (HAL2, the O2's MACE audio, RAD, ICE1724)
through the `iris-audio` crate: PulseAudio or PipeWire on Linux, WASAPI on
Windows, CoreAudio on macOS, or into a WAV file (`[audio] file`)
Windows, CoreAudio on macOS, or into a WAV file (an `audio` entry's `file:PATH`)
- Cranelift JIT compiler for MIPS to host code (`jitv2`, optional, experimental) with
persistent compiled-page cache, GPR register caching in loops, and faster FPU/inline paths;
plus a REX3 draw pipeline of 400+ precompiled specialised draw functions and an
Expand Down
4 changes: 2 additions & 2 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,14 @@ A sound card can break anywhere between guest memory and the host's
speakers, and a CI runner has no speakers. Two backends hear what a card
sends to the host:

- **`[audio] file`**: the card's host stream played into a WAV file in real
- **A `file:` audio backend**: the card's host stream played into a WAV file in real
time, silent where the card was late. It needs no sound card. It goes
through the stream's prebuffer and rate conversion (no clock following,
so 48 kHz is copied exactly), but cannot see the host's audio system, its
sound server or its mixer.
- **The real device** (Linux): the card plays into the host's default output
and the test records it back from a loopback. `IRIS_AUDIO_LOOPBACK` names
it as `<output host>:<capture source>`: the `[audio] host` the card plays
it as `<output host>:<capture source>`: the audio backend the card plays
through (`default` or `pulse`) and the PulseAudio source that hears the
default output, recorded with `parec`. With the variable unset these tests
print `SKIPPED: IRIS_AUDIO_LOOPBACK not set` and pass. With it set, a
Expand Down
2 changes: 1 addition & 1 deletion clanker/devices/audio-test-suite.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ to a file:
then the pairs, little-endian (`src/dev/audio_dump.rs`). It needs no host
sound device, but RAD1 and the ICE1724 record nothing under `no_audio`.
`check.py` measures each case at its records' rate.
- `[audio] file = "FILE"` writes a 48 kHz stereo 16-bit WAV of what the host
- An `audio` entry with `backend = "file:FILE"` writes a 48 kHz stereo 16-bit WAV of what the host
stream plays; `check.py` reads the rate from its header.

```sh
Expand Down
4 changes: 2 additions & 2 deletions clanker/devices/cpal-alsa-busy-poll.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# cpal's ALSA backend can spin a core: `[audio] host = "pulseaudio"`
# cpal's ALSA backend can spin a core: `backend = "pulse"` on the audio device avoids it

**Status: history (2026-11-13).** cpal is gone: every sound device plays
through the `iris-audio` crate, whose Linux backend is the PulseAudio
Expand All @@ -19,7 +19,7 @@ loops, about five million times a second. Seen through PipeWire's ALSA plugin
with the same period and buffer sizes sleeps normally, so it is cpal's loop,
not the driver. Not reproduced yet on bare metal; it may need the VM's timing.

**Workaround.** `[audio] host = "pulseaudio"` (or `--audio-host pulseaudio`):
**Workaround.** an `audio` device with `backend = "pulse"` (or `--device audio@audio,backend=pulse`):
cpal's own PulseAudio client (pure Rust, the `pulseaudio` feature) talks to a
PulseAudio server or PipeWire's pipewire-pulse over the socket. The same
stream used 0.01 s of CPU in 5 s. The default stays ALSA until the bug is
Expand Down
8 changes: 4 additions & 4 deletions clanker/devices/host-audio-is-iris-audio.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ capture_var) -> Option<iris_audio::Output>`. A device then calls
`out.set_rate()` when the guest reprograms its clock and `out.write(&[i16])`
with whole frames. Everything else is the library's, on the far side of its
ring: rate conversion, following the guest's clock (it bends the ratio by up
to 0.5%), the prebuffer (`[audio] prebuf_ms`), following the host's default
to 0.5%), the prebuffer (the `audio` entry's `prebuf_ms`), following the host's default
device, and running with no device (`null_fallback` is always set, so an
open never needs a retry).

Expand All @@ -19,11 +19,11 @@ Rules that follow:
prebuffer and the cards' once-a-second reopen were removed for this.
- **What reaches a sound card or the null host is never sample-exact**, even
at equal rates: the clock follower always runs the frames through the
rate converter. `[audio] file` turns the follower off (`max_adjust` 0), so
rate converter. A `file:` audio backend turns the follower off (`max_adjust` 0), so
a card at 48 kHz is recorded exactly and others at a fixed ratio; a guest
clock off the host's then underruns or skips instead. Tests that need the
card's exact frames read a tap (`Sink::tap`, `PcmOut::tap`), a detached
stream (`host_audio::test_signal::detached`) or an `[audio] file`.
stream (`host_audio::test_signal::detached`) or an `audio` entry with a `file:` backend.
- **Underruns are counted in times, not samples** (`Output::stats()`), and
only while the device has not called `idle()`. Only HAL2 calls `idle()`
(codec A disarmed).
Expand All @@ -36,7 +36,7 @@ Rules that follow:
prebuffer and clock follower, and a file or capture hears the mix. Voices
are not sample-aligned with one another, which is why the ICE1724 still
sums its analog and S/PDIF engines itself.
- **The ICE1724 folds to `[audio] channels`** (default 2) itself with its
- **The ICE1724 folds to the `audio` entry's `channels`** (default 2) itself with its
BS.775 matrix. The library cannot report how many speakers the host has
(the Pulse backend opens whatever width is asked and lets the server mix),
and its own fold of 8 slots to stereo divides the level by four.
Expand Down
17 changes: 10 additions & 7 deletions clanker/irix/irix-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ Launch with `--config <file> --ci --ci-display`.
> iris-ci stays reachable while iris draws the Newport window
> miniroot needs to see.

The disk goes at SCSI 1, CD (or CD changer) at SCSI 4. `[vino]
source = "camera"` is fine for the install.
The disk goes at SCSI 1, CD (or CD changer) at SCSI 4. A `camera` device is fine for the install.

**6.5.22:** CD changer on SCSI 4 with Overlay 1 active and the rest
in cycle order:
Expand Down Expand Up @@ -128,8 +127,10 @@ discs = [
"irix/IRIX 6.5 Foundation 2.iso",
]

[vino]
source = "camera"
[[devices]]
type = "camera"
at = "video"
backend = "webcam:0"

[[port_forward]]
proto = "tcp"; host_port = 2323; guest_port = 23; bind = "localhost"
Expand Down Expand Up @@ -176,8 +177,10 @@ discs = [
"irix53/Developers Toolbox 6.0 Disc 3.iso",
]

[vino]
source = "camera"
[[devices]]
type = "camera"
at = "video"
backend = "webcam:0"

[[port_forward]]
proto = "tcp"; host_port = 2323; guest_port = 23; bind = "localhost"
Expand Down Expand Up @@ -286,7 +289,7 @@ ic serial-wait --timeout 60 "Option?"

ic serial-send "5" # Command Monitor
ic serial-wait --timeout 10 ">> " # PROM monitor prompt
ic serial-send "setenv -f eaddr 08:00:69:de:ad:01" # optional: IRIS injects [network] mac
ic serial-send "setenv -f eaddr 08:00:69:de:ad:01" # optional: IRIS injects the net device's mac
# (default 08:00:69:12:34:56) into a blank slot
ic serial-wait --timeout 10 ">> "
ic serial-send "setenv -f SystemPartition scsi(0)disk(1)rdisk(0)partition(8)"
Expand Down
2 changes: 1 addition & 1 deletion clanker/irix/midi-on-a-serial-port.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ Status: howto, 2026-11-26 (Tezro, IRIX 6.5).
`mdOpenOutPort(name)`, `mdSetStampMode(p, MD_NOSTAMP)` to send at once, and
`mdSend(p, &ev, 1)` with `ev.msg[0..2]` = status, data1, data2.
- Check the host end with the monitor's `serial`: the `midi_synth` line counts
messages and notes. With `[audio] host = "null"`, `IRIS_MIDI_CAPTURE=x.wav`
messages and notes. With `backend = "null"` on the `midi_synth`, `IRIS_MIDI_CAPTURE=x.wav`
still records the synth, so a test needs no speakers.
- IRIX `grep` has no `\|`: use `egrep 'a|b'`.
Loading