SISO.dev

The goal of this project is to get Rust code running on an IBM 5150. Yes, that is probably a tall order, but it should be fun! 😄

I don't have a real IBM 5150 to hand, so I'm building a clone. And I don't want to risk breaking it while figuring out the Rust and LLVM backends, so I'm also trying to write a cycle-accurate emulator!

To-do list:

  • IBM 5150 clone:
  • siso crate:
    • Basic single-threaded 5150 emulator
    • Keyboard I/O
    • Graphics
    • Microcode emulator
    • async framework for emulating internal parallelism
  • Rust target i088-none-eabi:
    • Write LLVM backend
    • Add target to Rust
    • Test on siso emulator
    • Test on IBM 5150 clone
🖥️

I'm implementing an Intel 8284a clock oscillator chip in async Rust.

Idea: clock + its listeners run in separate Tokio tasks for parallelism; the clock waits for listeners to finish before its next tick.

My first version using Tokio channels maxes out at a 35kHz crystal. A bit less than 14MHz 😅

Aaand I figured it out 😅

The WiFi232 was sending its Probe Request on channel 1. Once I changed my AP to use channel 1, I got an immediate connection!

I've opened Wireshark to investigate. The WiFi232 by default sends beacon frames for its ad-hoc AP (which I can connect to), and then on ATC1 it switches to sending a periodic Probe Request for the target SSID until it times out. But I can't find Probe Responses from my AP! For any device!

Sadly, WiFi configuration isn't working. The firmware build for the device I received is from 2019, and I got my access point in 2021, so maybe it has newer security settings?

And luckily also a Mini USB cable, because that's what this requires for power.

Okay, plug it in, connect (via 1200 baud as default, good in case the desired retro computer is old!) and send "ATI" to get... a nice status screen!

Output of the "ATI" command, showing information such as the IP and MAC address, configured gateway, and call status.

A few weeks ago I stumbled upon a post by Paul Rickards (https://mastodon.social/@paulrickards/110153034470766163) about a device he makes.

It's a WiFi card that pretends to be a Hayes modem over an RS-232 serial connection.

In unrelated news, I have poor self-control, and a USB-to-serial cable.

Photo of a WiFi232. At the top is an RS-232C connector. A serial chip is partially visible behind an ESP8266 module.

Anyway, that's what I'll be posting about here (my other regularly-scheduled nonsense will be over at @str4d.xyz), so if you're interested, stick around!

I'd cap this thread off with a blue sky post, but we don't exactly get a whole lot of that here 😅

I fully expect that whatever LLVM backend I manage to get working will initially be dangerous for the hardware. So I am also trying to write a cycle-accurate 5150 emulator!

*immediately turns hardware project into software project*

In practice, there are a BUNCH of reasons why this probably won't work. Foremost is that Rust assumes a flat memory model, but the Intel 8086 uses a segmentation model that overlaps a 16-bit segment and offset to get a 20-bit address. We'll want more than 64 kiB of memory, so I guess we lie to Rust!

And what will I do with the machine? There's all the fun retro-computing stuff one could do, but I specifically want to run Rust code on an IBM 5150!

Shouldn't be too bad: add an Intel 8088 target to LLVM and Rust, compile some code, flash to a ROM, and done! Right? 🫠