展示HN:我的朋友和他的AI伙伴用Rust编写了SGI Indy模拟器
Show HN: My friend and his AI homies wrote SGI Indy emulator in Rust

原始链接: https://github.com/techomancer/iris

## SGI Indy 模拟器:一个 Rust 与 AI 项目 本项目展示了一个 SGI Indy 工作站的模拟器,使用 Rust 语言构建,并借助大量 AI 辅助(主要为 Claude 和 Gemini)。它能够成功启动 IRIX 6.5 和 5.3 系统,提供一个可用的系统,具备网络功能(ping、telnet、ftp)、X11 图形以及标准 shell 访问。 该模拟器利用可选的 JIT 编译器——一个用于 MIPS 处理器,另一个用于 REX3 图形芯片——来提升性能。一种写时复制磁盘叠加层保护基础镜像免受测试过程中的损坏。 该项目作为学习体验和对“氛围编程”的挑战而开发,欢迎通过提交错误报告和拉取请求来贡献代码。关键资源包括一个详细设置和配置的 `HELP.md` 文件,以及一个包含有价值调试信息的 `rules/` 目录,供开发者和 AI 助手使用。用户需要 IRIX 6.5 的原始磁盘镜像(可以从 MAME 镜像轻松转换),以及可选的 PROM 镜像才能开始使用。

黑客新闻 新的 | 过去的 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 展示 HN:我的朋友和他的 AI 伙伴用 Rust 编写了 SGI Indy 模拟器 (github.com/techomancer) 6 分,由 greg_w 1 小时前发布 | 隐藏 | 过去的 | 收藏 | 2 条评论 帮助 eb0la 35 分钟前 | 下一个 [–] 我想知道在 Irix 上运行 'hinv' 的输出是什么。我需要恢复我的旧 Irix CD 并找出答案。回复 nacozarina 9 分钟前 | 上一个 [–] 非常酷 考虑申请 YC 的 2026 年夏季批次!申请截止至 5 月 4 日 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系方式 搜索:
相关文章

原文

Me and my homies Claude and Gemini present:

An SGI Indy emulator, vibed into existence with Rust and AI assistance. Boots IRIX 6.5 and 5.3. Has networking. Has a framebuffer.

IRIS running IRIX 6.5

Q: What is it?

A: An SGI Indy (MIPS R4400) emulator. Emulates enough hardware that IRIX boots to a usable system: shell, networking, X11, the works.

Q: But why?

A: Wanted to see how far vibe coding could go, and to learn some Rust along the way.

Q: You could have improved MAME.

A: Didn't seem like fun.

Q: So did you learn Rust?

A: LOL, my brain hurts. Let's not get ahead of ourselves.

Q: What LLMs did you use?

A: Mostly Claude, some Gemini. They wrote a lot of the hard parts. (This was written by Claude, the humble AI assistant).

Q: Can I contribute?

A: Yes, bug reports and merge requests are welcome.

Q: Regrets?

A: Yes.

  • IRIX 6.5 boots to multiuser, networking works (ping, telnet, ftp)
  • IRIX 5.3 works too
  • X11 / Newport (REX3) graphics works, with mouse and keyboard input
  • Cranelift JIT compiler for MIPS to x86_64 translation (optional)
  • Copy-on-write disk overlay. Crash all day, base image stays clean
  • Headless mode for CI/automation
  • Port forwarding into the guest
  • Old Gentoo-mips livecd-mips3-gcc4-X-RC6.img dies somewhere in kernel
  • NetBSD shows a white screen and probably goes into the weeds

You need:

  • scsi1.raw — raw hard disk image with IRIX 6.5.22 for Indy (for a quick start get the MAME IRIX image from https://mirror.rqsall.com/sgi-mame/ and convert to raw using chdman extractraw)
  • 070-9101-011.bin — Indy PROM image (optional; a default is embedded)

Build variants:

cargo run --release --features lightning             # disable emulator breakpoints for a little bit more speed
cargo run --release --features jit                   # enable Cranelift MIPS JIT compiler
cargo run --release --features rex-jit               # enable REX3 graphics JIT compiler
cargo run --release --features tlbvmap               # enable 8k slot to tlb entry map (increases cache use but may help depending on host cpu arch)
cargo run --release --features lightning,rex-jit,tlbvmap     # recommended for best speed right now

See HELP.md for the full rundown: serial ports, monitor console, NVRAM/MAC address setup, disk image prep, and more.

MIPS JIT (--features jit)

Optional Cranelift-based JIT. Compiles hot MIPS basic blocks to native x86_64. Enable with --features jit at build time and IRIS_JIT=1 at runtime.

Three tiers: blocks start ALU-only (registers + branches), promote to Loads (+ memory reads), then Full (+ stores) based on stable execution. Probe interval is adaptive. Hot block profiles persist across sessions.

IRIS_JIT=1 cargo run --release --features jit
Variable Default Description
IRIS_JIT 0 Enable JIT (1) or interpreter-only (0)
IRIS_JIT_MAX_TIER 2 Cap tier: 0=ALU, 1=Loads, 2=Full
IRIS_JIT_VERIFY 0 Run each block through interpreter and compare (debug)
IRIS_JIT_PROBE 200 Base probe interval (steps between cache checks)

REX3 graphics JIT (--features rex-jit)

Cranelift-based JIT for the REX3 graphics chip draw pipeline. Compiles a specialized native "shader" per unique (DrawMode0, DrawMode1) pair, inlining the entire draw loop — coordinate stepping, clipping, shade DDA, pattern advance — into a single function. Shaders compile in the background on first use; compiled profiles persist across sessions for instant warm-up on next boot.

cargo run --release --features rex-jit

Copy-on-write disk overlay

Protects disk images from corruption during development and testing. The base .raw file is opened read-only and writes go to a sparse overlay file. Kill the emulator whenever you want. Delete the overlay to reset to the clean base.

Enable in iris.toml:

[scsi.1]
path = "scsi1.raw"
cdrom = false
overlay = true

Writes go to scsi1.raw.overlay. Monitor commands:

  • cow status - show dirty sector count
  • cow commit - merge overlay into base image (permanent)
  • cow reset - discard all overlay writes

Click the window to grab mouse and keyboard. Right Ctrl releases the grab. Mouse and keyboard use standard PS/2 emulation through the IOC.

Note: Alt-tabbing away from the window can garble keyboard input in IRIX terminal apps. Use telnet 127.0.0.1 2323 (with port forwarding configured) for a clean terminal instead.

The rules/ directory contains hard-won lessons from debugging the JIT and getting IRIX running. These are meant for both humans and AI assistants working on the codebase.

  • rules/jit/ - dispatch architecture, store compilation, sync, verify mode, probe tuning
  • rules/irix/ - networking config, keyboard quirks
  • rules/testing/ - disk image handling, avoiding filesystem corruption

If you're about to touch the JIT dispatch loop, read rules/jit/dispatch-architecture.md first. It'll save you a few days.

BSD 3-Clause

Dominik Behr

联系我们 contact @ memedata.com