Skip to content
Draft
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
1 change: 1 addition & 0 deletions clanker/INDEX.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ Non-graphics devices: MC/MEMCFG and RAM banks, HPC3, VDMA, EEPROMs and NVRAM, PS
| [ip30-linux-7.3-guest.md](devices/ip30-linux-7.3-guest.md) | howto | Octane: mainline Linux 7.3 config, the PROM/Linux PCI window mismatch and the root-bus scan past device 7 (kernel patch), TFTP or volume-header boot, no power-off |
| [ip30-device-timing-on-hptimer.md](devices/ip30-device-timing-on-hptimer.md) | design | Octane: IOC3, RAD1 and ISP1040 pace themselves on `hptimer` one-shots, with threads only where something blocks (the ISP1040 ring, serial receive, NVRAM writer) |
| [ip30-openbsd-needs-64gb-window-and-slot-4-empty.md](devices/ip30-openbsd-needs-64gb-window-and-slot-4-empty.md) | rule | Octane: OpenBSD 6.9 reaches PCI through the Bridges' 64 GB windows (IOC3 at 0xF0_4050_0000) and takes the SuperIO interrupt from the first empty Bridge slot, so virtio goes in slots 6 and 7 (`bridge_slot`); what it attaches |
| [impact-id-word-answers-narrow-reads.md](devices/impact-id-word-answers-narrow-reads.md) | rule | High IMPACT: the GIO ID word must also answer 8- and 16-bit reads at its byte lanes; OpenBSD 6.9's `gio_id()` otherwise rejects the board, never attaches the Impact console, and the kernel runs silent in `sched_idle` (#833) |
| [ip30-ps2-keyboard-runs-set-3.md](devices/ip30-ps2-keyboard-runs-set-3.md) | rule | Octane: PROM 4.17 and IRIX's `ioc3_pckm` put the PS/2 keyboard in scan code set 3 (Linux/OpenBSD use 2); K_RD slot order, CLAMP_THREE, role by F2 answer; how the PROM's keyboard sequence was traced |
| [ip30-promdrive.py](devices/ip30-promdrive.py) | howto | Drives the Octane PROM on its TCP serial console: waits for the maintenance menu, enters the command monitor, runs commands, echoes everything |
| [aic7880-emulation-vs-spec.md](devices/aic7880-emulation-vs-spec.md) | open | AIC-7880: where the O2 SCSI model departs from `docs/dev/aic7880.md` (HLE above the sequencer, reset values, wide strap, residuals, interrupt gating, config space) |
Expand Down
37 changes: 37 additions & 0 deletions clanker/devices/impact-id-word-answers-narrow-reads.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# OpenBSD 6.9 on a High IMPACT: the GIO ID word must answer byte and halfword reads

Status: fixed 2026-11-22 (issue #833: OpenBSD 6.9 stops after "Found SGI-IP28,
setting up." on `highimpact`; the same ISO boots on `xz`).

Symptom: the ARCS loader prints its banner and the kernel prints nothing,
forever. The guest is not hung: PC samples sit in `sched_idle` (the idle loop)
and the kernel is waiting for the installer's console it never got. Kernel
memory shows `giofb_consid` = 0 and `impact_cons` all zero: the Impact
console was never attached, so no kernel output reaches the screen, which
keeps showing the PROM's text window.

Cause: OpenBSD's `gio_id()` (sys/arch/sgi/gio/gio.c) reads the word at the
slot base, then a halfword at +2 and a byte at +3, and only trusts the word as
a 32-bit ID when they match its low bytes. The board answered the word
(0x00050190) but read 0 at +2 and +3 (a register-file lookup of an unmapped
offset), so the probe fell through to the "is it a REX3 or GR2" tests and
returned nothing. The MGRAS trace shows it: `rd gio_id = 0x00050190`,
`rd [0x00002] = 0`, `rd [0x00003] = 0`, then no more board accesses at all.
IRIX reads the ID as a word, which is why only this probe noticed.

Fix: `gio_id_lane` in `src/dev/mgras/mod.rs` returns the ID's bytes at their
big-endian lanes for 8- and 16-bit reads at offsets 0-3. Unchecked on real
hardware: whether a High IMPACT answers the narrow reads with the lanes or
with a bus error (the driver accepts either; zero is what breaks it).

How to reproduce and look: `[machine] profile = "indigo2_ip28"`, banks
`[256, 0, 0, 0]`, `[graphics] board = "highimpact"`, the sgi install69.iso
on `[scsi.4]` with `cdrom = true`, `--ci`; dismiss the failed autoboot, open
the PROM menu's Command Monitor and `boot -f
scsi(0)cdrom(4)rdisk(0)partition(8)/sash64
scsi(0)cdrom(4)rdisk(0)partition(0)/bsd.rd.IP28`. The kernel's symbols are in
`bsd.rd.IP28` (not stripped): the ISO is an SGI volume header, then a
big-endian UFS1 filesystem at partition 0 (superblock 8 KiB in), so the
kernel is read with a small UFS reader rather than an ISO9660 one.
`mgras trace FILE all` from the boot command on shows the kernel's board
accesses.
14 changes: 14 additions & 0 deletions src/dev/mgras/mgras_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,20 @@ fn fifo_fast_fill_lands_top_down() {
m.stop_engines();
}

#[test]
fn narrow_id_reads_return_the_words_own_bytes() {
// OpenBSD's GIO probe takes the ID word only if reads at +2 (16-bit) and
// +3 (8-bit) agree with it.
let m = live_board();
assert_eq!(read(&m, 32, 0), 0x0005_0190);
assert_eq!(read(&m, 16, 0), 0x0005);
assert_eq!(read(&m, 16, 2), 0x0190);
assert_eq!(read(&m, 8, 1), 0x05);
assert_eq!(read(&m, 8, 2), 0x01);
assert_eq!(read(&m, 8, 3), 0x90);
m.stop_engines();
}

#[test]
fn fifo_and_direct_writes_keep_program_order() {
let m = live_board();
Expand Down
13 changes: 12 additions & 1 deletion src/dev/mgras/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,17 @@ const MAP_SIZE: u32 = 0x10_0000;
/// GIO ID: product 0x10, 32-bit ID, revision 1, GIO64, no ROM, manufacturer 1.
pub const GIO_ID: u32 = 0x0005_0190;

/// A byte or halfword read of the ID word takes its bytes (big-endian), as a
/// GIO probe checks the narrow reads against the word.
fn gio_id_lane(off: u32, bits: u32) -> u64 {
if bits >= 32 {
return GIO_ID as u64;
}
let n = bits / 8;
let at = (off & 3) & !(n - 1);
(GIO_ID >> (8 * (4 - at - n))) as u64 & ((1 << bits) - 1)
}

const HQ_FIFO_DEPTH: usize = 65536;
/// Deep enough for most of a frame's texture loads (Quake 3 on High IMPACT
/// moves ~13 MB a frame, 1.6 M entries), so the HQ finishes a DMA, and the
Expand Down Expand Up @@ -220,7 +231,7 @@ impl Front {

fn read(&mut self, off: u32, bits: u32) -> u64 {
match off {
0 => GIO_ID as u64,
0..=3 => gio_id_lane(off, bits),
host::UCODE..=0x45FFF => self.hq.ucode[((off - host::UCODE) / 4) as usize] as u64,
0x60000..=0x67FFF => {
let t = dcb::Txn::decode(off);
Expand Down