• Please review our updated Terms and Rules here

Bus sniffing a IBM 5150

GloriousCow

Experienced Member
Joined
Oct 28, 2022
Messages
71
Following in the footsteps of reenigne here with his wonderful xtserver, previously mentioned here:
https://forum.vcfed.org/index.php?threads/8088-isa-bus-sniffer-device.32469/
and here:
https://www.reenigne.org/blog/isa-bus-sniffer-update/

I thought I'd try my hand at bus-sniffing. I have used reenigne's xtserver to reconstruct CPU cycle traces for 8088MPH's CPU test (shameless plug), but wanted to dive a little deeper. xtserver can capture 2048 cycles at a time; which is enough for investigating a few instructions or short routines, but can be limiting for larger explorations, such as troubleshooting Minix booting or investigating Area 5150's complex interrupt timings... Plus I am just jealous of doing cool things like this.

I pondered designing my own sniffer device, perhaps a Pi Pico on an ISA card (which has been done) or a Teensy, but designing an ISA card is a bit of a leap for me. After all my Arduino8088 is mostly passive traces, and every microcontroller option fast enough seems to require a design bristling with level shifters and I get annoyed at trying to lay it out. It would probably end with tears, and probably at least part of the computer on fire. Not good.

So I thought I would just throw money at the problem and use a 32-channel logic analyzer. They don't need level shifters at all.

I run signals out of the case from the 8087 socket and various probe points of interest on two ribbon cables:

final_probes.JPG


probes_attached.jpg

The other end of the FPU cable goes to one of those Raspberry Pi GPIO to breadboard adapters; a custom PCB for this would be much nicer, but this is what I have for now. A big hot mess; enjoy.

The analyzer I am using is the DSLogic U3Pro32 which is heavily riding the coattails of the sigrok project as far as documentation and software goes, but it could be worse. The unit itself seems nice, and is incredibly tiny. It streams over USB 3.0 at 50MHz if you use all 32 channels; this seems sufficient for what I need it to do. Since it streams, there's no real storage concerns.

The software spits out enormous CSV files, which are just the state of all the input probe lines any time one of them changes (I am afraid of how big the 'uncompressed' csv format might be). To give you an idea, 1 second of capture produces 1.6GB of CSV. Yikes..
There's a native format that is much, much smaller, but it requires figuring out libsigrokdecode. That's something I should probably eventually look into, but for the moment I decided just to beat on the enormous CSV files with pandas instead. Most of the logic was familiar to me from my Arduino8088 project, just instead of reading GPIO pins, I'm reading CSV columns. Easy.

Tonight I got the signal decoder working and can produce reasonable cycle traces and instruction disassembly:

1695695611668.png

I'm excited to see if I can use this to push MartyPC's emulation accuracy that much further. The tantalizing prospect of capturing cycle traces with VSYNC, HSYNC and DISPEN off the CRTC awaits!
 
Last edited:
It's a bit cursed but i've turned Excel into a logic analyzer.

formatted_01.PNG

I've put up a bit of a blog article with more details.

https://martypc.blogspot.com/2023/10/bus-sniffing-ibm-5150.html

I'll be publishing a few interesting bus traces, a new capture of the 8088MPH CPU test and Kefrens bars effect, and a few frames of the Area 5150 Wibble/Lake effect.
If anyone has any interesting code they'd like a cycle trace of, let me know! I can also swap out various probe signals on request if there's something specific you'd like to see.
 
Back
Top