Show HN: SSH into DOS: I wrote an x86 (IBM PC) emulator dialup.net · 15 points ·...
HN Best 200 @best
Show HN: SSH into DOS: I wrote an x86 (IBM PC) emulator dialup.net · 15 points · 3 comments · HN thread
TL;DR Farcall is a hand-written emulator of the original 1981 IBM PC and its 8088 CPU, written in Rust by a developer who wanted to learn how x86 and PCs work. It runs PC-DOS, MS-DOS 2.0 programs, GLaBIOS, and CGA graphics, and is reachable publicly via SSH at intodos.com, where Zork, NetHack, GW-BASIC, Sopwith and Digger can be played in a Kitty-graphics-capable terminal.
- Started as a Rust command-line program running COM files, then grew to boot PC-DOS 2.0 from a floppy image by implementing the 8088 instruction set and BIOS/DOS interrupt services.
- Moved from high-level interrupt emulation to running a real BIOS ROM (GLaBIOS), which required emulating the PPI, PIT, DMA controller and floppy controller.
- CGA graphics required de-interleaving video memory: the CRTC's scanline number drives bit 13 of the address, so even and odd scanlines sit in separate 8 KiB halves.
- Graphics are streamed to the terminal via the Kitty graphics protocol; frames are sent as 4-bit indexed PNGs, cutting frame-preparation CPU use by over 70%.
- Performance fixes included checking the clock only every 128 steps, since fetching time took about 43% of CPU; the emulator is not cycle-accurate.
- Next goals are hard drive support, EGA/VGA, and a 286 with protected mode so Windows 3.1 can run. Source is MIT-licensed on GitHub.
Discussion The thread is small, with only the author's introduction and one reply. The mood is friendly and appreciative. The author posted the project as a learning exercise and invited questions. The only substantive exchange is a commenter asking about terminal graphics alternatives, and the author explains the choice of Kitty protocol because Ghostty and several other terminals support it well.
- Impressed by the project and the terminal-based DOS experience (some): Commenters appreciated the novelty of running DOS games over SSH and the Kitty graphics frontend. The reply to the author's post expressed interest in terminal graphics options.
- Interest in sixel as an alternative graphics protocol (a few): One commenter pointed to libsixel as a Unix terminal graphics option besides Kitty. The author replied that Kitty has broad support among terminals and that Ghostty is their own choice.
Links from the comments